花粉乐分享平台宣传视频
> 华为资讯 > 华为资讯 > 华为云 > ClickHouse v22.8.5.29-lts 安装笔记
ClickHouse v22.8.5.29-lts 安装笔记
来源:云原生生态圈
2023-03-09 11:24:11
892
管理

部署日期 参与人员 部署目标 版本

Mon 19 Sep 2022 @devops 部署一套本地化的分布式持久存储的Clickhouse集群 v0.1

集群信息安装Clickhouse服务

sudo apt-get updatesudo apt-get install -y apt-transport-https ca-certificates dirmngrsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.listsudo apt-get updateapt-cache madison clickhouse-server | head -n5sudo apt-get install -y clickhouse-server=22.8.5.29 clickhouse-client=22.8.5.29# 修改clickhouse的家目录以及相关属主组mkdir /home/clickhousechown -R clickhouse.clickhouse /home/clickhouseusermod -d /home/clickhouse clickhouse# 准备clickhouse的数据存储目录mkdir /data/clickhouse_bigdatachown -R clickhouse.clickhouse /data/clickhouse_bigdata# 在clickhouse的默认配置文件中修改clickhouse的数据目录sed -e 's#/var/lib/clickhouse#/data/clickhouse_bigdata#g' /etc/clickhouse-server/config.xml |grep -i '/data/clickhouse_bigdata'sed -i 's#/var/lib/clickhouse#/data/clickhouse_bigdata#g' /etc/clickhouse-server/config.xml |grep -i '/data/clickhouse_bigdata'# sudo service clickhouse-server start# clickhouse-client # or "clickhouse-client --password" if you've set up a password.配置节点域名解析

⚠️ 每个节点都需要配置

[x] 本地host配置

cat >> /etc/hosts << EOF10.0.10.195 cknode1.devopsman.cn bigdata1 10.0.10.194 cknode2.devopsman.cn bigdata210.0.10.196 cknode3.devopsman.cn bigdata3EOFDNS解析平台上进行解析ClickHouse 的集群配置配置切片和副本remote-servers.xml

bigdata /clickhouse/tables/{cluster}/{shard}/{database}/{table} {replica} cknode1.devopsman.cn

9000 cknode2.devopsman.cn

9000 cknode3.devopsman.cn

9000 配置集群需要的zookeeper信息zookeeper.xml

zookeeper-1.devopsman.cn

2181 zookeeper-2.devopsman.cn

2181 zookeeper-3.devopsman.cn

2181 30000 10000

/clickhouse/bigdata/task_queue/ddl 宏macros.xml

bigdata bigdata 2 1 监听配置信息listen.xml

1 0.0.0.0 127.0.0.1ClickHouse 账号认证授权管理员账号:clickhouse_manager.xml

1 10.0.10.0/24 127.0.0.1 ::/0

ff3ebe0b384ba70a48ef866d0e4e8bfcc3104709f3858d95e51111111110e2e683cbb3da4

clickhouse_manager default

1 1 10

1 维护账号: clickhouse_operator.xml

10.0.10.0/24 127.0.0.1 ::/0

716b36073a90c6fe1d445ac1af85f4777c5b7a155cea35911111111111111

clickhouse_operator default

1 1 10

在所有的配置文件配置完成后,切记要修改xml文件的所属属性

