背景:
阅读新闻
Linux下群集服务之LVS-DR模型在企业网络中的应用案例
[日期:2012-05-06] 来源:Linux社区 作者:xjzhujunjie [字体:]
三.配置real-server-1的web服务器:
3.1 解决arp问题:
[root@ ~]# hostname r1.junjie.com
注销重新登录
[root@r1 ~]# echo "net.ipv4.conf.all.arp_announce = 2" >> /etc/sysctl.conf
[root@r1 ~]# echo "net.ipv4.conf.lo.arp_announce = 2" >> /etc/sysctl.conf
[root@r1 ~]# echo "net.ipv4.conf.all.arp_ignore = 1" >> /etc/sysctl.conf
[root@r1 ~]# echo "net.ipv4.conf.lo.arp_ignore = 1" >> /etc/sysctl.conf
[root@r1 ~]# sysctl -p
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.lo.arp_ignore = 1
3.2 配置ip地址和路由
[root@r1 ~]# setup
[root@r1 ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@r1 ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:1B:F1:BA
inet addr:10.106.6.251 Bcast:10.106.6.255 Mask:255.255.255.0
[root@r1 ~]# ifconfig lo:0
lo:0 Link encap:Local Loopback
inet addr:10.106.6.254 Mask:255.255.255.255
[root@r1 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.106.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 10.106.6.254 0.0.0.0 UG 0 0 0 lo
[root@r1 ~]# route add -host 10.106.6.254 dev lo:0
[root@r1 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.106.6.254 0.0.0.0 255.255.255.255 UH 0 0 0 lo
10.106.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 10.106.6.254 0.0.0.0 UG 0 0 0 lo
3.3 配置Real-server-1的Web服务器:
[root@r1 ~]#mkdir /mnt/cdrom
[root@r1 ~]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@r1 ~]# rpm -ivh /mnt/cdrom/Server/httpd-2.2.3-31.el5.i386.rpm
warning: /mnt/cdrom/Server/httpd-2.2.3-31.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... #################################### [100%]
1:httpd ########################################### [100%]
[root@r1 ~]# echo "web1 -- real-server-1" > /var/www/html/index.html
[root@r1 ~]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for r1.junjie.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
3.4 客户端访问real-server-1的web服务:(桥接)
相关资讯 Linux集群
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