设为首页 收藏本站

运维网

查看: 169|回复: 0

[经验分享] Ubuntu16.04安装zookeeper集群

[复制链接]

累计签到:1 天
连续签到:1 天
发表于 2017-9-21 09:05:20 | 显示全部楼层 |阅读模式
http://apache.fayea.com/zookeeper/

[email protected]:/usr/local/zookeeper-3.4.9# vim /etc/profile
#Zookeeper Home
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.9
export PATH=$PATH:$ZOOKEEPER_HOME/bin
[email protected]:/usr/local/zookeeper-3.4.9# mkidr data
[email protected]:/usr/local/zookeeper-3.4.9# mkidr logs
[email protected]:/usr/local/zookeeper-3.4.9# vim data/myid
1
[email protected]:/usr/local/zookeeper-3.4.9# cp conf/zoo_sample.cfg conf/zoo.cfg
[email protected]:/usr/local/zookeeper-3.4.9# vim conf/zoo.cfg
dataDir=/usr/local/zookeeper-3.4.9/data
dataLogDir=/usr/local/zookeeper-3.4.9/logs
# the port at which the clients will connect
clientPort=2181
server.1=192.168.117.34:2888:3888
server.2=192.168.117.40:2888:3888
server.3=192.168.117.38:2888:3888
然后将配置文件复制到其它2个节点
[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg
Mode: follower
[email protected]:/usr/local/zookeeper-3.4.9# netstat -antlp | grep 2181
tcp        0      0 127.0.0.1:38052         127.0.0.1:2181          TIME_WAIT   -               
tcp6       0      0 :::2181                 :::*                    LISTEN      31064/java
[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg
Mode: leader
[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[email protected]:/usr/local/zookeeper-3.4.9# zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg
Mode: follower
连接Zookeeper集群
[email protected]:/usr/local/zookeeper-3.4.9# zkCli.sh -server node1
Connecting to node1
2017-07-31 16:54:31,066 [myid:] - INFO  [main:[email protected]] - Client environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT
2017-07-31 16:54:31,068 [myid:] - INFO  [main:[email protected]] - Client environment:host.name=node1
2017-07-31 16:54:31,068 [myid:] - INFO  [main:[email protected]] - Client environment:java.version=1.8.0_131
2017-07-31 16:54:31,069 [myid:] - INFO  [main:[email protected]] - Client environment:java.vendor=Oracle Corporation
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.class.path=/usr/local/zookeeper-3.4.9/bin/../build/classes:/usr/local/zookeeper-3.4.9/bin/../build/lib/*.jar:/usr/local/zookeeper-3.4.9/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper-3.4.9/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper-3.4.9/bin/../lib/netty-3.10.5.Final.jar:/usr/local/zookeeper-3.4.9/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper-3.4.9/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper-3.4.9/bin/../zookeeper-3.4.9.jar:/usr/local/zookeeper-3.4.9/bin/../src/java/lib/*.jar:/usr/local/zookeeper-3.4.9/bin/../conf:.:/usr/lib/jvm/java-8-openjdk-amd64/lib://usr/lib/jvm/java-8-openjdk-amd64/jre/lib
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.library.path=/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/lib64::/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.io.tmpdir=/tmp
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:java.compiler=<NA>
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:os.name=Linux
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:os.arch=amd64
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:os.version=4.8.0-36-generic
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:user.name=root
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:user.home=/root
2017-07-31 16:54:31,070 [myid:] - INFO  [main:[email protected]] - Client environment:user.dir=/usr/local/zookeeper-3.4.9
2017-07-31 16:54:31,071 [myid:] - INFO  [main:[email protected]] - Initiating client connection, connectString=node1 sessionTimeout=30000 [email protected]
Welcome to ZooKeeper!
2017-07-31 16:54:31,084 [myid:] - INFO  [main-SendThread(node1:2181):[email protected]] - Opening socket connection to server node1/192.168.117.34:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2017-07-31 16:54:31,123 [myid:] - INFO  [main-SendThread(node1:2181):[email protected]] - Socket connection established to node1/192.168.117.34:2181, initiating session
[zk: node1(CONNECTING) 0] 2017-07-31 16:54:31,196 [myid:] - INFO  [main-SendThread(node1:2181):[email protected]] - Session establishment complete on server node1/192.168.117.34:2181, sessionid = 0x15d97c546110000, negotiated timeout = 30000
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: node1(CONNECTED) 0]



运维网声明 1、欢迎大家加入本站运维交流群:群①:263444886群②:197202523群③:485755530群④:201730672群⑤:202807635运维网交流群⑥:281548029
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、其他单位或个人使用、转载或引用本文时必须注明原文的出处
4、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
5、运维网 - 服务您的运维操作管理专家!
6、联系人Email:[email protected] 网址:www.iyunv.com

点击关注更多内容
您需要登录后才可以回帖 登录 | 立即注册  

本版积分规则  允许回帖邮件提醒楼主

关注运维网官方微信X

关注运维网官方微信

扫描二维码关注运维网官方微信,最新一手资源尽在官方微信!快快关注我们吧...

扫描微信二维码查看详情

客服 E-mail:[email protected]

本站由安畅网络和青云提供云计算服务

运维网--中国最专业的运维工程师交流社区

京ICP备14039699号-1 Copyright © 2012-2017

使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

Good good study day day up !


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


合作伙伴: 青云cloud 安畅网络

快速回复 返回顶部 返回列表