chown clickhouse.clickhouse /etc/clickhouse-server/config.d/*.xml /etc/clickhouse-server/users.d/*.xml

FQA安装日志

Creating clickhouse group if it does not exist.groupadd -r clickhouseCreating clickhouse user if it does not exist.useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse clickhouseWill set ulimits for clickhouse user in /etc/security/limits.d/clickhouse.conf.Creating config directory /etc/clickhouse-server/config.d that is used for tweaks of main server configuration.Creating config directory /etc/clickhouse-server/users.d that is used for tweaks of users configuration.Config file /etc/clickhouse-server/config.xml already exists, will keep it and extract path info from it./etc/clickhouse-server/config.xml has /var/lib/clickhouse/ as data path./etc/clickhouse-server/config.xml has /var/log/clickhouse-server/ as log path.Users config file /etc/clickhouse-server/users.xml already exists, will keep it and extract users info from it.Creating log directory /var/log/clickhouse-server/.Creating data directory /var/lib/clickhouse/.Creating pid directory /var/run/clickhouse-server.chown -R clickhouse:clickhouse '/var/log/clickhouse-server/'chown -R clickhouse:clickhouse '/var/run/clickhouse-server'chown clickhouse:clickhouse '/var/lib/clickhouse/'groupadd -r clickhouse-bridgeuseradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse-bridge clickhouse-bridgechown -R clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-odbc-bridge'chown -R clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-library-bridge'Enter password for default user: # 》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》此处是配置default的密码Password for default user is saved in file /etc/clickhouse-server/users.d/default-password.xml.Setting capabilities for clickhouse binary. This is optional.chown -R clickhouse:clickhouse '/etc/clickhouse-server'ClickHouse has been successfully installed.Start clickhouse-server with:sudo clickhouse startStart clickhouse-client with:clickhouse-client --passwordSynchronizing state of clickhouse-server.service with SysV service script with /lib/systemd/systemd-sysv-install.Executing: /lib/systemd/systemd-sysv-install enable clickhouse-serverCreated symlink /etc/systemd/system/multi-user.target.wants/clickhouse-server.service → /lib/systemd/system/clickhouse-server.service.Setting up clickhouse-client (22.8.5.29) ...Processing triggers for systemd (245.4-4ubuntu3.13) ...服务无法启动,通过debug方式启动clickhouse服务查看debug日志

sudo -u clickhouse clickhouse-server --config-file=/etc/clickhouse-server/config.xml参考信息ClickHouse分布式集群部署[2]ClickHouse实例部署[3]ClickHouse配置文件[4]大数据ClickHouse进阶(五):副本与分片[5]资料参考

[1]

clickhouse-v22.8.5.29-lts: https://github.com/ClickHouse/ClickHouse/releases/tag/v22.8.5.29-lts

[2]

ClickHouse分布式集群部署: https://clickhouse.com/docs/zh/getting-started/tutorial#cluster-deployment

[3]

单机部署: https://clickhouse.com/docs/zh/getting-started/install/

[4]

ClickHouse配置文件: https://clickhouse.com/docs/zh/operations/configuration-files/

[5]

大数据ClickHouse进阶: https://bbs.huaweicloud.com/blogs/375043#:~:text=例如一个Clic,个分片设置副本。

花粉社群VIP加油站

2
点赞
赏礼
赏钱
0
收藏
免责声明:本文仅代表作者个人观点,与花粉乐分享无关。其原创性以及文中陈述文字和内容未经本网证实,对本文以及其中全部或者 部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
凡本网注明 “来源:XXX(非花粉乐分享)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对 其真实性负责。
如因作品内容、版权和其它问题需要同本网联系的,请在一周内进行,以便我们及时处理。
QQ:2443165046 邮箱:info@hflfx.com
关于作者
华为乐分享..(万蜂敬仰)
文章
461
主题
0
关注
0
粉丝
0
点击领取今天的签到奖励!
签到排行
随手拍
54个圈友 0个话题
华为手机随手拍,记录生活点滴之美好
华为P30pro
51个圈友 0个话题
这里是华为P30pro手机交流圈,欢迎华为P30pro用户进群交流
体验官
60个圈友 2个话题
华为花粉体验官,体验官专属的交流群
登录后查看您创建的圈子
登录后查看您创建的圈子
所有圈子
杭州互联网违法和不良信息举报平台 网络110报警服务 浙ICP备17046585号
2
0
分享
请选择要切换的马甲:

个人中心

每日签到

我的消息

内容搜索