docker搭建clickhouse并初始化用户名密码
1、新建挂载目录
mkdir -p /home/clickhouse-server/
mkdir -p /home/clickhouse-server/etc/
2、拉取镜像
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:/var/log/clickhouse-server /home/clickhouse-server/
docker cp clickhouse-server:/var/lib/clickhouse /home/clickhouse-server/
docker cp clickhouse-server:/etc/clickhouse-server /home/clickhouse-server/etc/
5、删除临时容器
docker stop clickhouse-server
6、找到/home/clickhouse-server/etc/clickhouse-server/users.xml 目录下的文件,配置用户名密码
把default改成root,并且配置密码
7、启动容器
docker run -d --restart=always --privileged=true -p 8123:8123 -p 9000:9000 --name clickhouse-server --ulimit nofile=262144:262144 \
-v /home/clickhouse-server/clickhouse-server:/var/log/clickhouse-server \
-v /home/clickhouse-server/clickhouse:/var/lib/clickhouse \
-v /home/clickhouse-server/etc/clickhouse-server:/etc/clickhouse-server \
clickhouse/clickhouse-server
原文地址:https://blog.csdn.net/weixin_41463944/article/details/142534145
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!