Blame INSTALL

Packit Service 5956c7
Kernel needs
Packit Service 5956c7
==============
Packit Service 5956c7
Packit Service 5956c7
  Compile a kernel with the following options :
Packit Service 5956c7
Packit Service 5956c7
  Kernel/User netlink socket
Packit Service 5956c7
  LinuxVirtualServer
Packit Service 5956c7
Packit Service 5956c7
  Keepalived supports all LVS code.
Packit Service 5956c7
Packit Service 5956c7
Library dependencies
Packit Service 5956c7
====================
Packit Service 5956c7
Packit Service 5956c7
  In order to compile Keepalived needs the following libraries :
Packit Service 5956c7
Packit Service 5956c7
  * OpenSSL, <www.openssl.org>
Packit Service 5956c7
Packit Service 5956c7
Linux flavours
Packit Service 5956c7
==============
Packit Service 5956c7
Packit Service 5956c7
RedHat based systems (RedHat Enterprise/CentOS/Fedora)
Packit Service 5956c7
------------------------------------------------------
Packit Service 5956c7
The following build packages are needed:
Packit Service 5956c7
	make
Packit Service 5956c7
	autoconf automake (to build from git source tree rather than tarball)
Packit Service 5956c7
The following libraries need to be installed:
Packit Service 5956c7
	openssl-devel libnl3-devel ipset-devel iptables-devel libnfnetlink-devel
Packit Service 5956c7
For magic file identification support:
Packit Service 5956c7
	file-devel
Packit Service 5956c7
For SNMP support:
Packit Service 5956c7
	net-snmp-devel
Packit Service 5956c7
For DBUS support:
Packit Service 5956c7
	glib2-devel
Packit Service 5956c7
For JSON support:
Packit Service 5956c7
	json-c-devel
Packit Service 5956c7
For PCRE support
Packit Service 5956c7
	pcre2-devel
Packit Service 5956c7
Packit Service 5956c7
For building the documentation, the following packages need to be installed:
Packit Service 5956c7
	Fedora: python-sphinx (will pull in: python2-sphinx_rtd_theme)
Packit Service 5956c7
	CentOS-and-friends: python-sphinx epel-release python-sphinx_rtd_theme
Packit Service 5956c7
   For latex or pdf files, the following are also needed:
Packit Service 5956c7
	Fedora: latexmk python-sphinx-latex
Packit Service 5956c7
	CentOS-and-friends: latexmk texlive texlive-titlesec texlive-framed texlive-threeparttable texlive-wrapfig texlive-multirow
Packit Service 5956c7
Packit Service 5956c7
Debian/Ubuntu
Packit Service 5956c7
-------------
Packit Service 5956c7
On Debian, install:
Packit Service 5956c7
	pkg-config
Packit Service 5956c7
On Ubuntu, install:
Packit Service 5956c7
	build-essential pkg-config, and to build from git repo automake autoconf
Packit Service 5956c7
The following libraries need to be installed:
Packit Service 5956c7
	iptables-dev libipset-dev libnfnetlink-dev libnl-3-dev libnl-genl-3-dev libssl-dev
Packit Service 5956c7
For magic file identification support:
Packit Service 5956c7
	libmagic-dev
Packit Service 5956c7
For SNMP support:
Packit Service 5956c7
	libsnmp-dev
Packit Service 5956c7
For DBUS support:
Packit Service 5956c7
	libglib2.0-dev
Packit Service 5956c7
For JSON support:
Packit Service 5956c7
	libjson-c-dev
Packit Service 5956c7
For PCRE support:
Packit Service 5956c7
	libpcre2-dev
Packit Service 5956c7
Packit Service 5956c7
For building the documentation, the following packages need to be installed:
Packit Service 5956c7
	python-sphinx python-sphinx-rtd-theme
Packit Service 5956c7
   For latex or pdf files, the following are also needed:
Packit Service 5956c7
	texlive-latex-base texlive-generic-extra texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra
Packit Service 5956c7
Packit Service 5956c7
Alpine Linux
Packit Service 5956c7
------------
Packit Service 5956c7
The following libraries need to be installed:
Packit Service 5956c7
	iptables-dev ipset-dev libnfnetlink-dev libnl3-dev musl-dev and openssl-dev or libressl-dev
Packit Service 5956c7
For magic file identification support:
Packit Service 5956c7
	TBD
