Read the manual!
The keepalived
User Guide has had instructions for doing this since 2001. Follow them. The User Guide is considered out of date, but in fact only part 2 of the instructions are outdated. Part 1 (./configure && make && make install
as the superuser) is still valid.
Part 2 is outdated because it addresses an old System 5 rc
way of creating a keepalived
dæmon service, and that for Fedora-style System 5 rc
no less. You're using Ubuntu Linux. You've had upstart for years and you have systemd nowadays.
systemd
For systemd, write your own local service unit and place it (because it is a non-system non-packaged local-administrator unit) in /etc/systemd/system/keepalived.service
. Here's one of mine, incorporating two bugfixes:
#
# keepalived control files for systemd
#
# Incorporates fixes from RedHat bug #769726.
[Unit]
Description=LVS and VRRP High Availability monitor
After=network.target
ConditionFileNotEmpty=/etc/keepalived/keepalived.conf
[Service]
Type=simple
# Ubuntu/Debian convention:
EnvironmentFile=-/etc/default/keepalived
ExecStart=/usr/sbin/keepalived --dont-fork
ExecReload=/bin/kill -s HUP $MAINPID
# keepalived needs to be in charge of killing its own children.
KillMode=process
[Install]
WantedBy=multi-user.target
You'll have to adjust this unit for the fact that you've installed into /usr/local
rather than /usr
. After that, the normal systemd controls apply:
systemctl preset keepalived.service
to have the service automatically start at bootstrap.
systemctl start keepalived.service
to start the service manually.
systemctl status keepalived.service
to view the service status.
And so forth.
upstart
Your package hasn't come with an upstart job file. Having never had need of keepalived
under upstart myself, this is just a skeleton /etc/init/keepalived.conf
that you will have to work on.
description "LVS and VRRP High Availability monitor"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /usr/sbin/keepalived --dont-fork
Further reading
./configure
does not make a binary. Did you runmake
after you ran configure?make && make install
the binary usually goes into/usr/local/bin/keepalived
Is this the case? Update your answer and add some more details of what's failing./usr/local/bin/keepalived
and i thought I have installed the keepalived using the ./configure but it doesnt workkeepalived --help
tell you something?