docker安装Clickhouse
时间: 2023-11-06 13:02:21 浏览: 175
使用Docker安装ClickHouse的步骤如下:
1. 创建相关配置目录:mkdir -P /data/clickhouse/data mkdir -P /data/clickhouse/conf mkdir -P /data/clickhouse/log
2. 拉取ClickHouse镜像: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 /data/clickhouse/conf/config.xml docker cp clickhouse-server:/etc/clickhouse-server/users.xml /data/clickhouse/conf/users.xml
5. 关闭临时容器:docker stop clickhouse-server
6. 启动容器并映射端口和挂载目录:docker run -d --name=clickhouse-server -p 8123:8123 -p 9090:9000 --ulimit nofile=262144:262144 -v /data/clickhouse/data:/var/lib/clickhouse:rw -v /data/clickhouse/conf/config.xml:/etc/clickhouse-server/config.xml -v /data/clickhouse/conf/users.xml:/etc/clickhouse-server/users.xml -v /data/clickhouse/log:/var/log/clickhouse-server:rw clickhouse/clickhouse-server
7. 连接到ClickHouse:docker exec -it clickhouse-server clickhouse-client
阅读全文