]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1978] updated documetation
authorRazvan Becheriu <razvan@isc.org>
Thu, 5 Aug 2021 13:44:06 +0000 (16:44 +0300)
committerTomek Mrugalski <tomek@isc.org>
Fri, 13 Aug 2021 09:18:47 +0000 (11:18 +0200)
doc/sphinx/arm/admin.rst
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst

index 65e6b475633f093bf22dbd3c07f91bc477aebef9..4a2d1c7aba360a7c9d9ba3ef35b179a9a0c7ee58 100644 (file)
@@ -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/<version>/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
index 2b429db8a3c56b571779172a0120260fa9a62f08..6819a99eaed2d081febaed8331378505701c0802 100644 (file)
@@ -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
index f735d98c1e149a956a3dd08f2597966edff9acdb..73292148debed1330a066644d7d213bed6904332 100644 (file)
@@ -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