Packit Service 5956c7
For SNMP support:
Packit Service 5956c7
	net-snmp-dev (requires libressl-dev and not openssl-dev)
Packit Service 5956c7
Packit Service 5956c7
For building the documentation, the following packages need to be installed:
Packit Service 5956c7
	py-sphinx py3-sphinx_rtd_theme
Packit Service 5956c7
   For latex or pdf files, you'll need texlive or similar, which is not yet
Packit Service 5956c7
   available as a distro package.
Packit Service 5956c7
Packit Service 5956c7
Packit Service 5956c7
Archlinux
Packit Service 5956c7
---------
Packit Service 5956c7
Run the following to install the required libraries:
Packit Service 5956c7
	pacman -S ipset libnfnetlink libnl1
Packit Service 5956c7
For magic file identification support:
Packit Service 5956c7
	TBD
Packit Service 5956c7
For SNMP support:
Packit Service 5956c7
	pacman -S net-snmp
Packit Service 5956c7
for PCRE support:
Packit Service 5956c7
	pcre-2 (may be installed by default)
Packit Service 5956c7
Packit Service 5956c7
For building the documentation, the following packages need to be installed:
Packit Service 5956c7
	python-sphinx python-sphinx_rtd_theme
Packit Service 5956c7
   For latex or pdf files, the following are also needed:
Packit Service 5956c7
	texlive-core texlive-bin texlive-latexextra
Packit Service 5956c7
Packit Service 5956c7
Kernel configuration requirements
Packit Service 5956c7
---------------------------------
Packit Service 5956c7
The following list is probably incomplete, and will be updated as other
Packit Service 5956c7
options become known.
Packit Service 5956c7
Packit Service 5956c7
BPF
Packit Service 5956c7
EPOLL
Packit Service 5956c7
SIGNALFD
Packit Service 5956c7
TIMERFD
Packit Service 5956c7
SYSCTL
Packit Service 5956c7
PROC_FS
Packit Service 5956c7
INET
Packit Service 5956c7
IP_MULTICAST
Packit Service 5956c7
IPV6
Packit Service 5956c7
IP_VS (unless --disable-lvs is specified)
Packit Service 5956c7
  IP_VS suboptions to match the real_server/virtual_server configuration
Packit Service 5956c7
NETFILTER_XTABLES - if strict_mode or no_accept.
Packit Service 5956c7
  NETFILTER_XT options and IP_SET
Packit Service 5956c7
IP_ADVANCED_ROUTER and various associated options if static/dynamic routes specified
Packit Service 5956c7
FIB_RULES if static or dynamic rules are specified
Packit Service 5956c7
Packit Service 5956c7
Installing from a git repo
Packit Service 5956c7
==========================
Packit Service 5956c7
To install from a git repo, execute:
Packit Service 5956c7
  1. Ensure you have autoconf and automake installed
Packit Service 5956c7
  2. git clone http://github.com/acassen/keepalived
Packit Service 5956c7
  3. cd keepalived
Packit Service 5956c7
  4. ./build_setup	# generate the autoconf and automake environment
Packit Service 5956c7
  5. Follow the instructions below for Installation, omitting the first two steps.
Packit Service 5956c7
Packit Service 5956c7
Installation
Packit Service 5956c7
============
Packit Service 5956c7
Packit Service 5956c7
  1. tar -xf TARFILE
Packit Service 5956c7
  2. cd into the directory
Packit Service 5956c7
  3. './configure'
Packit Service 5956c7
  4. 'make'
Packit Service 5956c7
  5. 'make install'. This will install keepalived on your system,
Packit Service 5956c7
     binaries and configuration file :
Packit Service 5956c7
     * keepalived : The keepalived daemon program.
Packit Service 5956c7
     * genhash : The MD5 url digest generator. You need it to
Packit Service 5956c7
                 configure HTTP GET check and SSL GET check in
Packit Service 5956c7
                 order to compute MD5SUM digest etalon.
Packit Service 5956c7
     * /etc/keepalived/keepalived.conf
Packit Service 5956c7
  6. link keepalived.init into your runlevel directory. On Red Hat systems :
Packit Service 5956c7
     ln -s /etc/rc.d/init.d/keepalived.init /etc/rc.d/rc3.d/S99keepalived
Packit Service 5956c7
Packit Service 5956c7
  By default the configure script uses /usr/local as base directory. You can
