启动ClickHouse-server
最新版本
docker run -d --name test-clickhouse-server-latest --ulimit nofile=262144:262144 yandex/clickhouse-server
20.12.4.5
docker run -d --name test-clickhouse-server-20-12 --ulimit nofile=262144:262144 yandex/clickhouse-server:20.12.4.5
启动ClickHouse-client
最新版本
docker run -it --rm --link test-clickhouse-server-latest:clickhouse-server yandex/clickhouse-client --host clickhouse-server
上图,可以看出ClickHouse client版本是21.2.4.6, ClickHouse server的版本是21.2.4
20.12.4.5
docker run -it --rm --link test-clickhouse-server-20-12:clickhouse-server yandex/clickhouse-client:20.12.4.5 --host clickhouse-server
上图,可以看出ClickHouse client版本是20.12.4.5, ClickHouse server的版本是20.12.4
导入数据
create table default.test(`id` Int64, `name` String, `birthday` DateTime DEFAULT toDateTime('0000-00-00 00:00:00')) ENGINE = MergeTree() PRIMARY KEY(id) ORDER BY(id);
insert into default.test (id, name, birthday) VALUES (1, 'test1', '2019-10-02 01:00:00'), (2, 'test2', '2019-10-02 02:00:00'),(3, 'test3', '2019-10-02 03:00:00'),(4, 'test4', '2019-10-02 04:00:00');
查询数据
select * from default.test;
登录clickhouse server容器查看目录结构
- docker ps 查看档期运行的容器
- docker exec 进入容器,并运行bash
- 使用bash命令进行操作
问题
- docker pull hang主在waiting状态
重启docker可以解决