version: '3'
services:
clickhouse-server:
restart: always
image: yandex/clickhouse-server
container_name: clickhouse-server
ulimits:
nofile:
soft: 262144
hard: 262144
ports:
- 8123:8123
- 9000:9000
- 9009:9009
volumes:
- ./data:/var/lib/clickhouse
- ./config.xml:/etc/clickhouse-server/config.xml
- ./users.xml:/etc/clickhouse-server/users.xml
- ./log:/var/log/clickhouse-server
networks:
- net_db
healthcheck:
test: wget --no-verbose --tries=1 --spider localhost:8123/ping || exit 1
interval: 2s
timeout: 2s
retries: 16
#clickhouse-client:
# restart: always
# image: yandex/clickhouse-client
# container_name: clickhouse-client
# command: ['--host', 'clickhouse-server', '--query', 'select * from system.functions order by name limit 4']
# networks:
# - net_db
# depends_on:
# clickhouse-server:
# condition: service_healthy
networks:
net_db:
external: true
--------------------------------------------------
先拷贝出来: docker cp clickhouse-server:/etc/clickhouse-server/config.xml /docker/clickhouse/config.xml
再放开yaml里:#- ./config.xml:/etc/clickhouse-server/config.xml
先拷贝出来: docker cp clickhouse-server:/etc/clickhouse-server/users.xml /docker/clickhouse/users.xml
再放开yaml里:#- ./users.xml:/etc/clickhouse-server/users.xml
config.xml 放开ip地址:<listen_host>0.0.0.0</listen_host>
users.xml 设置密码:<password>qh123</password>
评论
发表评论