默认日志存放在系统日志:/var/log/messages下

[root@lb01 /]# tail -f  /var/log/messages
Oct :: lb01 Keepalived_vrrp[]: Kernel is reporting: interface eth0 UP
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Transition to MASTER STATE
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Entering MASTER STATE
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) setting protocol VIPs.
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.119.150
Oct :: lb01 Keepalived_healthcheckers[]: Netlink reflector reports IP 192.168.119.150 added
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.119.150
Oct :: lb01 dhclient[]: DHCPREQUEST on eth0 to 192.168.119.254 port (xid=0x32903a31)
Oct :: lb01 dhclient[]: DHCPACK from 192.168.119.254 (xid=0x32903a31)
Oct :: lb01 dhclient[]: bound to 192.168.119.128 -- renewal in seconds.

把日志单独存放

修改/etc/sysconfig/keepalived

把KEEPALIVED_OPTIONS="-D" 修改为:KEEPALIVED_OPTIONS="-D -d -S 0"

[root@lb01 /]# vim /etc/sysconfig/keepalived
# Options for keepalived. See `keepalived --help' output and keepalived(8) and
# keepalived.conf() 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 - Set local syslog facility (default=LOG_DAEMON)
# KEEPALIVED_OPTIONS="-D -d -S 0"

在/etc/rsyslog.conf 末尾添加

[root@lb01 /]# vim /etc/rsyslog.conf
local0.* /var/log/keepalived.log

重启日志记录服务

[root@lb01 /]# /etc/init.d/rsyslog restart
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]

重启keepalived

[root@lb01 /]# /etc/init.d/keepalived restart
Stopping keepalived: [ OK ]
Starting keepalived: [ OK ]

查看日志

[root@lb01 /]# tail -f /var/log/keepalived.log
Oct :: lb01 Keepalived_healthcheckers[]: Using autogen SSL context
Oct :: lb01 Keepalived_healthcheckers[]: Using LinkWatch kernel netlink reflector...
Oct :: lb01 Keepalived_vrrp[]: VRRP sockpool: [ifindex(), proto(), unicast(), fd(,)]
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Transition to MASTER STATE
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Received lower prio advert, forcing new election
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Entering MASTER STATE
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) setting protocol VIPs.
Oct :: lb01 Keepalived_healthcheckers[]: Netlink reflector reports IP 192.168.119.150 added
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.119.150
Oct :: lb01 Keepalived_vrrp[]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.119.150

Keepalived日志的更多相关文章

  1. keepalived日志显示脚本能执行成功,但是amoeba程序没启动起来,单独执行脚本amoeba能启动成功,放到keepalived里面启动不起来

    keepalived日志如图: 解决:keepalived还有crontab等计划任务自动执行脚本,并不会有本地用户的环境变量,需要在脚本里面加 . /etc/profile  引入本地用户的环境变量

  2. 详解centos7中配置keepalived日志为别的路径

    由于在默认状态下keepalived的日志会写入到/var/log/message中,我们需要将此剥离出来. 在centos 6下可以: (1)首先修改/etc/sysconfig/keepalive ...

  3. Centos7 keepalived 修改日志路径

    Keepalived默认所有的日志都是写入到/var/log/message下的,由于message的日志太多了,而Keepalived的日志又很难分离出来,所以本文提供了一个调整Keepalived ...

  4. Net分布式系统之三:Keepalived+LVS+Nginx负载均衡之高可用

    上一篇写了nginx负载均衡,此篇实现高可用(HA).系统整体设计是采用Nginx做负载均衡,若出现Nginx单机故障,则导致整个系统无法正常运行.针对系统架构设计的高可用要求,我们需要解决Nginx ...

  5. keepalived+LVS 实现双机热备、负载均衡、失效转移 高性能 高可用 高伸缩性 服务器集群

    本章笔者亲自动手,使用LVS技术实现实现一个可以支持庞大访问量.高可用性.高伸缩性的服务器集群 在读本章之前,可能有不少读者尚未使用该技术,或者部分读者使用Nginx实现应用层的负载均衡.这里大家都可 ...

  6. 通过Keepalived实现Redis Failover自动故障切换功能

    通过Keepalived实现Redis Failover自动故障切换功能[实践分享] 参考资料: http://patrick-tang.blogspot.com/2012/06/redis-keep ...

  7. redis+Keepalived实现Redis主从复制

    redis+Keepalived实现Redis主从复制: 环境:CentOs6.5Master: 10.10.10.203Slave:   10.10.10.204Virtural IP Addres ...

  8. 为什么很多人用keepalived来实现redis故障转移

    目前,Redis还没有一个类似于MySQL Proxy或Oracle RAC的官方HA方案.Redis作者有一个名为Redis Sentinel的计划 ,据称将会有监控,报警和自动故障转移三大功能,非 ...

  9. CentOS下安装keepalived 进行服务器热备

    一.准备: 1.1 安装依赖软件 如果系统为基本文本安装,需要安装一下软件  yum -y install ipvsadm yum -y install kernel kernel-devel reb ...

随机推荐

  1. HIbernate二级缓存

    一.定义: 二级缓存是进程或集群范围内的缓存,可以被所有的Session共享,是可配置的插件 二.二级缓存原理图 解析:每次从二级缓存中取出的对象,都是一个新的对象. 三.配置步骤如下: 同理:以员工 ...

  2. Hibernate延迟加载、三种状态、脏检查 缓存

    一.持久化对象的唯一标识 java中按内存地址不同区分同一个类的不同对象,关系数据库用主键区分同一条记录,Hibernate使用OID来建立内存中的对象和数据库中记录的对应关系 什么是OID? 解析: ...

  3. Spring BeanUtils 的对象复制 copyProperties

    Spring提供了一个非常棒的对象复制方法, 其参数的顺序和apache commons提供的同名方法是不一样的, 这个要小心. 源码 public static void copyPropertie ...

  4. bootstrap 组件

      bootstrap  组件 1下拉菜单(dropdown)  下拉菜单切换(dropdown-toggle)  下拉菜单对齐(dropdown-menu-right-右对齐) 下拉菜单分割线(di ...

  5. C# SaveFileDialog的用法(转载)

    #region 保存对话框private void ShowSaveFileDialog(){//string localFilePath, fileNameExt, newFileName, Fil ...

  6. LeetCode:N-Queens I II(n皇后问题)

    N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no tw ...

  7. php根据地址的经纬度查询周围的城市例子

    目前的工作是需要对用户的一些数据进行分析,每个用户都有若干条记录,每条记录中有用户的一个位置,是用经度和纬度表示的.还有一个给定的数据库,存储的是一些已知地点以及他们的经纬度,内有43W多条的数据.现 ...

  8. redis-介绍与比较

    <一>. NoSQL简介:    NoSQL是Not-Only-SQL的缩写,是被设计用来替换传统的关系型数据库在某些领域的用,特别针对web2.0站点以及大型的SNS网站,用来满足高并发 ...

  9. WCF服务器证书配置说明-没有能够进行密钥交换的私钥,或者进程可能没有访问私钥的权限

    WCF服务器证书配置说明 1.创建证书: makecert.exe -sr LocalMachine -ss My -a sha1 -n CN=XXX -sky exchange -pe 说明: -s ...

  10. Leetcode 94. Binary Tree Inorder Traversal

    Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tre ...