In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "analyzing Patroni in Docker container". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Etcd acts as a distributed registry center to select the master of the cluster; vip-manager sets the drift IP;patroni as the primary node to guide the creation, operation and management of the cluster, and can use patronictl for terminal access.
Specific process:
1. Start the etcd cluster first. In this case, the number of etcd is 3.
2. After checking the health of the etcd cluster, start patroni and compete for the master, and other follow nodes to carry out the data synchronization process.
3. Start vip-manager, and determine whether the current node is the primary node ip by accessing the specific value in the / SERVICENAME/ {SERVICE_NAME} / SERVICENAME/ {CLUSTER_NAME} / leader key in the etcd cluster. If so, set vip for the node to provide external read and write services.
Note: it is recommended that etcd be deployed to a separate container in a real environment to provide services.
Create an image file structure
Dockerfile is the master file of the image, through which the docker service creates the image in the local repository; entrypoint.sh is the container entry file, which is responsible for business logic processing; function, the entry file for executing business methods, is responsible for starting etcd, monitoring etcd cluster status, starting patroni and vip-manager;generatefile to generate corresponding configuration files for the entire container, including etcd, patroni and vip-mananger.
The directory structure is roughly shown in the figure:
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: 201
*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.