三台环境
10.99.33.251 clickhouse01
10.99.33.252 clickhouse02
10.99.33.253 clickhouse03
以下步骤在三台机器上都需要操作
vim /etc/hosts
10.99.33.251 clickhouse01.hmtech.com
10.99.33.252 clickhouse02.hmtech.com
10.99.33.253 clickhouse03.hmtech.com
下载&解压&转移zookeeper包
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
tar xf apache-zookeeper-3.7.1-bin.tar.gz
mkdir /apps
mv apache-zookeeper-3.7.1-bin /apps/
cd cd /apps/apache-zookeeper-3.7.1-bin/conf/
cp zoo_sample.cfg zoo.cfg
编辑zoo.cfg文件
vim /apps/apache-zookeeper-3.7.1-bin/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/apps/apache-zookeeper-3.7.1-bin/data/zookeeper
dataLogDir=/apps/apache-zookeeper-3.7.1-bin/log/zookeeper
clientPort=2182
autopurge.snapRetainCount=0
server.251=10.99.33.251:2888:3888
server.252=10.99.33.252:2888:3888
server.253=10.99.33.253:2888:3888
创建数据目录
mkdir {data,log}
mkdir data/zookeeper
在每台服务器上分配创建myid文件
[root@clickhouse01 ~]# cat /apps/apache-zookeeper-3.7.1-bin/data/zookeeper/myid
251
[root@clickhouse02 ~]# cat /apps/apache-zookeeper-3.7.1-bin/data/zookeeper/myid
252
[root@clickhouse03 ~]# cat /apps/apache-zookeeper-3.7.1-bin/data/zookeeper/myid
253
先删除本机现有的Java&安装java
yum -y remove java && yum install fontconfig java-11-openjdk
配置环境变量
cd /usr/lib/jvm/java-11-openjdk-11.0.16.0.8-1.el7_9.x86_64/
vim /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.16.0.8-1.el7_9.x86_64
export CLASSPATH=.:JAVAHOME/lib/dt.jar:JAVA_HOME/lib/dt.jar:JAVAHOME/lib/dt.jar:JAVA_HOME/lib/tools.jar
export PATH=
三台ClickHouse集群部署及Zookeeper配置详解

本文详细指导了如何在三台服务器上安装Zookeeper、配置环境、启动服务,并通过Metrika.xml构建ClickHouse集群,包括设置主机映射、配置文件和自定义节点。
最低0.47元/天 解锁文章
1111

被折叠的 条评论
为什么被折叠?



