11 月 262012
 

 

备份当前YUM配置文件

#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

中国科技大学YUM更新源
USTC
mirrors.ustc.edu.cn

CentOS 5
http://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1
CentOS 6
http://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2

更新缓存

[root@com01 ~]# yum makecache 
Loaded plugins: fastestmirror, presto Determining fastest mirrors 
base                                                           | 3.7 kB     00:00 
base/filelists_db                                              | 5.9 MB     00:03 
base/other_db                                                  | 2.6 MB     00:01 
base/group_gz                                                  | 211 kB     00:00 
extras                                                         | 3.5 kB     00:00 
extras/filelists_db                                            | 3.9 kB     00:00 
extras/prestodelta                                             |  863 B     00:00 
extras/other_db                                                | 4.3 kB     00:00 
updates                                                        | 3.5 kB     00:00 
updates/filelists_db                                           | 3.0 MB     00:04 
updates/other_db                                               | 410 kB     00:00 
Metadata Cache Created [root@com01 ~]#
11 月 262012
 

配置全局IP地址

AX(config)#ip address 192.168.11.2 /24
AX(config)#ip default-gateway 192.168.11.1

启用LAN接口

AX(config)#interface ethernet 1
AX(config-if:ethernet1)#enable
AX(config-if:ethernet1)#exit

配置真实服务器

AX(config)#slb server app01 192.168.11.150
AX(config-real server)#port 8080 tcp
AX(config-real server-node port)#exit
AX(config-real server)#exit
AX(config)#slb server app02 192.168.11.151
AX(config-real server)#port 8080 tcp
AX(config-real server-node port)#exit
AX(config-real server)#exit

配置服务组

AX(config)#slb service-group sg-http tcp
AX(config-slb service group)#member app01:8080
AX(config-slb service group)#member app02:8080
AX(config-slb service group)#exit

配置虚拟服务器

AX(config)#slb virtual-server vapp-http 192.168.11.100
AX(config-slb virtual server)#port 8080 tcp
AX(config-slb virtual server-slb virtua...)#service-group sg-http
AX(config-slb virtual server-slb virtua...)#no-dest-nat

真实服务器端配置

#ifconfig lo:0 192.168.11.100 netmask 255.255.255.255 -arp up
 
#echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
#echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
#echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
#echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce