Kea guide documentation correction needed
Here is my setup for DB in **kea-dhcp4.conf ** Case : I have kea server running with below DB config but when my DB crashes[Manually i stopped db for test]. Kea log shows DB connection error and it started retrying for 50 tries as i configured but when i DB crash recover [Manually i started db]. kea unable to connect with DB still showing below mentioned error messages and not assigning lease to client !
}]
}],
"lease-database": {
"type": "mysql",
"name": "kea",
"user": "root",
"password": "",
"host": "10.25.133.13",
"port": 3306,
"max-reconnect-tries" : 50,
"reconnect-wait-time": 2000,
"connect-timeout": 5000,
"request-timeout": 12000,
"tcp-keepalive": 1,
"tcp-nodelay": true
},
"hosts-database": {
"type": "mysql",
"name": "kea",
"user": "root",
"password": "",
"host": "10.25.133.13",
"port": 3306,
"max-reconnect-tries" : 50,
"reconnect-wait-time": 2000,
"connect-timeout": 5000,
"request-timeout": 12000,
"tcp-keepalive": 1,
"tcp-nodelay": true
},
Once kea started with DB Log output : [1st start ]
DHCPSRV_MYSQL_DB opening MySQL lease database: connect-timeout=5000 host=10.25.133.13 **max-reconnect-tries=50 name=kea port=3306 reconnect-wait-time=2000 request-timeout=12000 tcp-keepalive=1 tcp-nodelay=true type=mysql universe=4 user=root**
2018-10-16 23:26:47.385 INFO [kea-dhcp4.hosts/12919] DHCPSRV_MYSQL_HOST_DB opening MySQL hosts database: connect-timeout=5000 host=10.25.133.13 max-reconnect-tries=50 name=kea port=3306 reconnect-wait-time=2000 request-timeout=12000 tcp-keepalive=1 tcp-nodelay=true type=mysql universe=4 user=root
2018-10-16 23:26:47.398 INFO [kea-dhcp4.ha-hooks/12919] HA_LOCAL_DHCP_DISABLE local DHCP service is disabled while the is in the WAITING state
2018-10-16 23:26:47.398 INFO [kea-dhcp4.ha-hooks/12919] HA_SERVICE_STARTED started high availability service in load-balancing mode as primary server
2018-10-16 23:26:47.399 INFO [kea-dhcp4.dhcp4/12919] DHCP4_STARTED Kea DHCPv4 server version 1.4.0 started
**Once DB crashed log output : [DB stopped ] **
ERROR [kea-dhcp4.dhcpsrv/12919] DHCPSRV_MYSQL_FATAL_ERROR Unrecoverable MySQL error occurred: unable to execute for <SELECT address, hwaddr, client_id, valid_lifetime, expire, subnet_id, fqdn_fwd, fqdn_rev, hostname, state FROM lease4 WHERE state != ? AND expire < ? ORDER BY expire ASC LIMIT ?>, reason: MySQL server has gone away (error code: 2006).
2018-10-16 23:33:49.235 INFO [kea-dhcp4.dhcpsrv/12919] DHCPSRV_MYSQL_DB opening MySQL lease database: connect-timeout=5000 host=10.25.133.13** max-reconnect-tries=50 name=kea port=3306 reconnect-wait-time=2000 request-timeout=12000 tcp-keepalive=1 tcp-nodelay=true type=mysql universe=4 user=root**
2018-10-16 23:33:49.236 ERROR [kea-dhcp4.dhcp4/12919] DHCP4_DB_RECONNECT_ATTEMPT_FAILED database reconnect failed: Can't connect to MySQL server on '10.25.133.13' (111)
2018-10-16 23:33:49.236 INFO [kea-dhcp4.dhcp4/12919] DHCP4_DB_RECONNECT_ATTEMPT_SCHEDULE** scheduling attempt 2 of 50 in 2000 seconds**
2018-10-16 23:33:49.236 ERROR [kea-dhcp4.dhcpsrv/12919] DHCPSRV_TIMERMGR_CALLBACK_FAILED running handler for timer reclaim-expired-leases caused exception: fatal database errror or connectivity lost
2018-10-16 23:33:53.240 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
**Once DB recovered log output : [DB up and running ] Still kea not connecting with db **
2018-10-16 23:35:33.359 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
2018-10-16 23:35:58.390 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
2018-10-16 23:36:23.419 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
2018-10-16 23:36:48.449 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
2018-10-16 23:37:13.479 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
2018-10-16 23:37:38.499 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
2018-10-16 23:38:03.528 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
2018-10-16 23:38:28.557 ERROR [kea-dhcp4.alloc-engine/12919] ALLOC_ENGINE_V4_RECLAIMED_LEASES_DELETE_FAILED deletion of expired-reclaimed leases failed: no current lease manager is available
I believe Kea should automatically connect with lease DB once DB came UP/running ! Is something am missing on conf or bug ?
Edited by Ghost User