安装oracle11g时,ORACLE_SID设置成db_254的形式,会导致sqlplus登录时不方便,因此最好设置成export ORACLE_SID=db254的形式,以免引起不必要的麻烦。
一小兄弟来电询问,说keepalived做mysql的failover时,vip可以漂移,但mysql进程自动起不来。疑惑在于:脚本权限没问题,手动运行也是对的。我建议他把配置发过来,其内容为:
global_defs {
router_id LVS_DEVEL
}
vrrp_script check_mysql {
script /tmp/check_mysql.sh
interval 2
weight 2
}
track_script {
check_mysql
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.112.70
}
}
哈哈,track_script跑到vrrp_instance外边去了,要把它关在里面才行哟!他说网上全是这样,真是以讹传讹,误导人呢!贴个正确的配置在后面,供大家参考:
global_defs {
router_id LVS_DEVEL
}
vrrp_script check_mysql {
script /tmp/check_mysql.sh
interval 2
weight 2
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
track_script {
check_mysql
}
virtual_ipaddress {
192.168.112.70
}
}