هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.
CloudPond
CloudPond
- Service Overview
- Getting Started
-
User Guide
- CloudPond Console Overview
- Edge Site
- Network Connectivity
- Cloud Resources
- Monitoring Data
- Enterprise Project Management
- Quota Adjustment
- Auditing
-
FAQs
- Popular Questions
- CloudPond Overview
- Security
- Billing
- Region and Edge site
-
Rack Installation
- How Do I Know Whether My On-premises Data Center Meets the CloudPond Location Requirements?
- Can I Install Third-Party Devices in the Racks?
- Who Will Install the Hardware and Software After the Racks Are Delivered to the Location?
- What Do I Need to Do Before, During, and After an Edge Site Is Deployed?
- Network Connectivity
- O&M
- Upgrade and Capacity Expansion
- Best Practices
- General Reference
On this page
Show all
Help Center/
CloudPond/
Best Practices/
Best Practices of Load Balancing in Customer-Built Data Centers/
Load Balancing in Customer-Built Data Centers/
Configuration Guide/
Configuring Keepalived
Copied.
Configuring Keepalived
Procedure
- Run the following command in the background to modify the /etc/keepalived/keepalived.conf file and configure Keepalived for the primary LVS node:
vi /etc/keepalived/keepalived.conf
! Configuration File for keepalived global_defs { router_id master_node } local_address_group laddr_gl { 192.168.0.157 # IP address of the primary LVS node } vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 123456 } virtual_ipaddress { 192.168.0.27 } notify_master "/etc/keepalived/notify.sh master" notify_backup "/etc/keepalived/notify.sh backup" } Vitual IP port virtual_server 192.168.0.27 80 { delay_loop 6 lb_algo rr lb_kind FNAT protocol TCP laddr_group_name laddr_gl Backend server node real_server 192.168.0.3 80 { weight 1 TCP_CHECK { connect_timeout 15 connect_port 80 nb_get_retry 5 delay_before_retry 3 } } real_server 192.168.0.46 80 { weight 1 TCP_CHECK { connect_timeout 15 connect_port 80 nb_get_retry 5 delay_before_retry 3 } } }
- Run the following command in the background to modify the /etc/keepalived/keepalived.conf file and configure Keepalived for the standby LVS node:
vi /etc/keepalived/keepalived.conf
! Configuration File for keepalived global_defs { router_id master_node } local_address_group laddr_gl { 192.168.0.234 #Local IP address } vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 51 priority 99 #The value must be lower than that of the primary node. advert_int 1 authentication { auth_type PASS auth_pass 123456 } virtual_ipaddress { 192.168.0.27 } notify_master "/etc/keepalived/notify.sh master" notify_backup "/etc/keepalived/notify.sh backup" } virtual_server 192.168.0.27 80 { delay_loop 6 lb_algo rr lb_kind FNAT protocol TCP laddr_group_name laddr_gl real_server 192.168.0.3 80 { weight 1 TCP_CHECK { connect_timeout 15 connect_port 80 nb_get_retry 5 delay_before_retry 3 } } real_server 192.168.0.46 80 { weight 1 TCP_CHECK { connect_timeout 15 connect_port 80 nb_get_retry 5 delay_before_retry 3 } } }
- Run the following command in the background to modify the /etc/keepalived/notify.sh file:
vi /etc/keepalived/notify.sh
#!/bin/bash if [ $# -eq 0 ] then echo "input master/backup" exit 1 fi case $1 in master) sed -i "s/#laddr_group_name/laddr_group_name/" /etc/keepalived/keepalived.conf 2>/dev/null systemctl reload keepalived.service ;; backup) if [ `grep "#laddr_group_name" /etc/keepalived/keepalived.conf|wc -l` -eq 0 ] then sed -i "s/laddr_group_name/#laddr_group_name/" /etc/keepalived/keepalived.conf 2>/dev/null systemctl reload keepalived.service fi ;; esac
chmod +x /etc/keepalived/notify.sh
- Run the following command to enable keepalived:
- Check whether the configuration is modified:
NOTE:
If the number of servers returned by ipvsadm is different from the actual number, check whether the listener port allows traffic to the associated backend server.
- Run the following command to configure automatic startup:
Parent topic: Configuration Guide
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot