官网安装参考地址:
https://hub.docker.com/r/clickhouse/clickhouse-server/
1、拉取镜像
> sudo docker pull yandex/clickhouse-client
> sudo docker pull yandex/clickhouse-server
2、启动容器
docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server
做目录挂载和端口映射
docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 \
-p 8123:8123 -p 9000:9000 -p 9009:9009 \
-v /mydata/clickhouse/data/:/var/lib/clickhouse \
-v /mydata/clickhouse/conf/clickhouse-server/config.xml:/etc/clickhouse-server/config.xml \
-v /mydata/clickhouse/log:/var/log/clickhouse-server \
yandex/clickhouse-server
3、客户端连接
docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server
4、连接成功
ClickHouse client version 21.12.3.32 (official build).
Connecting to clickhouse-server:9000 as user default.
Connected to ClickHouse server version 21.12.3 revision 54452.