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

How to set up a witness server using repmgr

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

How to use repmgr to set up a witness server, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

In the last issue, when we talked about the witness server, what is the use of the function of the witness server? in fact, like all kinds of high availability (here we are talking about complete high availability), most of them are three, because of what to be afraid of, for fear of brain cleavage, because there are a lot of problems to be faced with high availability, especially network problems, if there is no problem with the server itself because of the network, but during a certain period of time when the network is disconnected. If you switch between master and slave, it will cause the embarrassment of two masters. Therefore, in the data center or in the more critical business, the high availability of the database server used is also appropriate. Wintness is not a mature backup node and is not integrated into replication, but it effectively represents a "vote" when deciding which network segment is in the majority. The witness server can be set up using the repmgr witness register. But only if you have to use repmgrd, and every node needs to run this program.

What I want to talk about today is witness server, repmgr witness, handling network splits with repmgrd.

First of all, we need to build a database that does not have any relationship with the previous two postgresql. And the installation of repmgr is the same as before, (if you don't know what to do, just look at the previous content, which will not be repeated here)

So, by now, you should have a postgresql cluster, two machines, and now you have another postgresql installed and repmgr installed, with the same configuration as before.

The repmgr witness register adds the witness server's node record to the repmgrg metadata and initializes the witness node if necessary by installing the repmgr extension and copying the repmgr metadata to the witness server. You need to execute this command to use repmgrd's witness server.

When executing the repmgr witness register, you must also provide database connection information for the cluster master server.

Execute the following command on witeness's machine

Repmgr-f / etc/repmgr.conf witness register-h 192.168.198.22-U repmgr-d repmgr-- verbose

After executing the command, the witeness host is added to the cluster. After executing this command, the following figure should be seen on all nodes, because the witness host has been added to the metadata of repmgr.

Let's start the test, and we'll shut down the primary node.

We are looking at the log of the witeness node

Finally, although the witness node is the database of postgresql, if it is only used as a witness, it does not need to be configured as high as mongodb's abiter server.

After reading the above, have you mastered how to set up the witness server using repmgr? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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