From: Razvan Becheriu Date: Thu, 5 Aug 2021 13:44:06 +0000 (+0300) Subject: [#1978] updated documetation X-Git-Tag: Kea-1.9.11~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a8fef95c04a115bdd46ee82db007453a0ac3b42;p=thirdparty%2Fkea.git [#1978] updated documetation --- diff --git a/doc/sphinx/arm/admin.rst b/doc/sphinx/arm/admin.rst index 65e6b47563..4a2d1c7aba 100644 --- a/doc/sphinx/arm/admin.rst +++ b/doc/sphinx/arm/admin.rst @@ -177,6 +177,40 @@ if the data will be stored in other backends. First-Time Creation of the MySQL Database ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Before preparing any Kea specific database and tables, the MySQL database +must be configured to use the system timezone. Is is recommended to use UTC +timezone for both the system and the MySQL database. + +To check the system timezone: + + .. code-block:: console + + date +%Z + +To check the MySQL timezone: + + .. code-block:: mysql + + mysql> SELECT @@system_time_zone; + mysql> SELECT @@global.time_zone; + mysql> SELECT @@session.time_zone; + +To configure the MySQL timezone for your server, please reffer to the +installed version documentation. + +Usually the setting is configured in the [mysqld] section in /etc/mysql/my.cnf, +/etc/mysql/mysql.cnf, /etc/mysql/mysqld.cnf or +/etc/mysql/mysql.conf.d/mysqld.cnf + + .. code-block:: ini + + [mysqld] + # using default-time-zone + default-time-zone='+00:00' + + # or using timezone + timezone='UTC' + When setting up the MySQL database for the first time, the database area must be created within MySQL, and the MySQL user ID under which Kea will access the database must be set up. This needs to be done manually, @@ -378,6 +412,33 @@ other database backends will be used. First-Time Creation of the PostgreSQL Database ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Before preparing any Kea specific database and tables, the PostgreSQL database +must be configured to use the system timezone. Is is recommended to use UTC +timezone for both the system and the PostgreSQL database. + +To check the system timezone: + + .. code-block:: console + + date +%Z + +To check the PostgreSQL timezone: + + .. code-block:: psql + + postgres=# show timezone; + postgres=# SELECT * FROM pg_timezone_names WHERE name = current_setting('TIMEZONE'); + +To configure the PostgreSQL timezone for your server, please reffer to the +installed version documentation. + +Usually the setting is configured in the postgresql.conf with the varying +version path /etc/postgresql//main/postgresql.conf. + + .. code-block:: ini + + timezone = 'UTC' + The first task is to create both the database and the user under which the servers will access it. A number of steps are required: @@ -460,8 +521,8 @@ which the servers will access it. A number of steps are required: the appropriate entries added to PostgreSQL's pg_hba.conf file. This file is normally located in the primary data directory for the PostgreSQL server. The precise path may vary depending on the - operating system and version, but the default location for PostgreSQL - 9.3 on Centos 6.5 is: ``/var/lib/pgsql/9.3/data/pg_hba.conf``. + operating system and version, but the default location for PostgreSQL is + ``/etc/postgresql/*/main/postgresql.conf``. Assuming Kea is running on the same host as PostgreSQL, adding lines similar to the following should be sufficient to provide diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 2b429db8a3..6819a99eae 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -419,6 +419,12 @@ Lease Database Configuration The servers store their information independently, so each server can use a separate database or both servers can use the same database. +.. note:: + + Kea requires the database timezone to match the system timezone. + For more details, see :ref:`mysql-database-create` and + :ref:`pgsql-database-create`. + Lease database configuration is controlled through the Dhcp4/lease-database parameters. The database type must be set to "memfile", "mysql", "postgresql", or "cql", e.g.: @@ -650,6 +656,22 @@ the most flexibility. Kea can keep leases and host reservations separately, but can also point to the same database. Currently the supported hosts database types are MySQL, PostgreSQL, and Cassandra. +For example, the following configuration can be used to configure a +connection to MySQL: + +:: + + "Dhcp4": { + "hosts-database": { + "type": "mysql", + "name": "kea", + "user": "kea", + "password": "secret123", + "host": "localhost", + "port": 3306 + } + } + Please note that usage of hosts storage is optional. A user can define all host reservations in the configuration file, and that is the recommended way if the number of reservations is small. However, when @@ -666,6 +688,12 @@ in the case of a host reservation addition; read-only stores must be configured after a (required) read-write store, or the addition will fail. +.. note:: + + Kea requires the database timezone to match the system timezone. + For more details, see :ref:`mysql-database-create` and + :ref:`pgsql-database-create`. + .. _hosts-databases-configuration4: DHCPv4 Hosts Database Configuration diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index f735d98c1e..73292148de 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -378,6 +378,12 @@ Lease Database Configuration The servers store their information independently, so each server can use a separate database or both servers can use the same database. +.. note:: + + Kea requires the database timezone to match the system timezone. + For more details, see :ref:`mysql-database-create` and + :ref:`pgsql-database-create`. + Lease database configuration is controlled through the Dhcp6/lease-database parameters. The database type must be set to "memfile", "mysql", "postgresql", or "cql", e.g.: @@ -586,6 +592,12 @@ the case of a host reservation addition; read-only stores must be configured after a (required) read-write store, or the addition will fail. +.. note:: + + Kea requires the database timezone to match the system timezone. + For more details, see :ref:`mysql-database-create` and + :ref:`pgsql-database-create`. + .. _hosts-databases-configuration6: DHCPv6 Hosts Database Configuration