keepalived 설치 설정

3844 단어
#install
yum install keepalived
기본적으로/etc/keepalived/keepalived에 설정되어 있습니다.conf 로그는/var/log/messages
[root@host-192-168-3-200 ~]# vi /etc/sysconfig/keepalived

# Options for keepalived. See `keepalived --help' output and keepalived(8) and
# keepalived.conf(5) man pages for a list of all options. Here are the most
# common ones :
#
# --vrrp -P Only run with VRRP subsystem.
# --check -C Only run with Health-checker subsystem.
# --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop.
# --dont-release-ipvs -I Dont remove IPVS topology on daemon stop.
# --dump-conf -d Dump the configuration data.
# --log-detail -D Detailed log messages.
# --log-facility -S 0-7 Set local syslog facility (default=LOG_DAEMON)
#

KEEPALIVED_OPTIONS="-f /conf/keepalived/keepalived.conf -P -D -S 0"

KEEPALIVED 수정OPTIONS의 매개 변수 - f가 conf 디렉터리 - S 로그 위치를 지정합니다 전제: - f가 지정한 디렉터리의keepalived.conf는 기본 디렉터리 설정에서 복사합니다. 원래/etc/keepalived/keepalived를 백업합니다.conf 및 제거-S 0 지정/etc/rsyslog.conf의 로그 디렉토리
# vi /etc/rsyslog.conf
#### RULES ####
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages

# The authpriv file has restricted access.
authpriv.* /var/log/secure

# Log all the mail messages in one place.
mail.* -/var/log/maillog


# Log cron stuff
cron.* /var/log/cron

# Everybody gets emergency messages
*.emerg :omusrmsg:*

# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler

# Save boot messages also to boot.log
local7.* /var/log/boot.log

local0.* /var/log/keepalived.log

- S가 지정한 0은local0.*입니다.local0.* 추가새 로그 위치/var/log/keepalived로 지정합니다.log 이 때 rsyslog 서비스 systemctl restart rsyslog 를 다시 시작하고keepalived 서비스 systemctl restart keepalived 를 다시 시작합니다
IP a의 가상 IP 및 keepalived를 봅니다.log

좋은 웹페이지 즐겨찾기