[Kea-users] Kea 1.4.0 HA configuration - HA not syncing
russell aspinwall
raspinwall at willows7.myzen.co.uk
Thu Jan 17 19:09:25 UTC 2019
Hi,
I need advice in respect of configuring HA on a pair of Raspberry Pi 3B+
units running Kea 1.4.0.P1-3 on Ubuntu 18.10
------------------------------keactrl.conf----------------------------
# This is a configuration file for keactrl script which controls
# the startup, shutdown, reconfiguration and gathering the status
# of the Kea's processes.
# prefix holds the location where the Kea is installed.
prefix=/usr
# Location of Kea configuration files.
kea_dhcp4_config_file=/etc/kea/kea-dhcp4.conf
kea_dhcp6_config_file=/etc/kea/kea-dhcp6.conf
kea_dhcp_ddns_config_file=/etc/kea/kea-dhcp-ddns.conf
kea_ctrl_agent_config_file=/etc/kea/kea-ctrl-agent.conf
# Location of Kea binaries.
exec_prefix=${prefix}
dhcp4_srv=${exec_prefix}/sbin/kea-dhcp4
dhcp6_srv=${exec_prefix}/sbin/kea-dhcp6
dhcp_ddns_srv=${exec_prefix}/sbin/kea-dhcp-ddns
ctrl_agent_srv=${exec_prefix}/sbin/kea-ctrl-agent
# Start DHCPv4 server?
dhcp4=yes
# Start DHCPv6 server?
dhcp6=yes
# Start DHCP DDNS server?
dhcp_ddns=yes
# Start Control Agent?
ctrl_agent=yes
# Be verbose?
kea_verbose=no
------------------------------keactrl.conf----------------------------
------------------------------kea-ctrl-agent.conf---------------------
{
// This is a basic configuration for the Kea Control Agent.
// RESTful interface to be available at http://127.0.0.1:8080/
"Control-agent": {
"http-host": "192.168.26.246",
"http-port": 8080,
// Specify location of the files to which the Control Agent
// should connect to forward commands to the DHCPv4 and DHCPv6
// server via unix domain socket.
"control-sockets": {
"dhcp4": {
"socket-type": "unix",
"socket-name": "/tmp/kea-dhcp4-ctrl.sock"
},
"dhcp6": {
"socket-type": "unix",
"socket-name": "/tmp/kea-dhcp6-ctrl.sock"
}
},
// Specify hooks libraries that are attached to the Control Agent.
// Such hooks libraries should support 'control_command_receive'
// hook point. This is currently commented out because it has to
// point to the existing hooks library. Otherwise the Control
// Agent will fail to start.
"hooks-libraries": [
{
"library":
"/usr/lib/arm-linux-gnueabihf/hooks/control-agent-commands.so",
"parameters": {
"param1": "foo"
}
},
{
"library": "/usr/lib/arm-linux-gnueabihf/hooks/libdhcp_ha.so",
"parameters" : {
"high-availability": [ {
"this-server-name": "sauron",
"mode": "load-balancing",
"send-leases-updates": true,
"sync-leases": true,
"heartbeat-delay": 10000,
"max-response-delay": 10000,
"max-ack-delay": 5000,
"max-unacked-clients": 10,
"peers": [
{
"name": "sauron",
"url":
"http://192.168.26.246:8080/",
"role": "primary",
"auto-failover": true
},
{
"name": "mordor",
"url":
"http://122.168.26.248:8080/",
"role": "secondary",
"auto-failover": true
}
]
} ]
}
}
]
},
// Logging configuration starts here. Kea uses different loggers to log
various
// activities. For details (e.g. names of loggers), see Chapter 18.
"Logging":
{
"loggers": [
{
// This specifies the logging for Control Agent daemon.
"name": "kea-ctrl-agent",
"output_options": [
{
"output": "/var/log/kea/kea-ctrl-agent.log"
// This governs whether the log output is flushed to
disk after
// every write.
// "flush": false,
// This specifies the maximum size of the file before
it is
// rotated.
// "maxsize": 1048576,
// This specifies the maximum number of rotated files
to keep.
// "maxver": 8
}
],
// This specifies the severity of log messages to keep.
Supported values
// are: FATAL, ERROR, WARN, INFO, DEBUG
"severity": "INFO",
// If DEBUG level is specified, this value is used. 0 is least
verbose,
// 99 is most verbose. Be cautious, Kea can generate lots and lots
// of logs if told to do so.
"debuglevel": 0
}
]
}
}
------------------------------kea-ctrl-agent.conf---------------------
------------------------------kea-dhcp4.conf--------------------------
{
# DHCPv4 configuration starts here.
"Dhcp4":
{
# Add names of interfaces to listen on.
"interfaces-config": {
"interfaces": [ "eth0" ],
"dhcp-socket-type": "raw"
},
"control-sockets": {
"socket-type": "unix",
"socket-name": "/tmp/kea-dhcp4-ctrl.sock"
},
# Use Memfile lease database backend to store leases in a CSV file.
"lease-database": { "type": "memfile", "persist": true, "name":
"/var/kea/dhcp4.leases" },
"hooks-libraries": [
{
"library":
"/usr/lib/arm-linux-gnueabihf/hooks/libdhcp_lease_cmds.so",
"parameters": {}
},
{
"library": "/usr/lib/arm-linux-gnueabihf/hooks/libdhcp_ha.so",
"parameters" : {
"high-availability": [ {
"this-server-name": "sauron",
"mode": "load-balancing",
"send-leases-updates": true,
"sync-leases": true,
"heartbeat-delay": 10000,
"max-response-delay": 10000,
"max-ack-delay": 5000,
"max-unacked-clients": 10,
"peers": [
{
"name": "sauron",
"url":
"http://192.168.26.246:8080/",
"role": "primary",
"auto-failover": true
},
{
"name": "mordor",
"url":
"http://192.168.26.248:8080/",
"role": "secondary",
"auto-failover": true
}
]
} ],
"service": [ "dhcp4" ],
"arguments": { "server-name": "mordor",
"max-period": 600 },
"command": "ha-sync"
}
}
],
# Configure Global DHCP Options
"option-data": [
{
"name": "domain-name",
"data": "pi-net.corp"
},
{
"name": "domain-name-servers",
"data": "192.168.26.246, 192.168.26.247, 192.168.26.248,
192.168.26.249"
},
{
"name": "ntp-servers",
"data": "192.168.26.246, 192.168.26.247, 192.168.26.248,
192.168.26.249"
},
{
"name": "routers",
"data": "192.168.26.10"
}
],
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
},
# Global (inherited by all subnets) lease lifetime is mandatory parameter.
"valid-lifetime": 4000,
"subnet4": [
{ "subnet": "192.168.26.0/24",
"id": 1996,
"pools": [ { "pool": "192.168.26.20 - 192.168.26.29" } ],
"reservations": [
{
"hw-address": "00:00:00:00:00:00",
"ip-address": "192.168.26.124"
}
]
}
]
},
# Logging configuration starts here. It tells Kea servers to store
# all log messages (on severity INFO or more) in a file.
# debuglevel variable is used on DEBUG level only.
"Logging":
{
"loggers": [ {
"name": "kea-dhcp4",
"output_options": [ { "output": "/var/log/kea/kea-dhcp4.log" } ],
"severity": "INFO",
"debuglevel": 0
} ]
}
}
------------------------------kea-dhcp4.conf--------------------------
------------------------------kea-dhcp6.conf--------------------------
{
# DHCPv6 configuration starts here.
"Dhcp6":
{
# Add names of interfaces to listen on.
"interfaces-config": {
"interfaces": [ "eth0" ]
},
"control-sockets": {
"dhcp6": {
"socket-type": "unix",
"socket-name": "/tmp/kea-dhcp6-ctrl.sock"
}
},
# "mac-sources": [ "duid" ],
# Use Memfile lease database backend to store leases in a CSV file.
"lease-database": {
"type": "memfile",
"persist": true,
"name": "/var/kea/dhcp6.leases"
},
# Configure Global DHCP Options
"option-data": [
{
"name": "dns-servers",
"code": 23,
"space": "dhcp6",
"csv-format": true,
"data": "fd22:d18a:1556:1:9123:9736:2151:6722,
fd22:f3476:584a:f:921d:b11b:1a66:41a6"
},
{
"name": "sntp-servers",
"data": "fd22:f3476:584a:f:9123:9736:2151:6722,
fd22:f3476:584a:f:921d:b11b:1a66:41a6"
}
],
# Setup reclamation of the expired leases and leases affinity.
# Expired leases will be reclaimed every 10 seconds. Every 25
# seconds reclaimed leases, which have expired more than 3600
# seconds ago, will be removed. The limits for leases reclamation
# are 100 leases or 250 ms for a single cycle. A warning message
# will be logged if there are still expired leases in the
# database after 5 consecutive reclamation cycles.
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
},
# Addresses will be assigned with preferred and valid lifetimes
# being 3000 and 4000, respectively. Client is told to start
# renewing after 1000 seconds. If the server does not respond
# after 2000 seconds since the lease was granted, client is supposed
# to start REBIND procedure (emergency renewal that allows switching
# to a different server).
"preferred-lifetime": 3000,
"valid-lifetime": 4000,
"renew-timer": 1000,
"rebind-timer": 2000,
"subnet6": [
{ "subnet": "fd22:f3476:584a:f::/64",
"id": 2011,
"pools": [ { "pool": "fd22:f3476:584a:f::/64" } ]
}
]
},
# Logging configuration starts here. It tells Kea servers to store
# all log messages (on severity INFO or more) in a file.
# debuglevel variable is used on DEBUG level only.
"Logging":
{
"loggers": [
{
"name": "kea-dhcp6",
"output_options": [
{
"output": "/var/log/kea/kea-dhcp6.log"
}
],
# "severity": "INFO",
"severity": "DEBUG",
"debuglevel": 7
}
]
}
}
------------------------------kea-dhcp6.conf--------------------------
I can not get the HA pair to sync.
TIA
russell
More information about the Kea-users
mailing list