🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
docker 安装 ``` # 1、创建数据目录 mkdir -p /data/clickhouse/data mkdir -p /data/clickhouse/conf mkdir -p /data/clickhouse/log # 2、下载 # 下载最新版本clickhouse docker pull clickhouse/clickhouse-server # 下载指定版本clickhouse docker pull clickhouse/clickhouse-server:22.7.3.5-alpine # 3、查看 Network ports | ClickHouse Docs 中端口号配置 ,暂时只需要映射8123(http-api) 9000(TCP) 两个端口 # 4、创建临时容器,用以生成配置文件 # 容器关闭后会自动删除掉 docker run -d --rm --name clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server:22.7.3.5-alpine # 5、将配置文件复制到 /data/clickhouse/conf 路径下 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 # 6、修改config.xml的listen_host配置 vi /data/clickhouse/conf/config.xml <listen_host>::</listen_host> # 7、关闭临时容器 docker stop clickhouse-server # 7、启动容器 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:22.7.3.5-alpine # 8、验证 docker exec -it clickhouse-server /bin/bash /usr/bin/clickhouse-client show databases; quit; ```