In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
LVS-DR deployment script
#! / bin/bash
VIP=192.168.11.100
DIP=192.168.11.11
RIP1=192.168.11.12
RIP2=192.168.11.13
POST=80
Lvs_dr () {
Ifconfig eth0:0$ VIP netmask 255.255.255.0 up
Route add-host $VIP dev eth0:0
Rpm-Q ipvsadm & & echo "ipvsadm exists" | | yum-y install ipvsadm & > / dev/null
Echo 1 > / proc/sys/net/ipv4/ip_forward
Ipvsadm-C
Ipvsadm-At ${VIP}: ${POST}-s wrr
Ipvsadm-at ${VIP}: ${POST}-r ${RIP1}: ${POST}-g-w 1
Ipvsadm-at ${VIP}: ${POST}-r ${RIP2}: ${POST}-g-w 3
Ipvsadm-Ln
}
Rs_web () {
Ifconfig lo:0$ VIP netmask 255.255.255.255 up
Route add-host $VIP dev lo:0
Rpm-Q httpd & & echo "httpd already installd" | | yum-y install httpd & > / dev/null
Systemctl restart httpd
Systemctl enable httpd
Web_ip=$ (ifconfig eth0 | awk'/ netmask/ {print $2}')
Echo $web_ip > / var/www/html/index.html
Curl $web_ip
Echo 1 > / proc/sys/net/ipv4/conf/lo/arp_ignore
Echo 1 > / proc/sys/net/ipv4/conf/all/arp_ignore
Echo 2 > / proc/sys/net/ipv4/conf/lo/arp_announce
Echo 2 > / proc/sys/net/ipv4/conf/all/arp_announce
Sysctl-p
}
Case $1 in
Start)
Lvs_dr
Ipvsadm-save
Stop)
Ipvsadm-C
Ipvsadm-Ln
Rs_web)
Rs_web
*)
Echo "usage: $0 [start | stop | rs_web]"
Esac
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.