In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Environment: master keepalived server: 192.168.80.100 Slave keepalived server: 192.168.80.101Web server: 192.168.80.102 192.168.80.103 on 80.100 virtual machine: systemctl stop firewalld / / turn off firewall setenforce 0 / / turn off monitoring yum install lrz*-y / / install upload software to pull keepalived package into
Tar xf keepalived-1.4.2.tar.gz-C / opt/ extract the keepalived-1.4.2 file to / optcd / opt/keepalived-1.4.2/yum install gcc gcc-c++ make popt-devel kernel-devel openssl-devel-y./configure-- prefix=/make & & make installcd / cd / etc/ls | grep keepalivedcd keepalived/
Vi keepalived.conf / / enter keepalived to delete all content and add the following:! Configuration File for keepalivedglobal_defs {router_id LVS_01 / / name of this server} vrrp_instance VI_1 {/ / defines VRRP hot standby instance state MASTER / / hot standby status, MASTER represents master server, BACKUP represents slave server interface ens32 / / physical interface virtual_router_id 51 / / virtual router's ID number that carries VIP address Each hot backup group maintains consistent priority 110s / / priority. The higher the value, the higher the priority. Advert_int 1 / / seconds between announcements (heartbeat rate) authentication {/ / hot backup authentication information Each hot backup group maintains consistent auth_type PASS / / authentication type auth_pass 6666 / / password string} virtual_ipaddress {/ / specify drift address (VIP) There can be multiple 192.168.80.188}} virtual_server 192.168.80.188 80 {/ / virtual server addresses (VIP), Port delay_loop 6 / / interval between health checks (seconds) lb_algo rr / / polling (rr) scheduling algorithm lb_kind DR / / Direct routing (DR) Cluster operating mode persistence_timeout 60 / / connection retention time (seconds) protocol TCP / / the application server uses the TCP protocol real_server 192.168.80.102 80 {/ / the address of the first Web server node, Weight of port weight 1 / / Node weight TCP_CHECK {/ / Health check method connect_port 80 / / Target port connect_timeout 3 / / connection timeout (seconds) nb_get_retry 3 / / connection timeout (seconds) Delay_before_retry 3 / / retry interval}} real_server 192.168.80.103 80 {/ / the address of the second Web server node, Weight of port weight 1 / / Node TCP_CHECK {/ / Health check method connect_port 80 / / Target port connect_timeout 3 / / connection timeout (seconds) Nb_get_retry 3 / / connection timeout (seconds) delay_before_retry 3 / / retry interval}: wq / / Save exit service keepalived startsystemctl status keepalived / / View keepalived status
Ip addr show dev ens32
Modprobe ip_vsyum install ipvsadm-yservice keepalived restartipvsadm-Ln / / View LVS virtual server
On the 80.101 virtual machine: systemctl stop firewalld / / turn off the firewall setenforce 0 / / close the monitoring yum install lrz*-y / / install the upload software to pull the keepalived package into
Tar xf keepalived-1.4.2.tar.gz-C / opt/ extract the keepalived-1.4.2 file to / optcd / opt/keepalived-1.4.2/yum install gcc gcc-c++ make popt-devel kernel-devel openssl-devel-y./configure-- prefix=/make & & make installmodprobe ip_vsyum install ipvsadm-yvi / etc/keepalived/keepalived.conf / / remove everything and add the following:! Configuration File for keepalivedglobal_defs {router_id LVS_02} vrrp_instance VI_1 {state BACKUP interface ens32 virtual_router_id 51 priority 105 advert_int 1 authentication {auth_type PASS auth_pass 6666} virtual_ipaddress {192.168.80.188}} virtual_server 192.168.80.188 80 {delay_loop 6 lb_algo rr lb_kind DR Persistence_timeout 60 protocol TCPreal_server 192.168.80.102 80 {weight 1 TCP_CHECK {connect_port 80 connect_timeout 3 nb_get_retry 3 delay_before_retry 3}} real_server 192.168.80.103 80 {weight 1 TCP_CHECK {connect_port 80 connect_timeout 3 Nb_get_retry 3 delay_before_retry 3}}: wq / / Save exit service keepalived startsystemctl status keepalived / / View keepalived status
-
On the 80.102 virtual machine: systemctl stop firewalldsetenforce 0yum install httpd-y / / remove the # before installing httpd vi / etc/httpd/conf/httpd.confServerName www.example.com.80
Cd / var/www/html/ enter the directory echo "SERVER AA" > index.html / / add content lscat index.html to index.html
Systemctl start httpdcdls./web.sh
Ifconfig / / Lookup IP address
On virtual machine 80.103: systemctl stop firewalldsetenforce 0
Yum install httpd-y / / install httpd
Remove the front # of vi / etc/httpd/conf/httpd.confServerName www.example.com.80
Cd / var/www/html/ enter the directory echo "SERVER BB" > index.html / / add content lscat index.html to index.html
Add the following to systemctl start httpdvi web.sh: #! / bin/bash#ifconfig lo:0 192.168.80.188 broadcast 192.168.80.188 netmask 255.255.255.255 uproute add-host 192.168.80.188 dev lo:0echo "1" > / proc/sys/net/ipv4/conf/lo/arp_ignoreecho "2" > / proc/sys/net/ipv4/conf/lo/arp_announceecho "1" > / proc/sys/net/ipv4/conf / all/arp_ignoreecho "2" > / proc/sys/net/ipv4/conf/all/arp_announcesysctl-p & > / dev/null: wq / / Save exit chmod + x web.sh / / set permissions. / web.shifconfig / / find the IP address
Scp web.sh root@192.168.80.102:/root/ pass the address to the yesroot password
Enter http:192.168.80.188 on the web page
In 80.103, systemctl stop httpd / / close the httpd and refresh the page as follows:
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: 273
*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.