centos6配置本地yum,經過yum安裝keepalived

上傳系統鏡像到/iso
建立目錄
mkdir /media/cdrom
掛載鏡像文件到剛建立的目錄
mount -o loop /iso/CentOS-6.6-x86_64-bin-DVD1.iso /media/cdrom
yum經過本地源安裝keepalived
yum --disablerepo=* --enablerepo=c6-media install -y keepalived
啓動 keepalived
/etc/init.d/keepalived start
將keepalived加入到自啓列表並設置爲啓動
chkconfig --add keepalived
chkconfig keepalived onide

配置keepalived文件
vi /etc/keepalived/keepalived.conf
(i進入編輯模式,esc退出,:回到末行,wq保存退出)
主機配置文件:oop

! Configuration File for keepalivedrouter

global_defs {
notification_email {br/>acassen@firewall.loc
failover@firewall.locbr/>sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}server

vrrp_instance VI_1 {
state MASTER
interface em1
virtual_router_id 51
priority 100
advert_int 1
}
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.17.17.130/24
}ip

備機配置文件:
! Configuration File for keepalivedget

global_defs {
notification_email {br/>acassen@firewall.loc
failover@firewall.locbr/>sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}it

vrrp_instance VI_1 {
state BACKUP
interface em1
virtual_router_id 51
priority 95
advert_int 1
}io

authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.17.17.130/24
}
}class

相關文章
相關標籤/搜索