分类: LINUX
2011-05-17 18:02:58
--------------------------------------------------------------------------
realserver:
1.配置IP
[root@realserver1 ~]# ifconfig eth0 192.168.0.1 netmask 255.255.255.0
2.网关指向DIP
[root@realserver1 ~]# route add default gw 192.168.0.3 dev eth0
3.安装httpd服务
[root@realserver1 ~]# yum install httpd -y
[root@realserver1 ~]# vim /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.0.1 realserver1.com realserver1
[root@realserver1 ~]# echo "realserver1" > /var/www/html/index.html
[root@realserver1 ~]# /etc/init.d/httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
----------------------------------------------------------
director:
1.配置IP
[root@director ~]# ifconfig eth0 192.168.0.3 netmask 255.255.255.0
[root@director ~]# ifconfig eth1 192.9.202.100 netmask 255.255.255.0
2.网关指向DGW
[root@director ~]# route add default gw 192.9.202.253 dev eth1
3.打开IP转发
[root@director ~]# echo 1 > /proc/sys/net/ipv4/ip_forward
4.安装ipvsadm服务
[root@director ~]# yum install ipvsadm -y
[root@director ~]# ipvsadm -A -t 192.9.202.100:80 -s rr
[root@director ~]# ipvsadm -a -t 192.9.202.100:80 -r 192.168.0.1:80 -m
[root@director ~]# ipvsadm -a -t 192.9.202.100:80 -r 192.168.0.2:80 -m
[root@director ~]# /etc/init.d/ipvsadm save
Saving IPVS table to /etc/sysconfig/ipvsadm: [ OK ]