背景:
阅读新闻
LVS在企业网中的应用
[日期:2012-10-26] 来源:Linux社区 作者:Fighting [字体:]
这里需要配置yum
[root@localhost ~]# mkdir /mnt/cdrom
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/
[root@localhost ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-server]
2 name=Red Hat Enterprise Linux server
3 baseurl=file:///mnt/cdrom/Server
4 enabled=1
5 gpgcheck=1
6 gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-RedHat-release
7 [rhel-cluster]
8 name=Red Hat Enterprise Linux cluster
9 baseurl=file:///mnt/cdrom/Cluster
10 enabled=1
11 gpgcheck=1
12 gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
13 [rhel-vt]
14 name=Red Hat Enterprise Linux vt
15 baseurl=file:///mnt/cdrom/VT
16 enabled=1
17 gpgcheck=1
18 gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
19 [rhel-clusterstorage]
20 name=Red Hat Enterprise Linux clusterstorage
21 baseurl=file:///mnt/cdrom/ClusterStorage
22 enabled=1
23 gpgcheck=1
24 gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
安装ipvsadm
[root@localhost ~]# yum install ipvsadm –y
添加规则
访问192.168.145.101的80端口时采用rr调度算法,并且发送给Web服务器群集节点
[root@localhost ~]# ipvsadm -A -t 192.168.145.101:80 -s rr
[root@localhost ~]# ipvsadm -a -t 192.168.145.101:80 -r 192.168.145.200 –g //-g表示模型为DR
[root@localhost ~]# ipvsadm -a -t 192.168.145.101:80 -r 192.168.145.201 -g
[root@localhost ~]# service ipvsadm save //保存规则
[root@localhost ~]# service ipvsadm start //启动服务
添加一个设备,这里命名为eth0:0 ,ip地址设为192.168.145.101 子网掩码设为255.255.255.0
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:1B:E2:73
inet addr:192.168.145.100 Bcast:192.168.145.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1b:e273/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3125 errors:0 dropped:0 overruns:0 frame:0
TX packets:4238 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240611 (234.9 KiB) TX bytes:785373 (766.9 KiB)
Interrupt:67 Base address:0x2000
eth0:0 Link encap:Ethernet HWaddr 00:0C:29:1B:E2:73
inet addr:192.168.145.101 Bcast:192.168.145.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:67 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1881 errors:0 dropped:0 overruns:0 frame:0
TX packets:1881 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2956328 (2.8 MiB) TX bytes:2956328 (2.8 MiB)
刷新网页
Corosync+OpenAIS+Pacemaker+Web+DRBD实现高可用群集
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