docker搭建clickhouse

1、准备工作,新建虚机的目录,并开启权限

mkdir -p /home/clickhouse/data

mkdir -p /home/clickhouse/conf

mkdir -p /home/clickhouse/log

chmod 777 /home/clickhouse/data

chmod 777 /home/clickhouse/conf

chmod 777 /home/clickhouse/log

2、拉取镜像

docker pull clickhouse/clickhouse-server

3、启动临时容器(该容器停止后会被删除)

docker run -d --rm --name clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server

4、拷贝挂载目录

docker cp clickhouse-server:/etc/clickhouse-server/config.xml /home/clickhouse/conf/config.xml
docker cp clickhouse-server:/etc/clickhouse-server/users.xml /home/clickhouse/conf/users.xml

5、停止临时容器

docker stop clickhouse-server

6、创建新容器

docker run --restart=always -d --name=clickhouse-server \
-p 8123:8123 -p 9000:9000 \
--ulimit nofile=262144:262144 \
-v /home/clickhouse/data:/var/lib/clickhouse:rw \
-v /home/clickhouse/conf/config.xml:/etc/clickhouse-server/config.xml \
-v /home/clickhouse/conf/users.xml:/etc/clickhouse-server/users.xml \
-v /home/clickhouse/log:/var/log/clickhouse-server:rw \
clickhouse/clickhouse-server

你可能感兴趣的:(docker,clickhouse,eureka)