Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
d41571ce
Commit
d41571ce
authored
Mar 30, 2022
by
Razvan Becheriu
Browse files
[
#2116
] remove cql code
parent
c8060d70
Changes
171
Hide whitespace changes
Inline
Side-by-side
.clang-format
View file @
d41571ce
...
...
@@ -50,7 +50,7 @@ IncludeCategories:
- Regex: '^<config.h>$'
Priority: 0
# Kea's own files
- Regex: '^<(asiodns|asiolink|cc|cfgrpt|config|config_backend|
cql|
cryptolink|database|dhcp|dhcpsrv|dhcp_ddns|dns|eval|exceptions|hooks|http|log|mysql|pgsql|process|stats|testutils|util|yang|admin|agent|d2|dhcp4|dhcp6|keactrl|lfc|netconf|perfdhcp|shell)/'
- Regex: '^<(asiodns|asiolink|cc|cfgrpt|config|config_backend|cryptolink|database|dhcp|dhcpsrv|dhcp_ddns|dns|eval|exceptions|hooks|http|log|mysql|pgsql|process|stats|testutils|util|yang|admin|agent|d2|dhcp4|dhcp6|keactrl|lfc|netconf|perfdhcp|shell)/'
Priority: 1
# C++ standard library headers
- Regex: '^<[[:alnum:]]>$'
...
...
.gitlab-ci.yml
View file @
d41571ce
...
...
@@ -31,7 +31,6 @@ shellcheck:
-
SCRIPTS+="src/bin/admin/admin-utils.sh "
-
SCRIPTS+="src/bin/admin/kea-admin.in "
-
SCRIPTS+="src/bin/admin/tests/admin_tests.sh.in "
-
SCRIPTS+="src/bin/admin/tests/cql_tests.sh.in "
-
SCRIPTS+="src/bin/admin/tests/memfile_tests.sh.in "
-
SCRIPTS+="src/bin/admin/tests/mysql_tests.sh.in "
-
SCRIPTS+="src/bin/admin/tests/pgsql_tests.sh.in "
...
...
@@ -56,11 +55,6 @@ shellcheck:
-
SCRIPTS+="src/lib/testutils/dhcp_test_lib.sh.in "
-
SCRIPTS+="src/lib/testutils/xml_reporting_test_lib.sh.in "
-
SCRIPTS+="src/hooks/dhcp/run_script/tests/run_script_test.sh.in "
-
SCRIPTS+="src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh.in "
-
SCRIPTS+="src/share/database/scripts/cql/upgrade_2.0_to_3.0.sh.in "
-
SCRIPTS+="src/share/database/scripts/cql/upgrade_3.0_to_4.0.sh.in "
-
SCRIPTS+="src/share/database/scripts/cql/upgrade_4.0_to_5.0.sh.in "
-
SCRIPTS+="src/share/database/scripts/cql/wipe_data.sh.in "
-
SCRIPTS+="src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in "
-
SCRIPTS+="src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in "
-
SCRIPTS+="src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in "
...
...
@@ -104,7 +98,6 @@ shellcheck:
-
SCRIPTS+="tools/add-config-h.sh "
-
SCRIPTS+="tools/bump-lib-versions.sh "
-
SCRIPTS+="tools/check-for-duplicate-includes.sh "
-
SCRIPTS+="tools/cql_config "
-
SCRIPTS+="tools/mk_cfgrpt.sh "
-
SCRIPTS+="tools/path_replacer.sh.in "
-
SCRIPTS+="tools/print-generated-files.sh "
...
...
CONTRIBUTING.md
View file @
d41571ce
...
...
@@ -175,9 +175,9 @@ such long periods, code tends to be refactored several times. The change you mad
some other change or by the code that hasn't been written yet.
See Building Kea with Unit Tests for instructions on how to run unit-tests. If you happen to touch
any database related code, make sure you compile your code with –with-mysql
,
–with-pgsql a
nd/or
–with-cql as
needed. For example, if you change something substantial, make sure the other
compilation options
still work.
any database related code, make sure you compile your code with –with-mysql
and/or
–with-pgsql a
s
needed. For example, if you change something substantial, make sure the other
compilation options
still work.
If you happen to add new files or have modified any Makefile.am files, it is also a good idea to
check if you haven't broken the distribution process:
...
...
@@ -192,8 +192,8 @@ enable various additional consistency checks that reduce performance but help du
you happen to modify anything in the documentation, use
`–-enable-generate-docs`
. If you are
modifying DHCP code, you are likely to be interested in enabling a non-default database backends for
DHCP. Note that if the backend is not enabled, the database-specific unit-tests are skipped. To
enable the MySQL backend, use the switch
`–with-mysql`
; for PostgreSQL, use
`–with-pgsql`
and for
Cassandra use
`--with-cql`
.
A complete list of all switches can be obtained with the command:
enable the MySQL backend, use the switch
`–with-mysql`
; for PostgreSQL, use
`–with-pgsql`
.
A complete list of all switches can be obtained with the command:
```
bash
./configure
--help
...
...
configure.ac
View file @
d41571ce
...
...
@@ -824,76 +824,16 @@ if test "${pgsql_ssl}" = "yes"; then
AC_DEFINE([HAVE_PGSQL_SSL], [1], [PostgreSQL was built with OpenSSL support])
fi
# allow building kea programs with static link to cassandra cpp-driver.
AC_ARG_ENABLE([cql-static-lib],
[AS_HELP_STRING([--enable-cql-static-lib],
[build programs with cassandra cpp driver static library [[default=no]]])],
[enable_cql_static_lib=yes], [enable_cql_static_lib=no])
AM_CONDITIONAL(USE_CQL_STATIC_LIB, test "$enable_cql_static_lib" = yes)
#AC_DEFINE USE_CQL_STATIC_LIB? (unused)
cql_lib="cassandra"
if test "${enable_cql_static_lib}" = "yes" ; then
cql_lib="${cql_lib}_static"
fi
cql_config="no"
AC_ARG_WITH([cql],
[AS_HELP_STRING([--with-cql[[=PATH]]],
[path to pkg-config or the Cassandra CQL 'cql_config' script (deprecated)])],
[cql_config="$withval"])
if test "${cql_config}" = "yes" ; then
CQL_CONFIG="$PKG_CONFIG"
elif test "${cql_config}" != "no" ; then
CQL_CONFIG="${cql_config}"
if test "${cql_config}" != "no" ; then
AC_MSG_ERROR([$CQL_CONFIG CAssandra is no longer supported])
fi
if test "$CQL_CONFIG" != "" ; then
if test -d "$CQL_CONFIG" -o ! -x "$CQL_CONFIG" ; then
AC_MSG_ERROR([--with-cql should point to a pkg-config or cql_config program])
fi
$CQL_CONFIG --print-errors $cql_lib
if test $? -ne 0; then
AC_MSG_ERROR([$CQL_CONFIG $cql_lib failed])
fi
CQL_INCLUDEDIR=`$CQL_CONFIG --cflags-only-I $cql_lib`
CQL_CPPFLAGS=`$CQL_CONFIG --cflags-only-other $cql_lib`
CQL_LIBS=`$CQL_CONFIG --libs $cql_lib`
CQL_LIBS="$CQL_LIBS $CRYPTO_LIBS"
CQL_VERSION=`$CQL_CONFIG --modversion $cql_lib`
CQL_CPPFLAGS="${CQL_CPPFLAGS} ${CQL_INCLUDEDIR}"
AC_SUBST(CQL_CPPFLAGS)
AC_SUBST(CQL_LIBS)
# Check that a simple program using CQL functions can compile and link.
CPPFLAGS_SAVED="$CPPFLAGS"
LIBS_SAVED="$LIBS"
CPPFLAGS="$CQL_CPPFLAGS $CPPFLAGS"
LIBS="$CQL_LIBS $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <cassandra.h>],
[CassCluster* cluster = cass_cluster_new();
cass_cluster_free(cluster);])],
[AC_MSG_RESULT([checking for Cassandra CQL headers and library... yes])],
[AC_MSG_RESULT([checking for Cassandra CQL headers and library... no])
AC_MSG_ERROR([Needs Cassandra CQL library])]
)
CPPFLAGS=$CPPFLAGS_SAVED
LIBS=$LIBS_SAVED
# Note that CQL is present in the config.h file
AC_DEFINE([HAVE_CQL], [1], [CQL is present])
fi
# ... and at the shell level, so Makefile.am can take action depending on this.
AM_CONDITIONAL(HAVE_CQL, test "$CQL_CONFIG" != "")
# Check for sysrepo.
AX_SYSREPO
...
...
@@ -1554,8 +1494,6 @@ AC_CONFIG_FILES([src/bin/admin/Makefile])
AC_CONFIG_FILES([src/bin/admin/kea-admin],
[chmod +x src/bin/admin/kea-admin])
AC_CONFIG_FILES([src/bin/admin/tests/Makefile])
AC_CONFIG_FILES([src/bin/admin/tests/cql_tests.sh],
[chmod +x src/bin/admin/tests/cql_tests.sh])
AC_CONFIG_FILES([src/bin/admin/tests/data/Makefile])
AC_CONFIG_FILES([src/bin/admin/tests/admin_tests.sh],
[chmod +x src/bin/admin/tests/admin_tests.sh])
...
...
@@ -1726,9 +1664,6 @@ AC_CONFIG_FILES([src/lib/mysql/tests/Makefile])
AC_CONFIG_FILES([src/lib/pgsql/Makefile])
AC_CONFIG_FILES([src/lib/pgsql/tests/Makefile])
AC_CONFIG_FILES([src/lib/pgsql/testutils/Makefile])
AC_CONFIG_FILES([src/lib/cql/Makefile])
AC_CONFIG_FILES([src/lib/cql/tests/Makefile])
AC_CONFIG_FILES([src/lib/cql/testutils/Makefile])
AC_CONFIG_FILES([src/lib/process/Makefile])
AC_CONFIG_FILES([src/lib/process/tests/Makefile])
AC_CONFIG_FILES([src/lib/process/testutils/Makefile])
...
...
@@ -1755,17 +1690,6 @@ AC_CONFIG_FILES([src/share/Makefile])
AC_CONFIG_FILES([src/share/api/Makefile])
AC_CONFIG_FILES([src/share/database/Makefile])
AC_CONFIG_FILES([src/share/database/scripts/Makefile])
AC_CONFIG_FILES([src/share/database/scripts/cql/Makefile])
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh],
[chmod +x src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh])
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_2.0_to_3.0.sh],
[chmod +x src/share/database/scripts/cql/upgrade_2.0_to_3.0.sh])
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_3.0_to_4.0.sh],
[chmod +x src/share/database/scripts/cql/upgrade_3.0_to_4.0.sh])
AC_CONFIG_FILES([src/share/database/scripts/cql/upgrade_4.0_to_5.0.sh],
[chmod +x src/share/database/scripts/cql/upgrade_4.0_to_5.0.sh])
AC_CONFIG_FILES([src/share/database/scripts/cql/wipe_data.sh],
[chmod +x src/share/database/scripts/cql/wipe_data.sh])
AC_CONFIG_FILES([src/share/database/scripts/mysql/Makefile])
AC_CONFIG_FILES([src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh],
[chmod +x src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh])
...
...
@@ -2022,22 +1946,6 @@ PostgreSQL:
END
fi
if test "$CQL_CPPFLAGS" != "" ; then
cat >> config.report << END
Cassandra CQL (deprecated):
CQL_VERSION: ${CQL_VERSION}
CQL_CPPFLAGS: ${CQL_CPPFLAGS}
CQL_LIBS: ${CQL_LIBS}
END
else
cat >> config.report << END
Cassandra CQL:
no
END
fi
if "${HAVE_SYSREPO}"; then
cat >> config.report << END
...
...
doc/Makefile.am
View file @
d41571ce
...
...
@@ -19,7 +19,6 @@ nobase_dist_doc_DATA += examples/kea4/all-keys.json
nobase_dist_doc_DATA
+=
examples/kea4/all-keys-netconf.json
nobase_dist_doc_DATA
+=
examples/kea4/all-options.json
nobase_dist_doc_DATA
+=
examples/kea4/backends.json
nobase_dist_doc_DATA
+=
examples/kea4/cassandra.json
nobase_dist_doc_DATA
+=
examples/kea4/classify.json
nobase_dist_doc_DATA
+=
examples/kea4/classify2.json
nobase_dist_doc_DATA
+=
examples/kea4/comments.json
...
...
@@ -45,7 +44,6 @@ nobase_dist_doc_DATA += examples/kea6/all-keys.json
nobase_dist_doc_DATA
+=
examples/kea6/all-keys-netconf.json
nobase_dist_doc_DATA
+=
examples/kea6/all-options.json
nobase_dist_doc_DATA
+=
examples/kea6/backends.json
nobase_dist_doc_DATA
+=
examples/kea6/cassandra.json
nobase_dist_doc_DATA
+=
examples/kea6/classify.json
nobase_dist_doc_DATA
+=
examples/kea6/classify2.json
nobase_dist_doc_DATA
+=
examples/kea6/comments.json
...
...
doc/devel/Doxyfile
View file @
d41571ce
...
...
@@ -873,7 +873,6 @@ INPUT = ../../src/bin/agent \
../../src/lib/cfgrpt \
../../src/lib/config \
../../src/lib/config_backend \
../../src/lib/cql \
../../src/lib/cryptolink \
../../src/lib/d2srv \
../../src/lib/database \
...
...
doc/devel/cross-compile.dox
View file @
d41571ce
...
...
@@ -102,7 +102,6 @@ a native (i.e. not cross-compiled) Kea build.
Required and optional Kea dependencies, usually available as packages:
- Python (built-in)
- Cassandra (skipped here)
- libssl-dev (built-in in the full image)
- liblog4cplus-dev (in liblog4cplus package, load both the library and
the development part)
...
...
doc/devel/unit-tests.dox
View file @
d41571ce
...
...
@@ -389,29 +389,6 @@ local all postgres trust
section in the <a href="https://kea.readthedocs.io">Kea Administrator
Reference Manual</a>).
@subsection cqlUnitTestsPrerequisites Cassandra database
@todo: Describe steps necessary to set up Cassandra database suitable
for running unittests.
It seems this was enough:
-# Launch cassandra if not running (-f for foreground)
@verbatim
% cassandra -f
@endverbatim
The tool is cqlsh:
-# Run the tool
@verbatim
% cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> @endverbatim\n
@section unitTestsKerberos Kerberos Configuration for Unit Tests
The GSS-TSIG hook library uses the GSS-API with Kerberos. While there are
...
...
doc/examples/kea4/advanced.json
View file @
d41571ce
...
...
@@ -74,7 +74,7 @@
//
We
need
to
specify
the
database
used
to
store
leases.
As
of
//
September
2016
,
four
database
backends
are
supported:
MySQL
,
//
PostgreSQL
,
Cassandra
,
and
the
in-memory
database
,
Memfile.
//
PostgreSQL
and
the
in-memory
database
,
Memfile.
//
We'll
use
memfile
because
it
doesn't
require
any
prior
set
up.
//
For
memfile
,
it's
important
to
always
specify
lfc-interval
,
so
//
the
lease
file
would
not
grow
without
bounds
and
be
sanitized
...
...
doc/examples/kea4/all-keys-netconf.json
View file @
d41571ce
...
...
@@ -309,7 +309,7 @@
//
Port
on
which
the
database
is
available.
"port"
:
3306
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"mysql"
,
//
User
name
to
be
used
to
access
the
database.
...
...
@@ -331,41 +331,25 @@
//
Port
on
which
the
database
is
available.
"port"
:
5432
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"postgresql"
,
//
User
name
to
be
used
to
access
the
database.
"user"
:
"kea"
},
{
//
Name
of
the
database
to
connect
to.
"keyspace"
:
"kea"
,
//
Host
on
which
the
database
resides.
"contact-points"
:
"127.0.0.1"
,
//
Database
password.
"password"
:
"kea"
,
//
Port
on
which
the
database
is
available.
"port"
:
9042
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
"type"
:
"
c
ql"
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"
mys
ql"
,
//
User
name
to
be
used
to
access
the
database.
"user"
:
"kea"
,
//
Consistency
level
for
all
queries.
//
Supported
values:
any
,
one
,
two
,
three
,
quorum
,
all
,
//
local-quorum
,
each-quorum
,
serial
,
local-serial
,
local-one.
"consistency"
:
"quorum"
,
//
Serial
consistency
level
for
all
queries.
//
Supported
values:
any
,
one
,
two
,
three
,
quorum
,
all
,
//
local-quorum
,
each-quorum
,
serial
,
local-serial
,
local-one.
"serial-consistency"
:
"serial"
,
//
Connection
reconnect
wait
time.
//
This
parameter
governs
how
long
Kea
waits
before
attempting
//
to
reconnect.
Expressed
in
milliseconds.
The
default
is
2000
[
ms
]
...
...
@@ -381,16 +365,7 @@
"on-fail"
:
"stop-retry-exit"
,
//
Connection
connect
timeout.
"connect-timeout"
:
100
,
//
Connection
request
timeout.
"request-timeout"
:
100
,
//
Connection
tcp
keepalive.
"tcp-keepalive"
:
100
,
//
Connection
tcp
nodelay.
"tcp-nodelay"
:
true
"connect-timeout"
:
100
}
],
...
...
@@ -481,8 +456,8 @@
//
because
non
stored
leases
will
be
lost
upon
Kea
server
restart.
"persist"
:
true
,
//
Lease
database
backend
type
,
i.e.
"memfile"
,
"mysql"
,
//
"postgresql"
or
"cql"
.
//
Lease
database
backend
type
,
i.e.
"memfile"
,
"mysql"
,
or
//
"postgresql"
.
"type"
:
"memfile"
},
...
...
@@ -1023,7 +998,7 @@
//
Name
of
the
database
to
connect
to.
"name"
:
"config"
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"mysql"
}
],
...
...
doc/examples/kea4/all-keys.json
View file @
d41571ce
...
...
@@ -309,7 +309,7 @@
//
Port
on
which
the
database
is
available.
"port"
:
3306
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"mysql"
,
//
User
name
to
be
used
to
access
the
database.
...
...
@@ -345,41 +345,25 @@
//
Port
on
which
the
database
is
available.
"port"
:
5432
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"postgresql"
,
//
User
name
to
be
used
to
access
the
database.
"user"
:
"kea"
},
{
//
Name
of
the
database
to
connect
to.
"keyspace"
:
"kea"
,
//
Host
on
which
the
database
resides.
"contact-points"
:
"127.0.0.1"
,
//
Database
password.
"password"
:
"kea"
,
//
Port
on
which
the
database
is
available.
"port"
:
9042
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
"type"
:
"
c
ql"
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"
mys
ql"
,
//
User
name
to
be
used
to
access
the
database.
"user"
:
"kea"
,
//
Consistency
level
for
all
queries.
//
Supported
values:
any
,
one
,
two
,
three
,
quorum
,
all
,
//
local-quorum
,
each-quorum
,
serial
,
local-serial
,
local-one.
"consistency"
:
"quorum"
,
//
Serial
consistency
level
for
all
queries.
//
Supported
values:
any
,
one
,
two
,
three
,
quorum
,
all
,
//
local-quorum
,
each-quorum
,
serial
,
local-serial
,
local-one.
"serial-consistency"
:
"serial"
,
//
Connection
reconnect
wait
time.
//
This
parameter
governs
how
long
Kea
waits
before
attempting
//
to
reconnect.
Expressed
in
milliseconds.
The
default
is
2000
[
ms
]
...
...
@@ -395,16 +379,7 @@
"on-fail"
:
"stop-retry-exit"
,
//
Connection
connect
timeout.
"connect-timeout"
:
100
,
//
Connection
request
timeout.
"request-timeout"
:
100
,
//
Connection
tcp
keepalive.
"tcp-keepalive"
:
100
,
//
Connection
tcp
nodelay.
"tcp-nodelay"
:
true
"connect-timeout"
:
100
}
],
...
...
@@ -510,8 +485,8 @@
//
because
non
stored
leases
will
be
lost
upon
Kea
server
restart.
"persist"
:
true
,
//
Lease
database
backend
type
,
i.e.
"memfile"
,
"mysql"
,
//
"postgresql"
or
"cql"
.
//
Lease
database
backend
type
,
i.e.
"memfile"
,
"mysql"
or
//
"postgresql"
.
"type"
:
"memfile"
},
...
...
@@ -1052,7 +1027,7 @@
//
Name
of
the
database
to
connect
to.
"name"
:
"config"
,
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
,
"cql"
.
//
Type
of
the
database
,
e.g.
"mysql"
,
"postgresql"
.
"type"
:
"mysql"
}
],
...
...
doc/examples/kea4/backends.json
View file @
d41571ce
...
...
@@ -4,7 +4,6 @@
//
-
memfile
//
-
MySQL
//
-
PostgreSQL
//
-
CQL
(Cassandra)
backend
{
"Dhcp4"
:
...
...
@@ -66,21 +65,6 @@
//
"connect-timeout"
:
3
//
},
//
4
.
CQL
(Cassandra)
backend.
Leases
will
be
stored
in
Cassandra
//
database.
Make
sure
it
is
up
,
running
and
properly
initialized.
See
//
kea-admin
documentation
for
details
on
how
to
initialize
the
//
database.
The
only
strictly
required
parameters
are
type
,
keyspace
//
and
contact-points.
At
least
one
contact
point
must
be
specified
,
but
//
more
than
one
is
required
for
redundancy.
Make
sure
you
specify
the
//
contact
points
without
spaces.
Kea
must
be
compiled
with
--with-cql
//
option
to
use
this
backend.
//
"lease-database"
:
{
//
"type"
:
"cql"
,
//
"keyspace"
:
"keatest"
,
//
"contact-points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
//
"port"
:
9042
//
},
//
Addresses
will
be
assigned
with
a
lifetime
of
4000
seconds.
"valid-lifetime"
:
4000
,
...
...
doc/examples/kea4/cassandra.json
deleted
100644 → 0
View file @
c8060d70
//
This
is
an
example
configuration
file
for
the
DHCPv
4
server
in
Kea.
//
It
is
a
basic
scenario
with
one
IPv
4
subnet
configured.
It
demonstrates
//
how
to
configure
Kea
to
use
CQL
(Cassandra)
backend
{
"Dhcp4"
:
{
//
Kea
is
told
to
listen
on
ethX
interface
only.
"interfaces-config"
:
{
"interfaces"
:
[
"ethX"
]
},
//
4
.
CQL
(Cassandra)
backend.
Leases
will
be
stored
in
Cassandra
//
database.
Make
sure
it
is
up
,
running
and
properly
initialized.
See
//
kea-admin
documentation
for
details
on
how
to
initialize
the
//
database.
The
only
strictly
required
parameters
are
type
,
keyspace
//
and
contact-points.
At
least
one
contact
point
must
be
specified
,
but
//
more
than
one
is
required
for
redundancy.
Make
sure
you
specify
the
//
contact
points
without
spaces.
Kea
must
be
compiled
with
--with-cql
//
option
to
use
this
backend.
"lease-database"
:
{
"type"
:
"cql"
,
"keyspace"
:
"keatest"
,
"contact-points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
"port"
:
9042
,
//
Cassandra
supports
many
additonal
parameters
that
are
typically
//
not
needed
,
but
may
be
used
to
tweak
your
deployment.
//
This
parameter
governs
how
long
Kea
waits
before
attempting
//
to
reconnect.
Expressed
in
milliseconds.
The
default
is
2000
[
ms
]
.
"reconnect-wait-time"
:
2000
,
//
This
parameter
sets
the
timeout
for
connecting
to
a
node.
Expressed
//
in
milliseconds.
The
default
is
5000
[
ms
]
.
"connect-timeout"
:
5000
,
//
This
parameter
sets
the
timeout
for
waiting
for
a
response
//
from
a
node.
Expressed
in
milliseconds.
The
default
is
12000
[
ms
]
.
"request-timeout"
:
12000
,
//
This
parameter
governs
the
TCP
keep-alive
mechanism.
Expressed
//
in
seconds
of
delay.
The
default
is
disabled.
In
this
example
//
it
is
set
to
20
minutes.
"tcp-keepalive"
:
1200
,
//
This
parameter
enables/disables
Nagle's
algorithm
on
connections.
//
The
default
is
true
.
"tcp-nodelay"
:
true
,
//
This
parameter
configures
consistency
level.
The
default
is
"quorum"
.
//
Supported
values:
//
-
any
//
-
one
//
-
two
//
-
three
//
-
quorum
//
-
all
//
-
local-quorum
//
-
each-quorum
//
-
serial
//
-
local-serial
//
-
local-one
//
See
https://docs.datastax.com/en/cassandra/
3.0
/cassandra/dml/dmlConfigConsistency.html
for
more
details.
"consistency"
:
"quorum"
,
//
This
parameter
configures
serial
consistency
level
which
manages
//
lightweight
transaction
isolation.
The
default
is
"serial"
.
//
Supported
values:
//
-
any
//
-
one
//
-
two
//
-
three
//
-
quorum
//
-
all
//
-
local-quorum
//
-
each-quorum
//
-
serial
//
-
local-serial
//
-
local-one
//
See
https://docs.datastax.com/en/cassandra/
3.0
/cassandra/dml/dmlConfigSerialConsistency.html
for
more
details.
"serial-consistency"
:
"serial"
},
//
Addresses
will
be
assigned
with
a
lifetime
of
4000
seconds.
"valid-lifetime"
:
4000
,
//
Renew
and
rebind
timers
are
commented
out.
This
implies
that
options
//
58
and
59
will
not
be
sent
to
the
client.
In
this
case
it
is
up
to
//
the
client
to
pick
the
timer
values
according
to
RFC
2131
.
Uncomment
the
//
timers
to
send
these
options
to
the
client.
//
"renew-timer"
:
1000
,
//
"rebind-timer"
:
2000
,
//
The
following
list
defines
subnets.
We
have
only
one
subnet
//
here.
We
tell
Kea
that
it
is
directly
available
over
local
interface.
"subnet4"
:
[
{
"pools"
:
[
{
"pool"
:
"192.0.2.1 - 192.0.2.200"
}
],
"subnet"
:
"192.0.2.0/24"
,
"interface"
:
"ethX"
}
],
//
The
following
configures
logging.
It
assumes
that
messages
with
at
//
least
informational
level
(info
,
warn
,
error
and
fatal)
should
be
//
logged
to
stdout.
"loggers"
:
[
{
"name"
:
"kea-dhcp4"
,
"output_options"
:
[
{
"output"
:
"stdout"
}