centos6配置本地yum,通过yum安装keepalived

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 on

配置keepalived文件
vi /etc/keepalived/keepalived.conf
(i进入编辑模式,esc退出,:回到末行,wq保存退出)
主机配置文件:

! Configuration File for keepalived

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

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
}

备机配置文件:
! Configuration File for keepalived

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

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

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





以上是关于centos6配置本地yum,通过yum安装keepalived的主要内容,如果未能解决你的问题,请参考以下文章

CentOS6.5 配置本地Yum源

通过 Mysql 官网配置更新本地的mysql源

如何配置Centos 6.5 的yum源

centos6系统配置本地yum源

CentOS6.x rsync+httpd搭建配置本地YUM源库

配置本地yum源