跳至主要内容

Docker-Compose 安装 ClickHouse

 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>

评论

此博客中的热门博文

统信UOS 离线安装 supervisor

  1、python 安装(可忽略,系统一般已安装好) https://www.python.org/downloads/source/ tar -zxvf Python-3.11.4.tgz cd Python-3.11.4 ./configure --prefix=/usr/local/python3 make && make install ln -s /usr/local/python3/bin/python3.11 /usr/local/bin/python3 ln -s /usr/local/python3/bin/pip3.11 /usr/local/bin/pip 2、setuptools 安装 https://pypi.org/project/setuptools/#files tar -zxvf setuptools-0.6c11.tar.gz cd setuptools-0.6c11 python setup.py install 3、meld3 安装 https://pypi.org/project/meld3/#files tar -zxvf meld3-2.0.1.tar.gz cd meld3-2.0.1 python3 setup.py install 4、supervisor 安装 https://pypi.org/project/supervisor/ tar -zxvf supervisor-4.2.5.tar.gz cd supervisor-4.2.5 python3 setup.py install supervisor 配置 mkdir /etc/supervisor echo_supervisord_conf > /etc/supervisor/supervisord.conf vi /etc/supervisor/supervisord.conf # 以下是要修改的内容 [unix_http_server] file=/var/run/supervisor.sock ; (the path to the socket file) [supervisorctl] serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL

Docker-Compose 安装 xxl-job-admin

 version: '3' services:  xxl-job-admin:    image: xuxueli/xxl-job-admin:2.3.0    restart: always    container_name: xxl-job-admin    #environment:    #  PARAMS: '--spring.datasource.url= jdbc:mysql://192.168.1.110:3305/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai&useSSL=false --spring.datasource.username=root --spring.datasource.password=123456'    ports:      - 80:8080    networks:      - net_db    volumes:      - ./data/applogs:/data/applogs networks:  net_db:    external: true