Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ubuntu16.04 installs zookeeper cluster

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Http://apache.fayea.com/zookeeper/

Root@node1:/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

Root@node1:/usr/local/zookeeper-3.4.9# mkidr data

Root@node1:/usr/local/zookeeper-3.4.9# mkidr logs

Root@node1:/usr/local/zookeeper-3.4.9# vim data/myid

one

Root@node1:/usr/local/zookeeper-3.4.9# cp conf/zoo_sample.cfg conf/zoo.cfg

Root@node1:/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

Then copy the configuration file to the other 2 nodes

Root@node1:/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

Root@node1:/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

Imokroot@node1:/usr/local/zookeeper-3.4.9# netstat-antlp | grep 2181

Tcp 0 0127.0.0.1Rose 38052 127.0.1Rose 2181 TIME_WAIT-

Tcp6 0 0: 2181: * LISTEN 31064/java

Root@node2:/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

Root@node2:/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

Root@node3:/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

Root@node3:/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

Connect to Zookeeper cluster

Root@node1:/usr/local/zookeeper-3.4.9# zkCli.sh-server node1

Connecting to node1

2017-07-31 16 main:Environment@100 54 Client environment:zookeeper.version=3.4.9 31066 [myid:]-INFO [main:Environment@100]-Client environment:zookeeper.version=3.4.9-1757313, built on 08Compact 23,2016 06:50 GMT

2017-07-31 16 main:Environment@100 54 main:Environment@100 31068 [myid:]-INFO [main:Environment@100]-Client environment:host.name=node1

2017-07-31 16 main:Environment@100 54 main:Environment@100 31068 [myid:]-INFO [main:Environment@100]-Client environment:java.version=1.8.0_131

2017-07-31 16 main:Environment@100 54 Client environment:java.vendor=Oracle Corporation 31069 [myid:]-INFO [main:Environment@100]-Client environment:java.vendor=Oracle Corporation

2017-07-31 16 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre

2017-07-31 16 main:Environment@100 54 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 31070 [myid:]-INFO [main:Environment@100]-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 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-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 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:java.io.tmpdir=/tmp

2017-07-31 16 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:java.compiler=

2017-07-31 16 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:os.name=Linux

2017-07-31 16 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:os.arch=amd64

2017-07-31 16 main:Environment@100 54 Client environment:os.version=4.8.0 31070 [myid:]-INFO [main:Environment@100]-Client environment:os.version=4.8.0-36-generic

2017-07-31 16 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:user.name=root

2017-07-31 16 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:user.home=/root

2017-07-31 16 main:Environment@100 54V 31070 [myid:]-INFO [main:Environment@100]-Client environment:user.dir=/usr/local/zookeeper-3.4.9

2017-07-31 16 main:ZooKeeper@438 54 Initiating client connection 31071 [myid:]-INFO [main:ZooKeeper@438]-Initiating client connection, connectString=node1 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@22d8cfe0

Welcome to ZooKeeper!

2017-07-31 16 node1:2181 54 main-SendThread 31084 [myid:]-INFO [main-SendThread (node1:2181): ClientCnxn$SendThread@1032]-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 node1:2181 54 main-SendThread 31123 [myid:]-INFO [main-SendThread (node1:2181): ClientCnxn$SendThread@876]-Socket connection established to node1/192.168.117.34:2181, initiating session

[zk: node1 (CONNECTING) 0] 2017-07-31 16 myid:]-INFO [main-SendThread (node1:2181): ClientCnxn$SendThread@1299]-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]

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 217

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report