keeplived日誌重定向

由於默認keepalived日誌存檔於LINUX系統日誌文件/var/log/message內,爲了便於後期維護和管理,須要重定向keepalived的日誌文件ide

  1. 在keeplived節點上編輯/etc/sysconfig/keepalived文件,加入最後一行spa


    # vi /etc/sysconfig/keepalivedrest

    # 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 mostip

    # common ones :ci

    #rem

    # --vrrp -P Only run with VRRP subsystem.it

    # --check -C Only run with Health-checker subsystem.io

    # --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop.class

    # --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="-D -d -S 0"

  2. 修改節點日誌配置文件/etc/rsyslog.conf

    #vi /etc/rsyslog.conf
    加入以下配置:
    #keepalived -S 0
    local0.* /var/log/keepalived.log

  3. 重啓日誌服務

    # /etc/init.d/rsyslog restart

相關文章
相關標籤/搜索