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

ZooKeeper Install

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Tar-zxvf zookeeper-3.4.10.tar.gz

[root@hmaster local] # rm-rf zookeeper-3.4.10.tar.gz

Remote transfer of zookeeper-3.4.10 to other nodes

[root@hmaster local] # scp-r / usr/local/zookeeper-3.4.10 root@hslave1:/usr/local/

[root@hmaster local] # ls

Bin etc games hadoop hive include java lib lib64 libexec python3Dir sbin share src zookeeper-3.4.10

[root@hmaster conf] # ls

Configuration.xsl log4j.properties zoo_sample.cfg

[root@hmaster conf] # cp zoo_sample.cfg zoo.cfg

[root@hmaster conf] # ls

Configuration.xsl log4j.properties zoo.cfg zoo_sample.cfg

Edit configuration file

[root@hmaster conf] # vim zoo.cfg

# the first port number 2888 is the port for communication between Leader and follower; 3888 is the port number used for the election

# autopurge.purgeInterval=1

Server.0=172.26.19.40:2888:3888

Server.1=172.26.19.41:2888:3888

Server.2=172.26.19.42:2888:3888

Create the corresponding directory according to the dataDir=/tmp/zookeeper in the zoo.cfg file, and configure the myid file to make the cluster map

[root@hslave1 conf] # cd / tmp

[root@hslave1 tmp] # ls

Hsperfdata_root systemd-private-d38862e2d5524a42994bdd9ddd858f50-chronyd.service-nIGJPI

[root@hslave1 tmp] # mkdir zookeeper

[root@hslave1 tmp] # vim myid

[root@hslave1 tmp] # more myid

one

[root@hslave1 tmp] #

The information entered by each machine for IP should be 0 for server.0=172.26.19.40:2888:3888;

[root@hmaster bin] #. / zkServer.sh status

[root@hmaster bin] #. / zkServer.sh start

[root@hmaster bin] #. / zkServer.sh stop

[root@hmaster bin] # jps

21690 Jps

21550 QuorumPeerMain

[root@hmaster bin] # kill-9 18976

View zookeeper log files

[root@hmaster bin] # more zookeeper.out

The client has the same version of the zookeeper-3.4.10 package file (copied from the remote zookeeper node)

Client login

[root@hslave3 bin] #. / zkCli.sh-server hmaster:2181

[zk: hmaster:2181 (CONNECTED) 0] help

ZooKeeper-server host:port cmd args

Stat path [watch]

Set path data [version]

Ls path [watch]

Delquota [- n |-b] path

Ls2 path [watch]

SetAcl path acl

Setquota-n |-b val path

History

Redo cmdno

Printwatches on | off

Delete path [version]

Sync path

Listquota path

Rmr path

Get path [watch]

Create [- s] [- e] path data acl

Addauth scheme auth

Quit

GetAcl path

Close

Connect host:port

[zk: hmaster:2181 (CONNECTED) 1] ls /

Consistent, heady, data tree

[zk: hslave1:2181 (CONNECTED) 0] ls /

[zookeeper]

[zk: hslave1:2181 (CONNECTED) 1] create / app app_content

Created / app

[zk: hslave1:2181 (CONNECTED) 2] ls /

[app, zookeeper]

[zk: hslave1:2181 (CONNECTED) 3] get / app

App_content

CZxid = 0x200000002

Ctime = Mon Dec 10 21:43:19 EST 2018

MZxid = 0x200000002

Mtime = Mon Dec 10 21:43:19 EST 2018

PZxid = 0x200000002

Cversion = 0

DataVersion = 0

AclVersion = 0

EphemeralOwner = 0x0

DataLength = 11

NumChildren = 0

[zk: hslave1:2181 (CONNECTED) 4] set / app appcontent11

CZxid = 0x200000002

Ctime = Mon Dec 10 21:43:19 EST 2018

MZxid = 0x200000003

Mtime = Mon Dec 10 21:45:05 EST 2018

PZxid = 0x200000002

Cversion = 0

DataVersion = 1

AclVersion = 0

EphemeralOwner = 0x0

DataLength = 12

NumChildren = 0

[zk: hslave1:2181 (CONNECTED) 5] get / app

Appcontent11

CZxid = 0x200000002

Ctime = Mon Dec 10 21:43:19 EST 2018

MZxid = 0x200000003

Mtime = Mon Dec 10 21:45:05 EST 2018

PZxid = 0x200000002

Cversion = 0

DataVersion = 1

AclVersion = 0

EphemeralOwner = 0x0

DataLength = 12

NumChildren = 0

[zk: hslave1:2181 (CONNECTED) 6] delete / app

[zk: hslave1:2181 (CONNECTED) 7] ls /

[zookeeper]

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: 0

*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