[Kea-users] 1.3.0 beta not working with mysql

Bill Pye bill.pye at phoenix-systems.co.uk
Mon Oct 9 19:23:59 UTC 2017


Hi Rasmus

Thanks for that info, I'm currently using MariaDB 10.2.9 and I'll try again tomorrow with the standard version of mariadb the same as yours and see how I get on with that.


Regards


Bill

----- Original Message -----
> From: "Rasmus Edgar" <regj at arch-ed.dk>
> To: "bill pye" <bill.pye at phoenix-systems.co.uk>
> Cc: "kea-users" <kea-users at lists.isc.org>
> Sent: Monday, 9 October, 2017 20:54:47
> Subject: Re: [Kea-users] 1.3.0 beta not working with mysql

> Hi,
> 
> I just tested kea-1.3.0-beta kea-dhcp4 with my supplied srpm on CentOS
> 7.4 running mariadb 5.5.56 on the same host and using it as lease
> storage for dhcp4.
> 
> It works.
> 
> [root at rpmbuild-1 ~]# tail /var/log/kea-dhcp4.log
> 2017-10-09 20:19:00.802 INFO  [kea-dhcp4.dhcp4/3870] DHCP4_STARTED Kea
> DHCPv4 server version 1.3.0-beta started
> 2017-10-09 20:19:27.429 INFO  [kea-dhcp4.dhcp4/3870] DHCP4_SHUTDOWN
> server shutdown
> 2017-10-09 20:33:20.052 INFO  [kea-dhcp4.dhcp4/1834] DHCP4_STARTED Kea
> DHCPv4 server version 1.3.0-beta started
> 2017-10-09 20:33:21.483 INFO  [kea-dhcp4.leases/1834] DHCP4_LEASE_ADVERT
> [hwtype=1 08:00:27:f6:62:cb],
> cid=[ff:27:f6:62:cb:00:01:00:01:21:6e:7a:ad:08:00:27:f6:62:cb],
> tid=0xb90df951: lease 192.0.2.3 will be advertised
> 2017-10-09 20:33:21.490 INFO  [kea-dhcp4.leases/1834] DHCP4_LEASE_ALLOC
> [hwtype=1 08:00:27:f6:62:cb],
> cid=[ff:27:f6:62:cb:00:01:00:01:21:6e:7a:ad:08:00:27:f6:62:cb],
> tid=0xb90df951: lease 192.0.2.3 has been allocated
> 2017-10-09 20:33:59.078 INFO  [kea-dhcp4.leases/1834] DHCP4_LEASE_ADVERT
> [hwtype=1 08:00:27:f6:62:cb],
> cid=[ff:27:f6:62:cb:00:01:00:01:1e:59:e5:3c:08:00:27:f6:62:cb],
> tid=0xc09f4c43: lease 192.0.2.4 will be advertised
> 2017-10-09 20:33:59.080 INFO  [kea-dhcp4.leases/1834] DHCP4_LEASE_ALLOC
> [hwtype=1 08:00:27:f6:62:cb],
> cid=[ff:27:f6:62:cb:00:01:00:01:1e:59:e5:3c:08:00:27:f6:62:cb],
> tid=0xc09f4c43: lease 192.0.2.4 has been allocated
> 2017-10-09 20:43:20.372 INFO  [kea-dhcp4.dhcp4/1834] DHCP4_SHUTDOWN
> server shutdown
> 
> MariaDB [kea_leases]> select * from lease4;
> +------------+--------+---------------------+----------------+---------------------+-----------+----------+----------+----------+-------+
>| address    | hwaddr | client_id           | valid_lifetime | expire
>           | subnet_id | fqdn_fwd | fqdn_rev | hostname | state |
> +------------+--------+---------------------+----------------+---------------------+-----------+----------+----------+----------+-------+
>| 3221225987 | 'öbË   | ÿ'öbË  !n 'öbË       |           3600 |
> 2017-10-09 21:33:21 |         1 |        0 |        0 |          |     0
>|
>| 3221225988 | 'öbË   | ÿ'öbË  Yå 'öbË       |           3600 |
> 2017-10-09 21:33:59 |         1 |        0 |        0 |          |     0
>|
> +------------+--------+---------------------+----------------+---------------------+-----------+----------+----------+----------+-------+
> 2 rows in set (0.00 sec)
> 
> When creating the database tables I followed the guide here:
> http://kea.isc.org/docs/kea-guide.html#idp52513808
> 
> The kea.conf (which is the standard one adjusted and no comments) is
> pasted below:
> {
> 
> "Dhcp4": {
>     "interfaces-config": {
>         "interfaces": [ "enp0s8" ]
> 
>     },
> 
>     "control-socket": {
>         "socket-type": "unix",
>         "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
>     },
> 
>     "lease-database": {
>         "type": "mysql",
>         "user": "kea_user",
>         "password": "gaffel",
>         "name": "kea_leases"
>     },
> 
> 
>     "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
>     },
> 
>     "renew-timer": 900,
>     "rebind-timer": 1800,
>     "valid-lifetime": 3600,
> 
> 
>     "option-data": [
>         {
>             "name": "domain-name-servers",
>             "data": "192.0.2.1, 192.0.2.2"
>         },
> 
>         {
>             "code": 15,
>             "data": "example.org"
>         },
> 
>         {
>             "name": "domain-search",
>             "data": "mydomain.example.com, example.com"
>         },
> 
> 
>         {
>             "name": "boot-file-name",
>             "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
>         },
> 
>         {
>             "name": "default-ip-ttl",
>             "data": "0xf0"
>         }
> 
>     ],
> 
> 
>     "client-classes": [
>         {
>             "name": "voip",
> 
>             "test": "substring(option[60].hex,0,6) == 'Aastra'",
> 
>             "next-server": "192.0.2.254",
>             "server-hostname": "hal9000",
>             "boot-file-name": "/dev/null"
> 
>         }
>     ],
> 
> 
>     "subnet4": [
>         {
>             "subnet": "192.0.2.0/24",
> 
>             "pools": [ { "pool": "192.0.2.3 - 192.0.2.200" } ],
> 
>             "option-data": [
>                 {
>                     "name": "routers",
>                     "data": "192.0.2.1"
>                 }
>             ],
> 
>             "reservations": [
> 
>                 {
>                     "hw-address": "1a:1b:1c:1d:1e:1f",
>                     "ip-address": "192.0.2.201"
>                 },
> 
>                 {
>                     "client-id": "01:11:22:33:44:55:66",
>                     "ip-address": "192.0.2.202",
>                     "hostname": "special-snowflake"
>                 },
> 
>                 {
>                     "duid": "01:02:03:04:05",
>                     "ip-address": "192.0.2.203",
>                     "option-data": [ {
>                         "name": "domain-name-servers",
>                         "data": "10.1.1.202, 10.1.1.203"
>                     } ]
>                 },
> 
>                 {
>                     "client-id": "01:12:23:34:45:56:67",
>                     "ip-address": "192.0.2.204",
>                     "option-data": [
>                         {
>                             "name": "vivso-suboptions",
>                             "data": "4491"
>                         },
>                         {
>                             "name": "tftp-servers",
>                             "space": "vendor-4491",
>                             "data": "10.1.1.202, 10.1.1.203"
>                         }
>                     ]
>                 },
>                 {
>                     "client-id": "01:0a:0b:0c:0d:0e:0f",
>                     "ip-address": "192.0.2.205",
>                     "next-server": "192.0.2.1",
>                     "server-hostname": "hal9000",
>                     "boot-file-name": "/dev/null"
>                 },
>                 {
>                     "flex-id": "'s0mEVaLue'",
>                     "ip-address": "192.0.2.206"
>                 }
>             ]
>         }
>     ]
> 
> },
> 
> "Dhcp6": {
>     "interfaces-config": {
>         "interfaces": [ ]
>     },
> 
>     "control-socket": {
>         "socket-type": "unix",
>         "socket-name": "/tmp/kea-dhcp6-ctrl.sock"
>     },
> 
>     "lease-database": {
>         "type": "memfile"
>     },
> 
> 
>     "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
>     },
> 
>     "renew-timer": 1000,
>     "rebind-timer": 2000,
>     "preferred-lifetime": 3000,
>     "valid-lifetime": 4000,
> 
>     "option-data": [
>         {
>             "name": "dns-servers",
>             "data": "2001:db8:2::45, 2001:db8:2::100"
>         },
> 
>         {
>             "code": 12,
>             "data": "2001:db8::1"
>         },
> 
> 
>         {
>             "name": "new-posix-timezone",
>             "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
>         },
> 
>         {
>             "name": "preference",
>             "data": "0xf0"
>         },
> 
>         {
>             "name": "bootfile-param",
>             "data": "root=/dev/sda2, quiet, splash"
>         }
>     ],
> 
>     "subnet6": [
>         {
>             "subnet": "2001:db8:1::/64",
> 
>             "pools": [ { "pool": "2001:db8:1::/80" } ],
> 
>             "pd-pools": [
>                 {
>                     "prefix": "2001:db8:8::",
>                     "prefix-len": 56,
>                     "delegated-len": 64
> 
>                 }
>             ],
>             "option-data": [
>                 {
>                     "name": "dns-servers",
>                     "data": "2001:db8:2::dead:beef,
> 2001:db8:2::cafe:babe"
>                 }
>             ],
> 
>             "reservations": [
>                 {
>                     "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
>                     "ip-addresses": [ "2001:db8:1::100" ]
>                 },
> 
>                 {
>                     "hw-address": "00:01:02:03:04:05",
>                     "ip-addresses": [ "2001:db8:1::101" ],
>                     "option-data": [
>                         {
>                             "name": "dns-servers",
>                             "data": "3000:1::234"
>                         },
>                         {
>                             "name": "nis-servers",
>                             "data": "3000:1::234"
>                         }],
> 
>                     "client-classes": [ "special_snowflake", "office" ]
>                 },
> 
>                 {
>                     "duid": "01:02:03:04:05:06:07:08:09:0A",
>                     "ip-addresses": [ "2001:db8:1:cafe::1" ],
>                     "prefixes": [ "2001:db8:2:abcd::/64" ],
>                     "hostname": "foo.example.com",
>                     "option-data": [
>                         {
>                             "name": "vendor-opts",
>                             "data": "4491"
>                         },
>                         {
>                             "name": "tftp-servers",
>                             "space": "vendor-4491",
>                             "data": "3000:1::234"
>                         }
>                     ]
>                 },
> 
> 
>                 {
>                     "flex-id": "'somevalue'",
>                     "ip-addresses": [ "2001:db8:1:cafe::2" ]
>                 }
>             ]
>         }
>     ]
> 
> 
> 
> 
> },
> 
> "DhcpDdns":
> {
>   "ip-address": "127.0.0.1",
>   "port": 53001,
>   "tsig-keys": [],
>   "forward-ddns" : {},
>   "reverse-ddns" : {}
> },
> 
> "Control-agent": {
>     "http-host": "127.0.0.1",
>     "http-port": 8080,
> 
>     "control-sockets": {
>         "dhcp4": {
>             "socket-type": "unix",
>             "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
>         },
>         "dhcp6": {
>             "socket-type": "unix",
>             "socket-name": "/tmp/kea-dhcp6-ctrl.sock"
>         }
>     },
> 
>     "hooks-libraries": [
>     ]
> },
> 
> "Logging":
> {
>   "loggers": [
>     {
>         "name": "kea-dhcp4",
>         "output_options": [
>             {
>                 "output": "/var/log/kea-dhcp4.log"
> 
> 
> 
>             }
>         ],
>         "severity": "INFO",
> 
>         "debuglevel": 0
>     },
>     {
>         "name": "kea-dhcp6",
>         "output_options": [
>             {
>                 "output": "/var/log/kea-dhcp6.log"
>             }
>         ],
>         "severity": "INFO",
>         "debuglevel": 0
>     },
>     {
>         "name": "kea-dhcp-ddns",
>         "output_options": [
>             {
>                 "output": "/var/log/kea-ddns.log"
>             }
>         ],
>         "severity": "INFO",
>         "debuglevel": 0
>     },
>     {
>         "name": "kea-ctrl-agent",
>         "output_options": [
>             {
>                 "output": "/var/log/kea-ctrl-agent.log"
>             }
>         ],
>         "severity": "INFO",
>         "debuglevel": 0
>     }
>   ]
> }
> }
> 
> Br,
> Rasmus
> 
> Bill Pye skrev den 2017-10-09 18:19:
>> Hi Thomas
>> 
>> I initially built them myself from a Spec file that Rasmus provided
>> and the downloaded source code, he later provided an srpm so I rebuilt
>> it with that. The original list message (and links) is this:
>> 
>> Hi Bill,
>> 
>> You're welcome. Glad to help.
>> 
>> Here's the srpms for 1.2.0 and 1.3.0-beta for those who are interested:
>> 
>> 1.2.0:
>> https://arch-ed.dk/srpms/kea-1.2.0/kea-1.2.0-1.el7.centos.src.rpm
>> 
>> 1.3.0-beta:
>> https://arch-ed.dk/srpms/kea-1.3.0-beta/kea-1.3.0-0.1.beta.el7.centos.src.rpm
>> 
>> Br,
>> 
>> Rasmus
>> 
>> Where would you like me to send my rpm files, to the list?
>> 
>> 
>> Regards
>> 
>> 
>> 
>> Bill
>> ----- Original Message -----
>>> From: "Thomas Markwalder" <tmark at isc.org>
>>> To: "bill pye" <bill.pye at phoenix-systems.co.uk>
>>> Cc: "kea-users" <kea-users at lists.isc.org>
>>> Sent: Monday, 9 October, 2017 17:40:38
>>> Subject: Re: [Kea-users] 1.3.0 beta not working with mysql
>> 
>>> Hi Bill:
>>> 
>>> I did not use RPMs, I installed from source.  Please send us your
>>> RPMs.
>>> Where did you get these RPMs?
>>> 
>>> Thanks,
>>> 
>>> Thomas
>>>   
>>> 
>>> On 10/9/17 11:18 AM, Bill Pye wrote:
>>>> Hi Thomas
>>>> 
>>>> I've built a VM Centos& server, fully updated and just the MariaDB &
>>>> epel
>>>> repositories and fully updated. Unfortunately no luck, the same
>>>> problem occurs.
>>>> Is this, by any chance, a possible problem with my build of kea?
>>>> Would you like
>>>> me to send you my RPMs or perhaps you could send me yours?
>>>> 
>>>> 
>>>> Regards
>>>> 
>>>> 
>>>> Bill
>>>> 
>>>> ----- Original Message -----
>>>>> From: "Thomas Markwalder" <tmark at isc.org>
>>>>> To: "kea-users" <kea-users at lists.isc.org>
>>>>> Sent: Monday, 9 October, 2017 14:29:37
>>>>> Subject: Re: [Kea-users] 1.3.0 beta not working with mysql
>>>>> Hi Bill:
>>>>> 
>>>>> Just following up with you.  I was able to build out a Centos 7 VM
>>>>> with
>>>>> MariaDB.  Kea builds fine, the unit tests all pass (which include
>>>>> pretty
>>>>> exhaustive testing of our supported backends).   kea-dhcp4 comes and
>>>>> happily hands out leases with lifetimes of 604800 with no apparent
>>>>> issues.   This was using the 1.3-beta code as is.   I even verified
>>>>> that
>>>>> setting the wait_timeout to 30 * 86400 seems to work fine using the
>>>>> mysql command line client.
>>>>> 
>>>>> I can't say why you saw what you did before.  Doesn't make much
>>>>> sense.
>>>>> If you see it again let us know and we'll dig further.
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Thomas Markwalder
>>>>> ISC Software Engineering
>> _______________________________________________
>> Kea-users mailing list
>> Kea-users at lists.isc.org
> > https://lists.isc.org/mailman/listinfo/kea-users


More information about the Kea-users mailing list