下载docker clickhouse包
> sudo docker pull yandex/clickhouse-client
> sudo docker pull yandex/clickhouse-server
运行clickhouse-server容器
> sudo docker run --network=lnmp_lnmp --ulimit nofile=262144:262144 --volume=$HOME/some_clickhouse_database:/var/lib/clickhouse yandex/clickhouse-server
获取使用docker-compose
----------------------
version: "2"
services:
clickhouse:
image: yandex/clickhouse-server
networks:
lnmp:
ipv4_address: 172.18.0.6
expose:
- "9000"
- "8123"
user: root
ports:
- "9001:9000"
- "8123:8123"
volumes:
- /home/ctrl/docker/data/clickhouse/conf/:/etc/clickhouse-server/
- /home/ctrl/docker/data/clickhouse/data/:/var/lib/clickhouse/
ulimits:
nofile:
soft: 262144
hard: 262144
privileged: true
networks:
lnmp:
ipam:
config:
- subnet: 172.18.0.0/16
gateway: 172.18.0.1
---------------------
运行
> sudo docker run --network=lnmp_lnmp -it --link clickhouse-server的容器id clickhouse-client的镜像id --host 172.18.0.6 --user default --password pwd