ITPub博客

首页 > 数据库 > SQL on Hadoop > arm麒麟环境安装zookeeper

arm麒麟环境安装zookeeper

原创 SQL on Hadoop 作者:joshliu 时间:2021-03-03 15:55:24 0 删除 编辑

1、下载安装包,上传导服务器

2、创建安装目录,并解压

[root@node2 ~]# mkdir /usr/local/zookeeper
[root@node2 ~]# tar -zxf zookeeper-3.5.5-arm64.tar.gz -C /usr/local/zookeeper/

3、修改配置参数

[root@node2 ~]# cd /usr/local/zookeeper/apache-zookeeper-3.5.5-bin/conf/
[root@node2 conf]# cp zoo_sample.cfg zoo.cfg
#修改data文件目录
dataDir=/usr/local/zookeeper/apache-zookeeper-3.5.5-bin/data
#zookeeper集群的节点,添加到末尾
server.1=node2:2888:3888
server.2=node3:2888:3888
server.3=node4:2888:3888
[root@node2 conf]# mkdir -p /usr/local/zookeeper/apache-zookeeper-3.5.5-bin/data
[root@node2 conf]# echo 1 > /usr/local/zookeeper/apache-zookeeper-3.5.5-bin/data/myid   ## 设置zookeeper权值(node1为1,node2为2,node3为3)

4、拷贝到各个节点

[root@node2 conf]# cd
[root@node2 ~]# scp -r /usr/local/zookeeper node3:$PWD
[root@node2 ~]# scp -r /usr/local/zookeeper node4:$PWD

5、各节点添加环境变量、 修改权值

[root@node2 ~]# cat /etc/profile ## node2-node4均添加如下环境变量
#zookeeper
export ZOOKEEPER_HOME=/usr/local/zookeeper/apache-zookeeper-3.5.5-bin
export PATH=$ZOOKEEPER_HOME/bin:$PATH
[root@node3 ~]# cat /usr/local/zookeeper/apache-zookeeper-3.5.5-bin/data/myid
2
[root@node4 ~]# cat /usr/local/zookeeper/apache-zookeeper-3.5.5-bin/data/myid
3

6、启动zookeeper

[root@node2 ~]# zkServer.sh start
[root@node3 ~]# zkServer.sh start
[root@node4 ~]# zkServer.sh start

7、查看服务进程及状态

[root@node2 conf]# jps  ## 各节点查看进程都有一个QuorumPeerMain
214710 QuorumPeerMain
249549 Jps
[root@node4 ~]# zkServer.sh status  ## leader
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/apache-zookeeper-3.5.5-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Mode: leader
[root@node2 ~]# zkServer.sh status ## follower
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/apache-zookeeper-3.5.5-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Mode: follower

8、客户端访问

[root@node2 conf]# zkCli.sh 
Connecting to localhost:2181
[zk: localhost:2181(CONNECTED) 1] ls /zookeeper
[config, quota]
[zk: localhost:2181(CONNECTED) 2]



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69985104/viewspace-2760912/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-10-09

  • 博文量
    74
  • 访问量
    31011