版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/MadCode2222222222222/article/details/89952043
clickhouse简介:
速度快的恐怖,官方测试100M数据集,比Hive快279倍,比My SQL 快801倍
docker下安装:
拉取镜像:
docker pull yandex/clickhouse-server
启动:
docker run -d --name some-clickhouse-server -p 8123:8123 -p 9000:9000 --ulimit nofile=262144:262144 yandex/clickhouse-server
连接clickhouse数据库:
进入容器:
docker exec -it 41caec01688a bash
连接:
clickhouse-client
-- 列出数据库列表
show databases;
-- 创建数据库
create database test;
--切换数据库
use test;
-- 列出数据库中表列表
show tables;
-- 创建第一个表
create table example(name String, age UInt8) Engine=Log;
-- 插入测试数据
insert into example values('小明',18);
-- 查询
select * from example;
-- 删除一个表
drop table if exists example;
设置clickhouse允许远程连接:
进入clickhouse容器:
进入该目录:
解决docker 中不能用vim编辑文件
apt-get update
apt-get install -y vim
编辑config.xml
添加:
<listen_host>::</listen_host>
重启clickhouse
查看mysql容器的ip
docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container-ID>