目录
3.查看 Network ports | ClickHouse Docs 中端口号配置 ,暂时只需要映射8123 9000 两个端口
5.将配置文件复制到 /data/clickhouse/conf 路径下
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:23.1.3.5-alpine
3.查看 Network ports | ClickHouse Docs 中端口号配置 ,暂时只需要映射8123 9000 两个端口
4.创建临时容器,用以生成配置文件
# 容器关闭后会自动删除掉
docker run -d --rm --name clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server
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.关闭临时容器
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
8.连接clickhouse
使用dbeaver创建连接,选择clickhouse—输入ip+port(有账户密码的需输入对应信息)—测试连接,成功后点击确定即可。
clickhouse相关知识站点:
Welcome to ClickHouse Docs | ClickHouse Docs
clickhouse中文官方文档:什么是ClickHouse? | ClickHouse文档
golang连接clickhouse:GitHub - mailru/go-clickhouse: Golang SQL database driver for Yandex ClickHouse
docker部署部分转自:使用Docker安装ClickHouse_飘渺Jam的博客-CSDN博客_clickhouse docker