目录
2.1. 启动my-clickhouse-server容器实例
2.3.my-clickhouse-server容器的配置文件、目录复制到本地挂载目录下
2.4. 复制完成后,停止删除容器my-clickhouse-server
2.5.重新运行部署my-clickhouse-server
2.6 clickhouse-servers设置密码,修改完成后,重启容器。
UK Property Price Paid | ClickHouse Docs
docker 、CentOS 7.9
docker run -d --name my-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server
引用/home下空间比较大,所以映射路径都放在/home下
- mkdir -p /home/clickhouse-server/
- mkdir -p /home/clickhouse-server/etc/
- docker cp my-clickhouse-server:/var/log/clickhouse-server /home/clickhouse-server/
- docker cp my-clickhouse-server:/var/lib/clickhouse /home/clickhouse-server/
- docker cp my-clickhouse-server:/etc/clickhouse-server /home/clickhouse-server/etc/
- docker stop my-clickhouse-server
- docker rm my-clickhouse-server
- docker run -d --restart=always --privileged=true -p 8123:8123 -p 9000:9000 --name my-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 \
- yandex/clickhouse-server
vim /home/clickhouse-server/etc/clickhouse-server/users.xml
- 密码生成命令,具体内容可参考users.xml文件内说明
-
- [root@inlong clickhouse]# PASSWORD=$(base64 < /dev/urandom | head -c8); echo "clickhouse"; echo -n "clickhouse" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-'
- clickhouse
- 5873faa64eaf2895016c5ee79af4704e167fec7a
- <clickhouse>
-
-
- <profiles>
-
- <default>
-
- <max_memory_usage>10000000000max_memory_usage>
-
-
- <load_balancing>randomload_balancing>
- default>
-
-
- <readonly>
- <readonly>1readonly>
- readonly>
- profiles>
-
- <users>
-
- <default>
-
- <password_double_sha1_hex>5873faa64eaf2895016c5ee79af4704e167fec7apassword_double_sha1_hex>
-
-
- <networks>
- <ip>::/0ip>
- networks>
-
- <profile>defaultprofile>
-
-
- <quota>defaultquota>
-
-
- <access_management>1access_management>
- default>
-
- <inlong>
- <password_double_sha1_hex>5873faa64eaf2895016c5ee79af4704e167fec7apassword_double_sha1_hex>
- <networks>
- <ip>::/0ip>
- networks>
- <profile>defaultprofile>
- <quota>inlongquota>
- <access_management>1access_management>
- inlong>
- users>
-
-
- <quotas>
-
- <default>
-
- <interval>
-
- <duration>3600duration>
-
-
- <queries>0queries>
- <errors>0errors>
- <result_rows>0result_rows>
- <read_rows>0read_rows>
- <execution_time>0execution_time>
- interval>
- default>
- <inlong>
- <interval>
- <duration>7200duration>
- <queries>0queries>
- <errors>0errors>
- <result_rows>0result_rows>
- <read_rows>0read_rows>
- <execution_time>0execution_time>
- interval>
- inlong>
- quotas>
- clickhouse>
docker run -it --rm --link my-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server --user default --password=clickhouse
- 6eafc5c3cfd1 :) CREATE DATABASE IF NOT EXISTS flink_clickhouse
-
- CREATE DATABASE IF NOT EXISTS flink_clickhouse
-
- Query id: 75018a8e-323f-4193-885a-455848102a9d
-
- Ok.
-
- 0 rows in set. Elapsed: 0.002 sec.