Packit Service 5956c7
  change this value to your own by passing it the --prefix value.
Packit Service 5956c7
Packit Service 5956c7
  eg: './configure --prefix=/usr/'
Packit Service 5956c7
Packit Service 5956c7
Building RPM files
Packit Service 5956c7
==================
Packit Service 5956c7
Packit Service 5956c7
 If building from tarball:
Packit Service 5956c7
  1a. tar -xf TARFILE
Packit Service 5956c7
  1b. cd into the directory
Packit Service 5956c7
Packit Service 5956c7
 If building from git clone:
Packit Service 5956c7
  1. ./build_setup 
Packit Service 5956c7
Packit Service 5956c7
 For tarball and git
Packit Service 5956c7
  2. ./configure
Packit Service 5956c7
  3. make rpm
Packit Service 5956c7
Packit Service 5956c7
 The .rpm files will be created in directory `rpm --eval "%{_rpmdir}"`/ARCH
Packit Service 5956c7
Packit Service 5956c7
Modifying source code
Packit Service 5956c7
=====================
Packit Service 5956c7
Packit Service 5956c7
If you modify the source code, especially configure.ac or any Makefile.am
Packit Service 5956c7
file, you will need to regenerate the build files. Keepalived uses automake
Packit Service 5956c7
and so you will need to have automake and autoconf installed.
Packit Service 5956c7
Packit Service 5956c7
Configuration
Packit Service 5956c7
=============
Packit Service 5956c7
Packit Service 5956c7
  Just take a look at the /etc/keepalived/keepalived.conf file installed.
Packit Service 5956c7
  It will give you all the information needed. Alternativley, run
Packit Service 5956c7
  'man keepalived.conf' or look at doc/keepalived.conf.SYNOPSIS.
Packit Service 5956c7
  If you want more information about keepalived, please refer to the
Packit Service 5956c7
  keepalived homepage into the documentation section.
Packit Service 5956c7
Packit Service 5956c7
  http://www.keepalived.org
Packit Service 5956c7
Packit Service 5956c7
Packit Service 5956c7
Creating a docker container
Packit Service 5956c7
===========================
Packit Service 5956c7
There is a very useful github project maintained by osixia for building a
Packit Service 5956c7
docker container with keepalived.
Packit Service 5956c7
Packit Service 5956c7
To use, run the following:
Packit Service 5956c7
git clone https://github.com/osixia/docker-keepalived.git
Packit Service 5956c7
cd docker-keepalived
Packit Service 5956c7
make build
Packit Service 5956c7
docker run --name keepalived --cap-add=NET_ADMIN --net=host \
Packit Service 5956c7
  --env KEEPALIVED_INTERFACE=eth0 -d osixia/keepalived:1.3.5 \
Packit Service 5956c7
	# or whatever version of keepalived you have
Packit Service 5956c7
Packit Service 5956c7
To update the keepalived source code, put a new tarball in the image
Packit Service 5956c7
directory (the Dockerfile may need updating with a new version).
Packit Service 5956c7
Packit Service 5956c7
Useful docker commands are:
Packit Service 5956c7
docker logs keepalvied 2>&1 | lessa	# view system logs of container
Packit Service 5956c7
docker exec it keepalived bash		# execute shell in container
Packit Service 5956c7
docker rm -f keepalived			# Remove the container
Packit Service 5956c7
Packit Service 5956c7
keepalived is unable to load the ip_tables, ip6_tables, xt_set and ip_vs
Packit Service 5956c7
modules from within the container, so ensure they are already loaded in
Packit Service 5956c7
the host system.
Packit Service 5956c7
Packit Service 5956c7
To generate a core file in the root filesystem of the container,
Packit Service 5956c7
/proc/sys/kernel/core_pattern needs to be updated in the host system,
Packit Service 5956c7
and not from the container (or in other words the -M option to keepalived
Packit Service 5956c7
does not work within a container. Installing gdb in the container (edit
Packit Service 5956c7
the image/Dockerfile to add it before make build) may be helpful if you
Packit Service 5956c7
need to examine core files in the container.
Packit Service 5956c7
Packit Service 5956c7
Packit Service 5956c7
Packit Service 5956c7
Have fun with it !
Packit Service 5956c7
Packit Service 5956c7
Alexandre, <acassen@linux-vs.org>