In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "ZooKeeper in Docker container does not respond to four-word command solution", in daily operation, I believe many people in Docker container ZooKeeper does not respond to four-word command solution problem there are doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation method, hope to answer everyone "ZooKeeper in Docker container does not respond to four-word command solution" doubts help! Next, please follow the small series to learn together!
ZK four-word command
The four-word command is actually something like echo stat.| nc 127.0.0.1, to interact with zk nodes, get or set data instructions
zk four-word command list:
command demonstration confecho conf| nc 127.0.0.1 2181 Output details of the relevant service configuration. For example, port, zk data and log configuration path, maximum number of connections, session timeout time, serverId, etc.| nc 127.0.0.1 2181 Lists all client connections/sessions connected to this server, including the number of packets received/sent, session id, operation delay, and final operation execution. crstecho crst| nc 127.0.0.1 2181 Reset statistics of all connections/sessions on this server dumpecho dump| nc 127.0.0.1 2181 List unprocessed sessions and temporary nodes (valid only on leader) enviecho envi| nc 127.0.0.1 2181 Output environment details about the server (different from conf command), such as host.name, java.version, java.home, user.dir=/data/zookeeper-3.4.6/bin, etc. ruokecho ruok| nc 127.0.0.1 2181 Tests whether the service is operating correctly. If normal returns "imok", otherwise returns empty srstecho srst| nc 127.0.0.1 2181 Reset server statistics srvrecho srvr| nc 127.0.0.1 2181(New in 3.3.0) Output server details. zk version, number of packets received/sent, number of connections, mode (leader/follower), total number of nodes statecho stat| nc 127.0.0.1 2181 Output server details: number of packets received/sent, number of connections, mode (leader/follower), total number of nodes, delay. List of all clients wchecho wchs| nc 127.0.0.1 2181 List server watches with concise information: total number of connections, total number of watching nodes, and total number of watches wchcecho wchc| nc 127.0.0.1 2181 Lists all nodes of watch by session grouping, and its output is a list of nodes associated with watch sessions. If the number of watches is large, it will cause a lot of overhead, which will affect performance. Be careful to use wchpecho wchp.| nc 127.0.0.1 Lists all the session id information of watch by path grouping. It outputs a path associated with the session. If the number of watches is large, it will incur a large overhead, which will affect performance. Be careful to use mntrecho mntr| nc 127.0.0.1 2181 lists the health status of the cluster. Number of packets received/sent, operational latency, current service mode (leader/follower), total number of nodes, total number of watches, total number of temporary nodes ZooKeeper in Docker container does not respond to four-word commands
With the launch of ZooKeeper's official Docker image, everyone has also followed the official introduction, using Docker to run ZooKeeper, starting to use it very well, until someone found a problem with the four-word command: "Lost command did not respond"
Baidu Google forums also did not find a solution until I carefully flipped through ZooKeeper's official documentation: zookeeper-doc
Only then did I discover that ZK containers started with Docker images are not configured with a four-word command whitelist by default. To put it bluntly, you can only use four-word commands inside this docker container, and on the host, they will be banned, so there will be no response. This problem
Then the solution is also very simple, we can use the volumes instruction, configure the zk image on the host, and then map it to the container to start zk.
Specific operation method:
Write the configuration file zoo.cfg and save it in./ Under config directory, the contents are as follows:
dataDir=/data dataLogDir=/datalog tickTime=2000 initLimit=5 syncLimit=2 autopurge.snapRetainCount=3 autopurge.purgeInterval=0 maxClientCnxns=60 standaloneEnabled=true admin.enableServer=true server.1=localhost:2888:3888;2181 4lw.commands.whitelist=*
Write docker-compose, configure volumes, and add the following:
volumes: - ./ config:/conf
Initiate testing, resolve
At this point, the study on "ZooKeeper in Docker container does not respond to four-word command solution" is over, I hope to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.