设为首页 - 加入收藏  
您的当前位置:首页 >IT科技 >负载均衡集群的方式设定和脚本 正文

负载均衡集群的方式设定和脚本

来源:亿华互联编辑:IT科技时间:2025-11-04 23:25:24
负载均衡集群的方式设定和脚本
负载复制#!/bin/bash # Open IP Forwarding echo 1 > /proc/sys/net/ipv4/ip_forward   # To make the load balancer forward the masquerading packets iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -d 0.0.0.0/0 -o eth0 -j MASQUERADE   ipvsadm -C   # Choose the Weighted Round Robing ipvsadm -A -t 10.0.0.1:80 -s wrr    # Set Real Server ipvsadm -a -t 10.0.0.1:80 -r 192.168.0.1:873 -m -w 2 ipvsadm -a -t 10.0.0.1:80 -r 192.168.0.2:873 -m -w 3 ipvsadm  1.2.3.4.5.6.7.8.9.10.11.12.

0.1304s , 11693.5 kb

Copyright © 2025 Powered by 负载均衡集群的方式设定和脚本,亿华互联  滇ICP备2023000592号-16

sitemap

Top