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 (primary), while others serve as backups. The backup nodes provide real services and are assigned a virtual IP address. In the event that the primary server fails, the backup node automatically takes over the virtual IP, ensuring uninterrupted service and maintaining system reliability. The architecture involves a client accessing the virtual IP, followed by the master and backup control nodes, with the final stage being the real machines that deliver the actual services. This setup ensures redundancy and fault tolerance. To implement Keepalived, we used four nodes—two as control nodes and two as real servers. Before starting, several prerequisites were met: all nodes were properly configured with DNS resolution, time synchronization was enabled, and the YUM repository was set up correctly, including the necessary high-availability packages. We downloaded the Keepalived source package, `keepalived-1.2.13.tar.gz`, and installed it on both control nodes. Prior to compilation, essential dependencies such as OpenSSL and libnl were installed. After successfully compiling and installing Keepalived, we created symbolic links to ensure the configuration files and service scripts were placed in the correct locations. The main configuration file was then edited. On the master node, the `state` was set to `MASTER`, and the `virtual_router_id` was set to a consistent value across both nodes. A 6-second delay loop was defined to check the health of the services. Virtual IP addresses were also configured to be accessed by clients. On the backup node, the `state` was changed to `BACKUP`, and the `priority` was reduced to 50, ensuring the master node would take precedence. Additionally, the `arptables_jf` software was installed on the real servers to manage ARP tables, and the `ipvsadm` tool was used on the control nodes to monitor the load balancer status. HTTPD was installed on the real machines, and default content was configured to verify the round-robin distribution of traffic between the two backend servers. Finally, after starting the Keepalived service, the virtual IP was recognized, and the cluster was tested using a browser on the real machine. The results showed the expected round-robin behavior between the two backend IPs. In conclusion, setting up a highly available cluster with Keepalived is straightforward and widely used in production environments. Compared to other solutions like Heartbeat, Keepalived offers a simpler and more efficient approach to achieving high availability.

Laptop Stand Holder

Laptop Stand Holder Adjustable,Laptop Stand Holder Desk,Laptop Stand Holder Ergonomic,Laptop Stand Holder Ergonomic Adjustable,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 .

Laptop Standing Desk

Laptop Stand Holder Adjustable,Laptop Stand Holder Desk,Laptop Stand Holder Ergonomic,Laptop Stand Holder Ergonomic Adjustable

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