您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
1.关闭防火墙
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]
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。