赞
踩
docker --version
1.打开Docker配置中心:任务栏小鲸鱼右键 -> Settings
2.配置Docker文件挂载目录权限:左侧菜单 Resources -> FILE SHARING -> 加号 -> D:\clickhouse -> 选择文件夹
3.配置Docker国内镜像加速下载:左侧菜单 Docker Engine -> 右侧输入框 -> Apply & Restart
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
],
"insecure-registries": [],
"debug": false,
"experimental": false,
"features": {
"buildkit": true
}
}
docker pull yandex/clickhouse-server
docker pull yandex/clickhouse-client
docker run --rm -d --name=temp-clickhouse-server yandex/clickhouse-server
docker cp temp-clickhouse-server:/etc/clickhouse-server/config.xml D:/clickhouse/conf/config.xml
docker cp temp-clickhouse-server:/etc/clickhouse-server/users.xml D:/clickhouse/conf/users.xml
tips:如果没有配置Docker文件挂载目录权限,会报错。
(3) 查看文件情况
docker exec -it temp-clickhouse-server /bin/bash
PASSWORD=$(base64 < /dev/urandom | head -c8); echo "zhai"; echo -n "zhai" | sha256sum | tr -d '-'
执行结果
(3) 修改 D:/clickhouse/conf/users.xml 文件
<users>
<zhai>
<password_sha256_hex>3b75903cd12c5e8ad59f73feb4baa526ed3fe234f2d77d421d7b9d73fefb3f61</password_sha256_hex>
<networks incl="networks" replace="replace">
<ip>::/0</ip>
</networks>
<profile>zhai</profile>
<quota>zhai</quota>
</zhai>
</users>
<listen_host>0.0.0.0</listen_host>
docker stop temp-clickhouse-server
docker run -d --name=single-clickhouse-server -p 8123:8123 -p 9000:9000 -p 9009:9009 --ulimit nofile=262144:262144 --volume D:/clickhouse/data:/var/lib/clickhouse:rw --volume D:/clickhouse/conf:/etc/clickhouse-server:rw --volume D:/clickhouse/log:/var/log/clickhouse-server:rw yandex/clickhouse-server
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。