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.
48
49              lease-upload
50                     Uploads leases from a CSV (comma-separated  values)  text
51                     file  to  a MySQL or a PostgreSQL lease database. The CSV
52                     file needs to be in memfile format.
53
54              stats-recount
55                     Recounts lease statistics for a MySQL or PostgreSQL data‐
56                     base.
57
58       backend
59              Specifies the backend type. Currently allowed backends are: mem‐
60              file, mysql, and pgsql; cql has been deprecated.
61
62       -h|--host hostname
63              Specifies the hostname when connecting to a database.   The  de‐
64              fault value is localhost.
65
66       -P|--port port
67              Specifies  the port when connecting to a database. If not speci‐
68              fied, the default value chosen by the database client is used.
69
70       -u|--user username
71              Specifies the username when connecting to a database.   The  de‐
72              fault value is keatest.
73
74       -p|--password password
75              Specifies  the  password when connecting to a database.  If only
76              -p or --password is given, the user is prompted for a  password.
77              If  not  specified at all, the KEA_ADMIN_DB_PASSWORD environment
78              variable is checked for a value and used if it  exists.   Other‐
79              wise the default value of keatest is used.
80
81       -n|--name database-name
82              Specifies  the  name  of the database to connect to. The default
83              value is keatest.
84
85       -d|--directory script-directory
86              Specifies the override scripts directory. That  script  is  used
87              during upgrades, database initialization, and possibly other op‐
88              erations.  The default value is (prefix)/share/kea/scripts/.
89
90       -o|--output output_file
91              Specifies the file to which the lease data will be  dumped.  Re‐
92              quired for lease-dump.
93
94       -v|--version
95              Prints the kea-admin version and quits.
96
97       -4     Directs  kea-admin to lease-dump the DHCPv4 leases. Incompatible
98              with the -6 option.
99
100       -6     Directs kea-admin to lease-dump the DHCPv6 leases.  Incompatible
101              with the -4 option.
102
103       -x|--extra
104              Specifies an extra argument to pass to the database command tool
105              e.g.  to invoke mysql with the --ssl argument. This can  be  re‐
106              peated to pass more than one argument. Quotes are not preserved.
107              Avoid commands containing spaces.
108
109       -y|--yes
110              Assume yes on overwriting temporary files.
111

DOCUMENTATION

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

MAILING LISTS AND SUPPORT

127       There  are  two  public  mailing  lists  available for the Kea project.
128       kea-users (kea-users at lists.isc.org) is intended for Kea users, while
129       kea-dev  (kea-dev  at  lists.isc.org)  is  intended for Kea developers,
130       prospective contributors, and other  advanced  users.  Both  lists  are
131       available  at https://lists.isc.org. The community provides best-effort
132       support on both of those lists.
133
134       ISC   provides   professional   support   for   Kea    services.    See
135       https://www.isc.org/kea/ for details.
136

SEE ALSO

138       kea-dhcp4(8),  kea-dhcp6(8), kea-dhcp-ddns(8), kea-ctrl-agent(8), keac‐
139       trl(8), perfdhcp(8), kea-netconf(8), Kea Administrator  Reference  Man‐
140       ual.
141

AUTHOR

143       Internet Systems Consortium
144
146       2019-2022, Internet Systems Consortium
147
148
149
150
1512.2.0                            Jul 27, 2022                     KEA-ADMIN(8)
Impressum