Linux advanced skills: keepalived server cluster

Keepalived is a high availability solution designed for web services, utilizing the VRRP protocol to prevent single points of failure. It operates across multiple nodes, where one node acts as the master and others function as backups. These backup nodes provide real services and host a virtual IP address. In case the primary server fails, the backup takes over the virtual IP, ensuring uninterrupted service and maintaining high availability. The architecture of Keepalived includes a client accessing the virtual IP, followed by a master control node and a backup control node. On the far right are the real servers that deliver the actual services. This setup ensures that traffic is always directed to an active server. To implement a Keepalived service, we used four nodes: two as control nodes and two as real servers. The real machines were configured to serve web content, and clients accessed the virtual IP through their browsers. Before starting, it was crucial to ensure all nodes were properly configured: - All nodes must have correct DNS resolution. - Time synchronization across all nodes is essential. - Yum repositories need to be set up, including those for high availability features. We downloaded the Keepalived source package, `Keepalived-1.2.13.tar.gz`, and installed it on both control nodes after installing necessary dependencies. The compilation process involved extracting the source code, configuring, and then installing the software. After installation, we created symbolic links to the configuration files and started the service. The configuration files were adjusted to define the master and backup roles, with the same virtual ID across both nodes. The delay loop was set to 6 seconds for health checks. The virtual IP, which clients access, was configured in the main control node. The backup node was set to "BACKUP" mode with a lower priority (50) to ensure the master takes precedence. We also configured the load balancing settings using Direct Routing (DR), Round Robin (RR) algorithm, and TCP protocol. Two real server IPs, 192.168.2.108 and 192.168.2.109, were added to the configuration, representing the web services provided. On the real servers, we installed `arptables_jf` to manage ARP tables, and on the control nodes, `ipvsadm` was used to monitor the status of the services. If any issues arose during installation, we checked and configured the YUM sources accordingly. HTTPD was installed on the real servers, and default content was set up to verify the functionality. When accessing the virtual IP, the browser displayed the default content from the real servers, rotating between them based on the round-robin policy. In conclusion, setting up a highly available cluster using Keepalived is more straightforward than alternatives like Heartbeat and is widely adopted in production environments due to its reliability and ease of use.

Laptop Standing Desk

Laptop Standing Desk Adjustable,Laptop Standing Desk Adjustable Height,Laptop Standing Desk Cart,Laptop Standing Desk Foldable,etc.

Shenzhen Chengrong Technology Co.ltd is a high-quality enterprise specializing in metal stamping and CNC production for 12 years. The company mainly aims at the R&D, production and sales of Notebook Laptop Stands and Mobile Phone Stands. From the mold design and processing to machining and product surface oxidation, spraying treatment etc ,integration can fully meet the various processing needs of customers. Have a complete and scientific quality management system, strength and product quality are recognized and trusted by the industry, to meet changing economic and social needs .

Aluminum Laptop Stand

Laptop Standing Desk Adjustable,Laptop Standing Desk Adjustable Height,Laptop Standing Desk Cart,Laptop Standing Desk Foldable

Shenzhen ChengRong Technology Co.,Ltd. , https://www.laptopstandsupplier.com