1.关闭防火墙
成都创新互联从2013年成立,是专业互联网技术服务公司,拥有项目网站设计制作、成都网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元贵阳做网站,已为上家服务,为贵阳各地企业和个人服务,联系电话:18982081108
systemctl stop firewalld.service systemctl disable firewalld.service
2.安装java
# 卸载已有的jdk java -version rpm -qa |grep jdk yum -y remove java # 安装同一版本的jdk rz (jdk-8u144-linux-x64.rpm) rpm -ivh jdk-8u144-linux-x64.rpm java -version
3.安装zookeeper
下载地址 : http://zookeeper.apache.org/releases.html
tar zxvf zookeeper-3.4.10.tar.gz mv zookeeper-3.4.10 /usr/local/zookeeper cd /usr/local/zookeeper mkdir data cd /usr/local/zookeeper/conf cp -a zoo_sample.cfg zoo.cfg vim zoo.cfg ---------------- tickTime=2000 initLimit=10 syncLimit=5 dataDir=/usr/local/zookeeper/data clientPort=2181 ---------------- /usr/local/zookeeper/bin/zkServer.sh stop # 停止ZooKeeper服务器 /usr/local/zookeeper/bin/zkServer.sh start # 启动ZooKeeper服务器 ---------------- ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... STARTED ----------------
4.zookeeper客户端的使用(zkCli.sh)
/usr/local/zookeeper/bin/zkCli.sh # 直接进入localhost [zk: localhost:2181(CONNECTED) 0] /usr/local/zookeeper/bin/zkCli.sh -server 127.0.0.1:2181 # -server设定进入那个zookeeper [zk: 127.0.0.1:2181(CONNECTED) 0] # zookeeper里面都是绝对路径,没有相对路径 [zk: 127.0.0.1:2181(CONNECTED) 0] ls / # ls / 查看下初始化后的根目录 [zookeeper]