搭建zookeeper+clickhouse

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

三台环境

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=

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值