Blame doc/man/man8/keepalived.8

Packit c22fc9
.TH KEEPALIVED "8" "July 2018"
Packit c22fc9
Packit c22fc9
.na
Packit c22fc9
.nh
Packit c22fc9
Packit c22fc9
.SH "NAME"
Packit c22fc9
keepalived \- load\-balancing and high\-availability service
Packit c22fc9
Packit c22fc9
.SH "SYNOPSIS"
Packit c22fc9
\fBkeepalived\fP
Packit c22fc9
[\fB\-f\fP|\fB\-\-use\-file\fP=FILE]
Packit c22fc9
[\fB\-P\fP|\fB\-\-vrrp\fP]
Packit c22fc9
[\fB\-C\fP|\fB\-\-check\fP]
Packit c22fc9
[\fB\-B\fP|\fB\-\-no_bfd\fP]
Packit c22fc9
[\fB\-\-all\fP]
Packit c22fc9
[\fB\-l\fP|\fB\-\-log\-console\fP]
Packit c22fc9
[\fB\-D\fP|\fB\-\-log\-detail\fP]
Packit c22fc9
[\fB\-S\fP|\fB\-\-log\-facility\fP={0-7}]
Packit c22fc9
[\fB\-g\fP|\fB\-\-log\-file\fP=FILE]
Packit c22fc9
[\fB\-\-flush\-log\-file\fP]
Packit c22fc9
[\fB\-G\fP|\fB\-\-no\-syslog\fP]
Packit c22fc9
[\fB\-X\fP|\fB\-\-release\-vips\fP]
Packit c22fc9
[\fB\-V\fP|\fB\-\-dont\-release\-vrrp\fP]
Packit c22fc9
[\fB\-I\fP|\fB\-\-dont\-release\-ipvs\fP]
Packit c22fc9
[\fB\-R\fP|\fB\-\-dont\-respawn\fP]
Packit c22fc9
[\fB\-n\fP|\fB\-\-dont\-fork\fP]
Packit c22fc9
[\fB\-d\fP|\fB\-\-dump\-conf\fP]
Packit c22fc9
[\fB\-p\fP|\fB\-\-pid\fP=FILE]
Packit c22fc9
[\fB\-r\fP|\fB\-\-vrrp_pid\fP=FILE]
Packit c22fc9
[\fB\-c\fP|\fB\-\-checkers_pid\fP=FILE]
Packit c22fc9
[\fB\-a\fP|\fB\-\-address-monitoring\fP]
Packit c22fc9
[\fB\-b\fP|\fB\-\-bfd_pid\fP=FILE]
Packit c22fc9
[\fB\-s\fP|\fB\-\-namespace\fP=NAME]
Packit c22fc9
[\fB\-i\fP|\fB\-\-config-id\fP id]
Packit c22fc9
[\fB\-x\fP|\fB\-\-snmp\fP]
Packit c22fc9
[\fB\-A\fP|\fB\-\-snmp-agent-socket\fP=FILE]
Packit c22fc9
[\fB\-u\fP|\fB\-\-umask\fP=NUMBER]
Packit c22fc9
[\fB\-m\fP|\fB\-\-core\-dump\fP]
Packit c22fc9
[\fB\-M\fP|\fB\-\-core\-dump\-pattern\fP[=PATTERN]]
Packit c22fc9
[\fB\-\-signum\fP=SIGFUNC]
Packit c22fc9
[\fB\-t\fP|\fB\-\-config\-test\fP[=FILE]]
Packit c22fc9
[\fB\-\-perf\fP[={all|run|end}]]
Packit c22fc9
[\fB\-\-debug\fP[=debug-options]]
Packit c22fc9
[\fB\-v\fP|\fB\-\-version\fP]
Packit c22fc9
[\fB\-h\fP|\fB\-\-help\fP]
Packit c22fc9
Packit c22fc9
.SH "DESCRIPTION"
Packit c22fc9
Keepalived provides simple and robust facilities for load\-balancing
Packit c22fc9
and high\-availability. The load\-balancing framework relies on the
Packit c22fc9
well\-known and widely used Linux Virtual Server (IPVS) kernel module
Packit c22fc9
providing Layer4 load\-balancing. Keepalived implements a set of
Packit c22fc9
checkers to dynamically and adaptively maintain and manage a
Packit c22fc9
load\-balanced server pool according to their health. Keepalived also
Packit c22fc9
implements the VRRPv2 and VRRPv3 protocols to achieve high\-availability
Packit c22fc9
with director failover.
Packit c22fc9
Packit c22fc9
.SH "OPTIONS"
Packit c22fc9
.TP
Packit c22fc9
\fB -f, --use-file\fP=FILE
Packit c22fc9
Use the specified configuration file. The default configuration file
Packit c22fc9
is "/etc/keepalived/keepalived.conf".
Packit c22fc9
.TP
Packit c22fc9
\fB -P, --vrrp\fP
Packit c22fc9
Only run the VRRP subsystem. This is useful for configurations that do
Packit c22fc9
not use the IPVS load balancer.
Packit c22fc9
.TP
Packit c22fc9
\fB -C, --check\fP
Packit c22fc9
Only run the healthcheck subsystem. This is useful for configurations
Packit c22fc9
that use the IPVS load balancer with a single director with no failover.
Packit c22fc9
.TP
Packit c22fc9
\fB -B, --no_bfd\fP
Packit c22fc9
Don't run the BFD subsystem.
Packit c22fc9
.TP
Packit c22fc9
\fB --all\fP
Packit c22fc9
Run all subsystems, even if they have no configuration.
Packit c22fc9
.TP
Packit c22fc9
\fB -l, --log-console\fP
Packit c22fc9
Log messages to the local console. The default behavior is to log
Packit c22fc9
messages to syslog.
Packit c22fc9
.TP
Packit c22fc9
\fB -D, --log-detail\fP
Packit c22fc9
Detailed log messages.
Packit c22fc9
.TP
Packit c22fc9
\fB -S, --log-facility\fP=[0-7]
Packit c22fc9
Set syslog facility to LOG_LOCAL[0-7]. The default syslog facility is LOG_DAEMON.
Packit c22fc9
.TP
Packit c22fc9
\fB -g, --log-file\fP=FILE
Packit c22fc9
Write log entries to FILE. FILE will have _vrrp, _healthcheckers, and _bfd
Packit c22fc9
inserted before the last '.' in FILE for the log output for those processes.
Packit c22fc9
.TP
Packit c22fc9
\fB --flush-log-file\fP
Packit c22fc9
If using the -g option, the log file stream will be flushed after each write.
Packit c22fc9
.TP
Packit c22fc9
\fB -G, --no-syslog\fP
Packit c22fc9
Do not write log entries to syslog. This can be useful if the rate of writing
Packit c22fc9
log entries is sufficiently high that syslog will rate limit them, and the -g
Packit c22fc9
option is used instead.
Packit c22fc9
.TP
Packit c22fc9
\fB -X, --release-vips\fP
Packit c22fc9
Drop VIP on transition from signal.
Packit c22fc9
.TP
Packit c22fc9
\fB -V, --dont-release-vrrp\fP
Packit c22fc9
Don't remove VRRP VIPs and VROUTEs on daemon stop. The default
Packit c22fc9
behavior is to remove all VIPs and VROUTEs when keepalived exits.
Packit c22fc9
.TP
Packit c22fc9
\fB -I, --dont-release-ipvs\fP
Packit c22fc9
Don't remove IPVS topology on daemon stop. The default behavior it to
Packit c22fc9
remove all entries from the IPVS virtual server table when
Packit c22fc9
keepalived exits.
Packit c22fc9
.TP
Packit c22fc9
\fB -R, --dont-respawn\fP
Packit c22fc9
Don't respawn child processes. The default behavior is to restart the
Packit c22fc9
VRRP and checker processes if either process exits.
Packit c22fc9
.TP
Packit c22fc9
\fB -n, --dont-fork\fP
Packit c22fc9
Don't fork the daemon process. This option will cause keepalived to
Packit c22fc9
run in the foreground.
Packit c22fc9
.TP
Packit c22fc9
\fB -d, --dump-conf\fP
Packit c22fc9
Dump the configuration data.
Packit c22fc9
.TP
Packit c22fc9
\fB -p, --pid\fP=FILE
Packit c22fc9
Use the specified pidfile for the parent keepalived process. The default
Packit Service dfccb1
pidfile for keepalived is "/run/keepalived.pid", unless a network
Packit c22fc9
namespace is being used. See
Packit c22fc9
.B NAMESPACES
Packit c22fc9
below for more details.
Packit c22fc9
.TP
Packit c22fc9
\fB -r, --vrrp_pid\fP=FILE
Packit c22fc9
Use the specified pidfile for the VRRP child process. The default pidfile
Packit Service dfccb1
for the VRRP child process is "/run/keepalived_vrrp.pid", unless a
Packit c22fc9
network namespace is being used.
Packit c22fc9
.TP
Packit c22fc9
\fB -c, --checkers_pid\fP=FILE
Packit c22fc9
Use the specified pidfile for checkers child process. The default pidfile
Packit Service dfccb1
for the checker child process is "/run/keepalived_checkers.pid" unless
Packit c22fc9
a network namespace is being used.
Packit c22fc9
.TP
Packit c22fc9
\fB -a, --address-monitoring\fP
Packit c22fc9
Log all address additions/deletions reported by netlink.
Packit c22fc9
.TP
Packit c22fc9
\fB -b, --bfd_pid\fP=FILE
Packit c22fc9
Use the specified pidfile for the BFD child process. The default pidfile
Packit Service dfccb1
for the BFD child process is "/run/keepalived_bfd.pid" unless
Packit c22fc9
a network namespace is being used.
Packit c22fc9
.TP
Packit c22fc9
\fB -s, --namespace\fP=NAME
Packit c22fc9
Run keepalived in network namespace NAME. See
Packit c22fc9
.B NAMESPACES
Packit c22fc9
below for more details.
Packit c22fc9
.TP
Packit c22fc9
\fB -i, --config-id ID
Packit c22fc9
Use configuration id ID, for conditional configuration (defaults to
Packit c22fc9
hostname without the domain name).
Packit c22fc9
.TP
Packit c22fc9
\fB -x, --snmp\fP
Packit c22fc9
Enable the SNMP subsystem.
Packit c22fc9
.TP
Packit c22fc9
\fB -A, --snmp-agent-socket\fP=FILE
Packit c22fc9
Use the specified socket for connection to SNMP master agent.
Packit c22fc9
.TP
Packit c22fc9
\fB -u, --umask\fP=NUMBER
Packit c22fc9
The umask specified in the usual numeric way - see man umask(2)
Packit c22fc9
.TP
Packit c22fc9
\fB -m, --core-dump\fP
Packit c22fc9
Override the RLIMIT_CORE hard and soft limits to enable keepalived to
Packit c22fc9
produce a coredump in the event of a segfault or other failure.
Packit c22fc9
This is most useful if keepalived has been built with 'make debug'.
Packit c22fc9
Core dumps will be created in /, unless keepalived is run with the
Packit c22fc9
--dont-fork option, in which case they will be created in the directory
Packit c22fc9
from which keepalived was run, or they will be created in the directory
Packit c22fc9
of a configuraton file if the fault occurs while reading the file.
Packit c22fc9
.TP
Packit c22fc9
\fB -M, --core-dump-pattern\fP[=PATTERN]
Packit c22fc9
Sets option --core-dump, and also updates /proc/sys/kernel/core_pattern
Packit c22fc9
to the pattern specified, or 'core' if none specified.
Packit c22fc9
Provided the parent process doesn't terminate abnormally, it will restore
Packit c22fc9
/proc/sys/kernel/core_pattern to its original value on exit.
Packit c22fc9
Packit c22fc9
\fBNote:\fP This will also affect any other process producing a core dump while keepalived is running.
Packit c22fc9
.TP
Packit c22fc9
\fB --signum\fP=PATTERN
Packit Service dfccb1
Returns the signal number to use for STOP, RELOAD, DATA, STATS, STATS_CLEAR and JSON.
Packit c22fc9
For example, to stop keepalived running, execute:
Packit c22fc9
.IP
Packit c22fc9
.nf
Packit Service dfccb1
kill -s $(keepalived --signum=STOP) $(cat /run/keepalived.pid)
Packit c22fc9
.fi
Packit c22fc9
.TP
Packit c22fc9
\fB -t, --config-test\fP[=FILE]
Packit c22fc9
Keepalived will check the configuration file and exit with non-zero exit
Packit c22fc9
status if there are errors in the configuration, otherwise it exits with
Packit c22fc9
exit status 0 (see \fBExit status\fP below for details).
Packit c22fc9
Packit c22fc9
Rather that writing to syslog, it will write diagnostic messages to stderr
Packit c22fc9
unless file is specified, in which case it will write to the file.
Packit c22fc9
.TP
Packit c22fc9
\fB --perf\fP[={all|run|end}]
Packit c22fc9
Record perf data for vrrp process. Data will be written to /perf_vrrp.data.
Packit c22fc9
The data recorded is for use with the perf tool.
Packit c22fc9
.TP
Packit c22fc9
\fB --debug\fP[=debug-options]]
Packit c22fc9
Enables debug options if they have been compiled into keepalived.
Packit c22fc9
\fIdebug-options\fP is made up of a sequence of strings of the form Ulll.
Packit c22fc9
.br
Packit c22fc9
The upper case letter specifies the debug option, and the lower case letters
Packit c22fc9
specify for which processes the option is to be enabled.
Packit c22fc9
.br
Packit c22fc9
If a debug option is not followed by any lower case letters, the debug option
Packit c22fc9
is enabled for all processes.
Packit c22fc9
.PP
Packit c22fc9
.RS
Packit c22fc9
The characters to identify the processes are:
Packit c22fc9
.TS
Packit c22fc9
tab(@);
Packit c22fc9
c l
Packit c22fc9
c l.
Packit c22fc9
Chr@Process
Packit c22fc9
_
Packit c22fc9
p@Parent process
Packit c22fc9
b@BFD process
Packit c22fc9
c@Checker process
Packit c22fc9
v@VRRP process
Packit c22fc9
.TE
Packit c22fc9
.PP
Packit c22fc9
The characters used to identify the debug options are:
Packit c22fc9
.TS
Packit c22fc9
tab(@);
Packit c22fc9
c l.
Packit c22fc9
Chr@Debug option
Packit c22fc9
_
Packit c22fc9
D@Epoll thread dump
Packit c22fc9
E@Epoll debug
Packit c22fc9
F@VRRP fd debug
Packit c22fc9
N@Netlink timers
Packit Service dfccb1
P@Network timestamp
Packit c22fc9
X@Regex timers
Packit c22fc9
M@Email alert debug
Packit c22fc9
T@Timer debug
Packit c22fc9
S@TSM debug
Packit c22fc9
R@Regex debug
Packit c22fc9
.TE
Packit c22fc9
.PP
Packit c22fc9
\fBExample:\fP --debug=DvEcvNR
Packit c22fc9
.RE
Packit c22fc9
.TP
Packit c22fc9
\fB -v, --version\fP
Packit c22fc9
Display the version and exit.
Packit c22fc9
.TP
Packit c22fc9
\fB -h, --help\fP
Packit c22fc9
Display this help message and exit.
Packit c22fc9
.SS "Exit status:"
Packit c22fc9
.TP
Packit c22fc9
0
Packit c22fc9
if OK
Packit c22fc9
.TP
Packit c22fc9
1
Packit c22fc9
if unable to malloc memory
Packit c22fc9
.TP
Packit c22fc9
2
Packit c22fc9
if cannot initialise subsystems
Packit c22fc9
.TP
Packit c22fc9
3
Packit c22fc9
if running with --config-test and configuration cannot be run
Packit c22fc9
.TP
Packit c22fc9
4
Packit c22fc9
if running with --config-test and there are configuration errors but keepalived
Packit c22fc9
will run after modifying the configuration
Packit c22fc9
.TP
Packit c22fc9
5
Packit c22fc9
if running with --config-test and script security hasn't been enabled but scripts
Packit c22fc9
are configured.
Packit c22fc9
.SH NAMESPACES
Packit c22fc9
.B keepalived
Packit c22fc9
can be run in a network namespace (see
Packit c22fc9
\fBkeepalived.conf\fP(5) for configuration details). When
Packit c22fc9
run in a network namespace, a local mount namespace is also
Packit Service dfccb1
created, and /run/keepalived/keepalived_NamespaceName
Packit Service dfccb1
is mounted on /run/keepalived. By default, pid files with
Packit c22fc9
the usual default names are then created in
Packit Service dfccb1
/run/keepalived from the perspective of a process in the
Packit c22fc9
mount namespace, and they will be visible in
Packit Service dfccb1
/run/keepalived/keepalived_NamespaceName for a process
Packit c22fc9
running in the default mount namespace.
Packit c22fc9
Packit c22fc9
.SH SIGNALS
Packit c22fc9
.B keepalived
Packit c22fc9
reacts to a set of signals.  You can send a signal to
Packit c22fc9
the parent
Packit c22fc9
.B keepalived
Packit c22fc9
process using the following:
Packit c22fc9
.IP
Packit c22fc9
.nf
Packit Service dfccb1
kill -SIGNAL $(cat /run/keepalived.pid)
Packit c22fc9
.fi
Packit c22fc9
.PP
Packit c22fc9
or better:
Packit c22fc9
.IP
Packit c22fc9
.nf
Packit Service dfccb1
kill -s $(keepalived --signum=SIGFUNC) $(cat /run/keepalived.pid)
Packit c22fc9
.fi
Packit c22fc9
.PP
Packit c22fc9
Note that if the first option is used, -SIGNAL must be
Packit c22fc9
replaced with the actual signal you are trying to send,
Packit c22fc9
e.g. with HUP. So it then becomes:
Packit c22fc9
.IP
Packit c22fc9
.nf
Packit Service dfccb1
kill -HUP $(cat /run/keepalived.pid)
Packit c22fc9
.fi
Packit c22fc9
.PP
Packit c22fc9
Signals other than for STOP, RELOAD, DATA and STATS may change depending
Packit c22fc9
on the kernel, and also what functionality is included in the version of
Packit c22fc9
the keepalived depending on the build options used.
Packit c22fc9
.PP
Packit c22fc9
.TP
Packit c22fc9
.B HUP\fP or \fBSIGFUNC=RELOAD
Packit c22fc9
This causes
Packit c22fc9
.B keepalived
Packit c22fc9
to close down all interfaces, reload its configuration, and
Packit c22fc9
start up with the new configuration.
Packit c22fc9
.TP
Packit c22fc9
.B TERM\fP, \fBINT\fP or \fBSIGFUNC=STOP
Packit c22fc9
.B keepalived
Packit c22fc9
will shut down.
Packit c22fc9
.TP
Packit c22fc9
.B USR1\fP or \fBSIGFUNC=DATA
Packit c22fc9
Write configuration data to
Packit c22fc9
.B /tmp/keepalived.data
Packit c22fc9
.TP
Packit c22fc9
.B USR2\fP or \fBSIGFUNC=STATS
Packit c22fc9
Write statistics info to
Packit c22fc9
.B /tmp/keepalived.stats
Packit Service dfccb1
.TP
Packit Service dfccb1
.B SIGFUNC=STATS_CLEAR
Packit Service dfccb1
Write statistics info to
Packit Service dfccb1
.B /tmp/keepalived.stats
Packit Service dfccb1
and clear the statistics counters
Packit c22fc9
.TP
Packit c22fc9
.B SIGFUNC=JSON
Packit c22fc9
Write configuration data in JSON format to
Packit c22fc9
.B /tmp/keepalived.json
Packit c22fc9
.LP
Packit Service dfccb1
.SH "USING KEEPALIVED WITH FIREWALLD"
Packit Service dfccb1
If you are running a firewall (see
Packit Service dfccb1
.BR firewalld (8) )
Packit Service dfccb1
you must allow VRRP protocol traffic through the firewall. For example
Packit Service dfccb1
if this instance of
Packit Service dfccb1
.B keepalived(8)
Packit Service dfccb1
has a peer node on IPv4 address 192.168.0.1:
Packit Service dfccb1
.IP
Packit Service dfccb1
.nf
Packit Service dfccb1
# firewall-cmd \\
Packit Service dfccb1
    --add-rich-rule="rule family='ipv4' \\
Packit Service dfccb1
                     source address='192.168.0.1' \\
Packit Service dfccb1
                     protocol value='vrrp' accept" --permanent
Packit Service dfccb1
# firewall-cmd --reload
Packit Service dfccb1
.fi
Packit c22fc9
.SH "SEE ALSO"
Packit c22fc9
\fBkeepalived.conf\fP(5), \fBipvsadm\fP(8)
Packit c22fc9
Packit c22fc9
.SH "AUTHOR"
Packit c22fc9
This man page was written by Ryan O'Hara <rohara@redhat.com>