1KEA-ADMIN(8)                          Kea                         KEA-ADMIN(8)
2
3
4

NAME

6       kea-admin - Shell script for managing Kea databases
7

SYNOPSIS

9       kea-admin [command] [backend] [-h database_host] [-P database_port] [-u
10       database_username]  [-p  [database_password]]  [-n  database_name]  [-d
11       script_directory] [-v] [-x extra_argument [-x extra_argument ...]]  [-4
12       | -6] [-i input_file] [-o output_file] [-y]
13

DESCRIPTION

15       kea-admin is a shell script that offers database maintenance.  In  par‐
16       ticular,  it  features database initialization, database version check‐
17       ing, and database schema upgrading.
18

ARGUMENTS

20       command
21              Specifies the command to be issued to the servers. It can be one
22              of the following:
23
24              db-init
25                     Initializes  a new database schema. This is useful during
26                     a new Kea installation. The database  is  initialized  to
27                     the  latest version supported by the version of the soft‐
28                     ware being installed.
29
30              db-version
31                     Reports the database backend version number. This is  not
32                     necessarily  equal  to  the  Kea  version number, as each
33                     backend has its own versioning scheme.
34
35              db-upgrade
36                     Conducts a database schema upgrade. This is  useful  when
37                     upgrading Kea.
38
39              lease-dump
40                     Dumps  the  contents  of the lease database (for MySQL or
41                     PostgreSQL backends) to a  CSV  (comma-separated  values)
42                     text  file.  (Support  for the Cassandra backend has been
43                     deprecated.)  The first line of  the  file  contains  the
44                     column  names. This can be used as a way to switch from a
45                     database backend to a memfile backend.  Alternatively, it
46                     can be used as a diagnostic tool, so it provides a porta‐
47                     ble form of the lease data. There are other mandatory ar‐
48                     guments that must be used together with this command. Ei‐
49                     ther -4 or -6 must be specified. Also -o or --output must
50                     be provided.
51
52              lease-upload
53                     Uploads  leases  from a CSV (comma-separated values) text
54                     file to a MySQL or a PostgreSQL lease database.  The  CSV
55                     file  needs  to  be  in  memfile format.  There are other
56                     mandatory arguments that must be used together with  this
57                     command.  Either  -4 or -6 must be specified.  Also -i or
58                     --input must be provided.
59
60              stats-recount
61                     Recounts lease statistics for a MySQL or PostgreSQL data‐
62                     base.
63
64       backend
65              Specifies the backend type. Currently allowed backends are: mem‐
66              file, mysql, and pgsql; cql has been deprecated.
67
68       -h|--host hostname
69              Specifies the hostname when connecting to a database.   The  de‐
70              fault value is localhost.
71
72       -i|--input input_file
73              Specifies the CSV (comma-separated values) text file with leases
74              to be uploaded.  Required for lease-upload.
75
76       -P|--port port
77              Specifies the port when connecting to a database. If not  speci‐
78              fied, the default value chosen by the database client is used.
79
80       -u|--user username
81              Specifies  the  username when connecting to a database.  The de‐
82              fault value is keatest.
83
84       -p|--password password
85              Specifies the password when connecting to a database.   If  only
86              -p  or --password is given, the user is prompted for a password.
87              If not specified at all, the  KEA_ADMIN_DB_PASSWORD  environment
88              variable  is  checked for a value and used if it exists.  Other‐
89              wise the default value of keatest is used.
90
91       -n|--name database-name
92              Specifies the name of the database to connect  to.  The  default
93              value is keatest.
94
95       -d|--directory script-directory
96              Specifies  the  override  scripts directory. That script is used
97              during upgrades, database initialization, and possibly other op‐
98              erations.  The default value is (prefix)/share/kea/scripts/.
99
100       -o|--output output_file
101              Specifies  the  file to which the lease data will be dumped. Re‐
102              quired for lease-dump.
103
104       -v|--version
105              Prints the kea-admin version and quits.
106
107       -4     Directs kea-admin to lease-dump the DHCPv4 leases.  Incompatible
108              with the -6 option.
109
110       -6     Directs  kea-admin to lease-dump the DHCPv6 leases. Incompatible
111              with the -4 option.
112
113       -x|--extra
114              Specifies an extra argument to pass to the database command tool
115              e.g.   to  invoke mysql with the --ssl argument. This can be re‐
116              peated to pass more than one argument. Quotes are not preserved.
117              Avoid commands containing spaces.
118
119       -y|--yes
120              Assume yes on overwriting temporary files.
121

DOCUMENTATION

123       Kea  comes  with  an  extensive Kea Administrator Reference Manual that
124       covers all aspects of running the Kea software - compilation, installa‐
125       tion,  configuration,  configuration  examples, and much more. Kea also
126       features a Kea Messages Manual, which lists all possible  messages  Kea
127       can print with a brief description for each of them. Both documents are
128       available in various formats (.txt, .html, .pdf) with the Kea distribu‐
129       tion. The Kea documentation is available at https://kea.readthedocs.io.
130
131       Kea  source  code is documented in the Kea Developer's Guide, available
132       at https://reports.kea.isc.org/dev_guide/.
133
134       The Kea project website is available at https://kea.isc.org.
135

MAILING LISTS AND SUPPORT

137       There are two public mailing  lists  available  for  the  Kea  project.
138       kea-users (kea-users at lists.isc.org) is intended for Kea users, while
139       kea-dev (kea-dev at lists.isc.org)  is  intended  for  Kea  developers,
140       prospective  contributors,  and  other  advanced  users. Both lists are
141       available at https://lists.isc.org. The community provides  best-effort
142       support on both of those lists.
143
144       ISC    provides    professional   support   for   Kea   services.   See
145       https://www.isc.org/kea/ for details.
146

SEE ALSO

148       kea-dhcp4(8), kea-dhcp6(8), kea-dhcp-ddns(8), kea-ctrl-agent(8),  keac‐
149       trl(8),  perfdhcp(8),  kea-netconf(8), Kea Administrator Reference Man‐
150       ual.
151

AUTHOR

153       Internet Systems Consortium
154
156       2019-2023, Internet Systems Consortium
157
158
159
160
161 2.4.1                           Nov 30, 2023                     KEA-ADMIN(8)
Impressum