Zookeeper 4 Letter Description and Practice

Source: Internet
Author: User

Command Example DescriptionConfecho conf | NC localhost 2181 (New in 3.3.0) outputs the details of the related service configuration. such as port, ZK data and log configuration path, maximum number of connections, session timeout time, ServerID, etc. consecho cons | NC localhost 2181 (New in 3.3.0) lists the details of all client connections/sessions connected to this server. Includes the number of packets received/sent, session ID, operation delay, last action execution, and so on. Crstecho Crst | NC localhost 2181 (New in 3.3.0) resets statistics for all connections/sessions in the current server Dumpecho dump | NC localhost 2181 lists the unprocessed sessions and temporary nodes (only valid on leader). Enviecho Envi | NC localhost 2181 outputs environment details about the server (unlike the Conf command), such as Host.name, Java.version, Java.home, user.dir=/data/zookeeper-3.4.6/ Information such as bin Ruokecho Ruok | The NC localhost 2181 Test service is in the correct running state. Returns null if "Imok" is returned normally. Srstecho Srst | NC localhost 2181 resetting the server statistics Srvrecho SRVR | Details of the NC localhost 2181 (New in 3.3.0) output server. ZK version, number of receive/send packets, number of connections, mode (leader/follower), total number of nodes. Statecho Stat | Details of the NC localhost 2181 output server: Number of received/sent packets, number of connections, mode (leader/follower), total number of nodes, latency. A list of all clients. Wchsecho Wchs | NC localhost 2181 (New in 3.3.0) lists concise information about server watches: Total connections, total number of watching nodes, total watches Wchcecho WCHC | NC localhost 2181 (New in 3.3.0) lists all the nodes of watch by the session, and its output is a list of nodes for a watch-related session. If the number of watches is large, it will produce a largeOverhead, which affects performance and is used with care. Wchpecho WCHP | NC localhost 2181 (New in 3.3.0) lists all watch session ID information by way of a path grouping. It outputs a path associated with the session. If the number of watches is large, it will incur a lot of overhead, which will affect performance and be used with care. Mntrecho Mntr | NC localhost 2181 (New in 3.4.0) lists the health status of the cluster. Includes the number of packets received/sent, the operation Delay, the current service mode (Leader/follower), the total number of nodes, the total number of watch, and the total number of temporary nodes.  Conf:clientport: Client port number datadir: Data file directory datalogdir: Log file directory ticktime: Interval unit time MAXCLIENTCNXNS: Maximum number of connections  Minsessiontimeout: Minimum session timeout Maxsessiontimeout: Max session timeout Serverid:id Initlimit: Initialize time synclimit: Heartbeat interval ELECTIONALG: Election algorithm default 3 electionport: Election port Quorumport: Legal entity Port Peertype: Unconfirmed cons:ip=ipport= port queued= the queue received= the number of packets sent= Number of sid=session idlop= last action est= connection timestamp to= timeout lcxid= last ID (unconfirmed specific ID) lzxid= last ID (status change ID) lresp= Last response timestamp llat= last/Latest delay minlat= Minimum delay maxlat= max delay avglat= average delay Crst: Reset all connections dump:session id:znode path (1-to-many, queued session and temporary nodes in queue) envi:zookeeper.version= Version Host.name=host info java.version=java version java.vendor= vendor JAVA.HOME=JDK Catalog java.class.path=classpathjava.library.path= Lib Pathjava.io.tmpdir=temp directory Java.compiler=<na>os.name=linuxos.arch=amd64os.version=2.6.32-358.el6.x86_64user.name=hhzuser.home=/home/hhzuser.dir=/export/servers/ Zookeeper-3.4.6ruok: Check if server is normal imok= normal Srst: Reset Server Status Srvr:zookeeper version: Release Latency Min/avg/max: Delay Received: Package Sent: Contract connections: Number of connections outstanding: Number of stacks Zxid: Operation Idmode:leader/followernode Count: Number of nodes Stat:zookeeper version: 3.4.6-1569965, built on 02/20/2014 09:09 gmtclients:/192.168.147.102:56168[1] (queued=0,recved=41,sent=41)/ 192.168.144.102:34378[1] (queued=0,recved=54,sent=54)/192.168.162.16:43108[1] (queued=0,recved=40,sent=40)/ 192.168.144.107:39948[1] (queued=0,recved=1421,sent=1421)/192.168.162.16:43112[1] (queued=0,recved=54,sent=54)/ 192.168.162.16:43107[1] (queued=0,recved=54,sent=54)/192.168.162.16:43110[1] (queued=0,recved=53,sent=53)/ 192.168.144.98:34702[1] (queued=0,recved=41,sent=41)/192.168.144.98:34135[1] (queued=0,recved=61,sent=65)/ 192.168.162.16:43109[1] (queued=0,recved=54,sent=54)/192.168.147.102:56038[1] (queued=0,recved=165313,sent= 165314)/192.168.147.102:56039[1](queued=0,recved=165526,sent=165527)/192.168.147.101:44124[1] (queued=0,recved=162811,sent=162812)/ 192.168.147.102:39271[1] (queued=0,recved=41,sent=41)/192.168.144.107:45476[1] (queued=0,recved=166422,sent= 166423)/192.168.144.103:45100[1] (queued=0,recved=54,sent=54)/192.168.162.16:43133[0] (queued=0,recved=1,sent=0) /192.168.144.107:39945[1] (queued=0,recved=1825,sent=1825)/192.168.144.107:39919[1] (queued=0,recved=325,sent= 325)/192.168.144.106:47163[1] (queued=0,recved=17891,sent=17891)/192.168.144.107:45488[1] (queued=0,recved= 166554,sent=166555)/172.17.36.11:32728[1] (queued=0,recved=54,sent=54)/192.168.162.16:43115[1] (queued=0,recved= 54,sent=54) Latency Min/avg/max:0/0/599received:224869sent:224817connections:23outstanding:0zxid: 0x68000af707mode:followernode count:101081 (Information integrated with the above command) wchs:connectsions= number of connections Watch-paths=watch nodes watchers= Watcher number wchc:session ID corresponds to pathwchp:path corresponding session idmntr:zk_version= version zk_avg_latency= average delay zk_max_latency= max delay Zk_ min_latency= Minimum delay Zk_packets_received= Number of packets zk_packets_sent= number of zk_num_alive_connections= connections zk_outstanding_requests= number of heap requests zk_server_state=leader/ Follower status Zk_znode_count=znode number Zk_watch_count=watch number zk_ephemerals_count= temporary node (znode) zk_approximate_data_size= Data size zk_open_file_descriptor_count= Number of file descriptors opened zk_max_file_descriptor_count= maximum number of file descriptors zk_followers=follower number Zk_ synced_followers= number of follower synchronized zk_pending_syncs= ready to sync

 

