In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
For testing, different web page files are prepared on each web node to test whether there is a load balancing effect, and now the effect is there, so it is necessary to build a shared storage server, in which all web nodes read web page files from the shared storage server and provide them to client in order to provide the same web page files to client.
Next, start configuring the shared storage server.
6 、 Configure NFS server [root@centos03 ~] # yum-y install rpcbind nfs-utils [root@centos03 ~] # mkdir / web [root@centos03 ~] # echo "www.nfs.com" > / web/index.html [root@centos03 ~] # vim / etc/exports / web 192.168.100.10 (ro) 192.168.100.20 (rw) [root@centos03 ~] # systemctl start rpcbind [root@centos03 ~] # systemctl enable rpcbind [root@centos03 ~] # systemctl enable nfs [root@centos03 ~] # showmount-e 192.168.100.30 Export list for 192.168.100.30:/web 192.168.100.20192.168.100.107, Web site mount shared storage directory 1) Web node 1 server mounts the shared directory [root@centos01 ~] # mount 192.168.100.30:/web / var/www/html/ [root@centos01 ~] # cat / var/www/html/index.html www.nfs.com [root@centos01 ~] # vim / etc/fstab 192.168.100.30:/web / var/www/html/ Nfs defaults 00 [root@centos01 ~] # systemctl restart httpd 2) Web Node 2 server mounts the shared directory [root@centos02 ~] # mount 192.168.100.30:/web / var/www/html/ [root@centos02 ~] # cat / var/www/html/index.html www.nfs.com [root@centos02 ~] # vim / etc/fstab 192.168. 100.30:/web / var/www/html/ nfs defaults 00 [root@centos02 ~] # systemctl restart httpd 8, The client visits the test again
This time, no matter how much the client refreshes, the page you see will always be www.nfs.com.
9. Case-related query commands
1) on which scheduler is VIP, query the physical interface of the VIP address hosted by the scheduler, and you can see the VIP address (VIP address cannot be found on the backup scheduler):
[root@centos04 ~] # ip a show dev ens32 ens32: ate UP groupn 1000 link/ether 00:0c:29:77:2c:03 brd ff:ff:ff:ff:ff:ff inet 192.168.100.40 brd 24 brd 192.168.100.255 scope global noprefixroute ens32 valid_lft forever preferred_lft forever inet 192.168.100.253 scope global ens32 valid_lft forever preferred_lft forever inet6 fe80::95f8:eeb7:2ed2 : d13c/64 scope link noprefixroute valid_lft forever preferred_lft forever
2) query which web nodes
[root@centos04] # ipvsadm-ln IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port Forward Weight ActiveConn InActConnTCP 192.168.100.253 rr persistent 80 rr persistent 50-> 192.168.100.10 root@centos04 80 Route 100-> 192.168.100.20 size=4096 80 Route 100
3) simulate the failure of the second Web node and the primary scheduler, and query the VIP and web nodes again on the backup scheduler
[root@centos05 ~] # ip a show dev ens32 ens32: ate UP groupn 1000 link/ether 00:0c:29:77:2c:03 brd ff:ff:ff:ff:ff:ff inet 192.168.100.40 brd 24 brd 192.168.100.255 scope global noprefixroute ens32 valid_lft forever preferred_lft forever inet 192.168.100.253 scope global ens32 valid_lft forever preferred_lft forever inet6 fe80::95f8:eeb7:2ed2:d13c / 64 scope link noprefixroute valid_lft forever preferred_lft forever [root@centos05 ~] # ipvsadm-ln IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port Forward Weight ActiveConn InActConnTCP 192.168.100.253 scope link noprefixroute valid_lft forever preferred_lft forever 80 rr-> 192.168.100.10 ipvsadm 80 Route 100
4) View the log messages when the scheduler fails over
[root@centos05] # tail-30 / var/log/messages
-this is the end of this article. Thank you for reading-
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.