Zookeeper的安装
1.下载地址
官网:https://www.apache.org/dyn/closer.cgi/zookeeper/
github:https://github.com/apache/zookeeper
2.zookeeper安装的三种模式
单机模式
2.1.1上传zookeeper到linux中
2.1.2对zookeeper进行解压
tar -zxvf zookeeper-3.4.6
2.1.3进入zookeeper的conf目录下,拷贝zoo_sample.cfg一份为zoo.cfg
cp zoo_sample.cfg zoo.cfg
2.1.4在zookeeper目录下创建data和log文件夹
[root@root zookeeper-3.4.6]# mkdir data [root@root zookeeper-3.4.6]# mkdir log
2.1.5修改conf/zoo.cfg文件
[root@root zookeeper-3.4.6]# vi conf/zoo.cfg
2.1.6配置zookeeper路径
[root@root zookeeper-3.4.6]# vi /etc/profile
配置内容
export ZOOKEEPER_HOME=/usr/local/application/hadoop/zookeeper-3.4.6 export PATH=/$PATH:/usr/local/application/hadoop/zookeeper-3.4.6/bin
2.1.7进入zookeeper的bin目录,启动zookeeper
[root@root bin]# ./zkServer.sh start
查看zookeeper的状态
[root@root bin]# ./zkServer.sh status
注意:zookeeper使用2181端口号,需要释放zookeeper的2181端口或者关闭防火墙
释放2181端口
[root@root sysconfig]# iptables -I INPUT -p tcp --dport 2181 -m state --state NEW -j ACCEPT
关闭防火墙
[root@root bin]# service iptables stop
重启防火墙
[root@root bin]# systemctl restart firewalld
伪集群模式
待续…
集群模式
待续…