Practice
[[email protected] ~]$ echo conf | NC Master 2181//Print Service configuration information clientport=2181datadir=/home/spark-hadoop/zookeeper-3.4.9/zk_data/version-2datalogdir=/ home/spark-hadoop/zookeeper-3.4.9/zk_data/version-2ticktime=2000maxclientcnxns=60minsessiontimeout= 4000maxsessiontimeout=40000serverid=1initlimit=10synclimit=5electionalg=3electionport=3888quorumport= 2888peertype=0[[email protected] ~]$ echo Cons | The NC Master 2181//displays all connection/session information connected to the service, including the number of packets received, session ID, etc./192.168.137.10:57725[0] (queued=0,recved=1,sent=0) [[email  Protected] ~]$ echo Crst | NC Master 2181//connection stats reset. [[email protected] ~]$ echo Dump | NC Master 2181//Show unhandled session, temporary nodes. Applies to leader only. Sessiontracker dump:[email protected]ephemeral nodes dump:sessions with ephemerals (0): [[email protected] ~ ]$ echo Envi | NC Master 2181//Print the service environment variable environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 Gmthos T.name=masterjava.version=1.7.0_79java.vendor=oracle Corporationjava.home=/usr/java/jrejava.class.path=/home/spark-hadoop/zookeeper-3.4.9/bin/. /build/classes:/home/spark-hadoop/zookeeper-3.4.9/bin/. /build/lib/*.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /lib/slf4j-log4j12-1.6.1.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /lib/slf4j-api-1.6.1.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /lib/netty-3.10.5.final.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /lib/log4j-1.2.16.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /lib/jline-0.9.94.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /zookeeper-3.4.9.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /src/java/lib/*.jar:/home/spark-hadoop/zookeeper-3.4.9/bin/. /conf:.::/usr/java/lib:/libjava.library.path=/usr/java/packages/lib/i386:/lib:/usr/libjava.io.tmpdir=/ Tmpjava.compiler=<na>os.name=linuxos.arch=i386os.version=2.6.32-358.el6.i686user.name= Spark-hadoopuser.home=/home/spark-hadoopuser.dir=/home/spark-hadoop[[email protected] ~]$ echo Ruok | NC Master 2181//test service is running correctly。 Imok[[email protected] ~]$ echo Srst | NC Master 2181Server stats reset. [[email protected] ~]$ echo srvr | NC Master 2181//Display all information about the service zookeeper version:3.4.9-1757313, built on 08/23/2016 06:50 gmtlatency Min/av G/max:0/0/0received:1sent:1connections:1outstanding:0zxid:0x400000002mode:followernode count:4[[email  Protected] ~]$ echo Stat | NC Master 2181//display services and connected clients simple information zookeeper version:3.4.9-1757313, built on 08/23/2016 06:50 gmtclient S:/192.168.137.10:57733[0] (queued=0,recved=1,sent=0) Latency min/avg/max:0/0/0received:2sent:2connections: 1outstanding:0zxid:0x400000002mode:followernode count:4[[email protected] ~]$ echo wchs | NC Master 2181//Display service Watchs simple information 0 connections watching 0 pathstotal watches:0[[email protected] ~ ]$ echo WCHC | NC Master 2181//display Watchs details of the service, based on session [[email protected] ~]$ echo WCHP | NC Master 2181//display Watchs details of the service,Based on path [[email protected] ~]$ echo mntr | NC Master 2181//output a series of variables used to monitor the health of the cluster zk_version3.4.9-1757313, built on 08/23/2016 06:50 Gmtzk_avg_latenc Y0zk_max_latency0zk_min_latency0zk_packets_received6zk_packets_sent6zk_num_alive_connections1zk_outstanding_ Requests0zk_server_statefollowerzk_znode_count4zk_watch_count0zk_ephemerals_count0zk_approximate_data_size27zk _open_file_descriptor_count25zk_max_file_descriptor_count4096

  

 

Zookeeper 4 Letter Description and Practice

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.