In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to use the zookeeper gadget zkui. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it with the editor.
Review the role of zookeeper in big data, and then introduce a monitoring and management tool of zk.
The role of zookeeper in distributed Cluster
1, data publishing and subscription (configuration center)
Publish and subscribe model, the so-called configuration center, as the name implies, means that publishers publish data to zk nodes, and subscribers obtain data dynamically to achieve centralized configuration management and dynamic updates. For example, the global configuration information and the address list of the service framework are very suitable for use.
2. Load balancing
Software load balancing. The most typical is the production and consumer load balance of message middleware.
3, naming Service (Naming Service)
It is common for publishers to write their own address lists to zookeeper nodes, and then subscribers can obtain address lists from fixed-name nodes and link to publishers for related communications.
4, distributed notification / coordination
This makes use of zookeeper's watcher registration and asynchronous notification mechanism, which can well realize the notification and coordination among different systems in the distributed environment, and realize the real-time processing of data changes.
5. Cluster management and Master election
Cluster management, such as online rate, node online and offline notification. Master elections can be implemented using temporary sequential nodes.
6, distributed lock
Distributed locks, which mainly benefit from the strong consistency of zookeeper data, take advantage of temporary nodes. Lock services are divided into two categories, one is exclusive lock, the other is control timing.
Monopoly means that all clients come to acquire the lock, and only one can get it in the end. Temporary nodes are used.
Control the timing, and all clients that come to acquire the lock are arranged to get the lock, but in an order. It is actually implemented by a temporary sequential child node under a node.
Zkui detailed explanation
Brief introduction
Zkui is a web management interface of zookeeper, which can CRUD zookeeper.
Github address:
Https://github.com/DeemOpen/zkui
Environmental requirements
The official requirement for the compilation environment is jdk7, but jdk8 works well here at the top of the wave.
The version of maven used by Longtip is mvn-3.3.3.
Installation and deployment
1. Compilation and packaging
Mvn clean install
After the execution finishes, a jar package is generated in the target directory
two。 Configuration
Execute vim config.cfg
Add the following configuration
# zkui web page access port
ServerPort=9090
# IP address and port of zookeeper cluster
ZkServer=localhost:2181
# set the user name and password for logging in to zkui. Here is the default value.
UserSet = {"users": [{"username": "admin", "password": "manager", "role": "ADMIN"}, {"username": "appconfig", "password": "appconfig", "role": "USER"}]}
3. Start
Starting zkui is also relatively simple and can be executed directly.
$java-jar zkui-2.0-SNAPSHOT-jar-with-dependencies.jar
You can also use nohup & it becomes a background process
Nohup java-jar target/zkui-2.0-SNAPSHOT-jar-with-dependencies.jar &
4. Log in to ui
Visit http://localhost:9090 to see the following interface: enter the username and password you just set: admin/manager to log in.
5. CRUD operation
The above is how to use the zookeeper gadget zkui. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.