In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you what the keepalived in the linux cluster is like, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Keepalived is a highly available solution for WEB services based on VRRP protocol, which can be used to avoid a single point of failure. Install keepalived using multiple nodes. Other nodes are used to provide real services, and similarly, they represent a virtual IP. When the primary server goes down, the backup server takes over the virtual IP and continues to provide services, thus ensuring high availability.
The schematic diagram of keepalived is as follows:
On the far left is the client, which accesses our virtual IP. Then we have master (primary control node) and backup (standby control node). The one on the far right is the real machine where we provide services.
two。 Set up keepalived service
We use four nodes to do this experiment, two act as control nodes and the other two provide services. Then use a real browser to access the virtual IP.
Note:
1. All nodes should be parsed.
two。 Time synchronization
3.yum feeds are set up (in addition to basic feeds, high availability, etc.)
As shown in the picture, our Operations console:
The installation package for keepalived is:
Keepalived-1.2.13.tar.gz
The two control nodes decompress, compile and install keepalived respectively:
Before compiling keepalived, we need to install some related packages:
Compile the keepalived source package:
This is our compilation result:
Then we install:
The above steps need to be carried out on both control nodes. * We will set the primary and secondary nodes in the configuration file.
Establish a soft link to link the keepalived configuration file and service startup file to the specified location:
Set up the profile:
We set the sending address and ip,MASTER of the mail as the main control node, and the two nodes of the virtual id must be the same. Delay_loop specifies 6 seconds to detect the service status.
Set up the virtual ip, which is the IP that our client accesses.
This is the rest of the configuration file. We set the connection mode to direct connection mode DR, load policy to rotation mode rr, and protocol Wei TCP. Then we set up two IP and ports that provide the service node. Ports 80 of 192.168.2.108 and 192.168.2.109, respectively. That is, the web access service.
Then we set the configuration file of the slave, set the mode to BACKUP, and modify the weight to 50. Only in this way can we give priority to the master control node to take over.
Then we open the keepalived service and look at the log and find that the 192.168.2.110 virtual IP has been identified:
Install the arptable_jf software on two service nodes that provide real machines:
Set the policy for arptables:
Then we will install ipvsadm software on two control nodes to monitor the status of the service:
If it cannot be installed, check the yum source and set it as follows:
Install httpd on the two real machines that provide services, and start the service after setting the default publishing content:
Then we view the current monitoring information on the primary control node:
View the information of 192.168.2.110 on the browser of the real machine. Because it is a round-robin policy, the default releases of 192.168.2.108 and 192.168.2.109 are rotated:
In this way, we have built a high-availability cluster under keepalived. This is less complex than heartbeat and is very common in production environments.
The above is what keepalived is like in a linux cluster. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to 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.