diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml index f666411b97..99f6de2b44 100644 --- a/doc/guide/bind10-guide.xml +++ b/doc/guide/bind10-guide.xml @@ -3556,19 +3556,19 @@ then change those defaults with config set Resolver/forward_addresses[0]/address BIND 10 DHCP stores its leases in a lease database. The software has been written in a way that makes it possible to choose which database product should be used to - store the lease information. At present, only support for MySQL is provided, and that support must - be explicitly included when BIND 10 is built. This section covers the building of - BIND 10 with MySQL and the creation of the lease database. + store the lease information. At present, Kea supports 3 database backends: MySQL, + PostgreSQL and memfile. To limit external dependencies, both MySQL and PostgreSQL + support are disabled by default and only memfile (which is implemented in pure C++) + is available. Support for a given database backend must be explicitly included when + BIND 10 is built. This section covers the building of BIND 10 with MySQL and/or PostgreSQL + and the creation of the lease database.
- Install MySQL + Building with MySQL support Install MySQL according to the instructions for your system. The client development libraries must be installed. -
-
- Build and Install BIND 10 Build and install BIND 10 as described in , with the following modification: to enable the MySQL database code, at the @@ -3581,8 +3581,8 @@ then change those defaults with config set Resolver/forward_addresses[0]/address ...if not.
-
- Create MySQL Database and BIND 10 User +
+ Create MySQL Database and Kea User The next task is to create both the lease database and the user under which the servers will access it. A number of steps are required: @@ -3616,6 +3616,85 @@ Bye $
+ + +
+ Building with PostgreSQL support + + Install PostgreSQL according to the instructions for your system. The client development + libraries must be installed. Client development libraries are often packaged as "libpq". + + + Build and install BIND 10 as described in , with + the following modification: to enable the PostgreSQL database code, at the + "configure" step (see ), specify the location of the + PostgreSQL configuration program "pg_config" with the "--with-dhcp-pgsql" switch, + i.e. + ./configure [other-options] --with-dhcp-pgsql + ...if MySQL was installed in the default location, or: + ./configure [other-options] --with-dhcp-pgsql=path-to-pg_config + ...if not. + +
+
+ Create PostgreSQL Database and Kea User + + The next task is to create both the lease database and the user under which the servers will + access it. A number of steps are required: + + + 1. Log into PostgreSQL as "root": + $ sudo -u postgres psql postgres +Enter password: + : +postgres=# + + + 2. Create the database: + postgres=# CREATE DATABASE database-name; + ... database-name is the name you have chosen for the database. + + + 3. Create the database tables: + postgres=# \connect database-name +postgres=#> \i path-to-bind10/share/bind10/dhcpdb_create.pgsql + + + 4. Create the user under which BIND 10 will access the database (and give it a password), then grant it access to the database tables: + postgres=# CREATE USER user-name WITH PASSWORD 'password'; +postgres=#> GRANT ALL PRIVILEGES ON DATABASE database-name TO 'user-name; + + + 5. Exit PostgreSQL: + postgres=# \q +Bye +$ + + + Try to log into the newly created database using keatest credentials: + $ psql -d database-name -U keatest +Password for user keatest: +psql (9.1.12) +Type "help" for help. + +keatest=> + + + + If instead of seeing keatest=> prompt, your login will be refused + with error code about failed peer or indent authentication, it means + that PostgreSQL is configured to check unix username and reject + login attepts if PostgreSQL names are different. To alter that, + PostgreSQL configuration must be changed. That file is located at + /etc/postgresql/9.1/main/pg_hba.conf on Ubuntu + 13.10. Its location may be different on your system. Please consult + your PostgreSQL user manual before applying those changes as those + changes may expose your other databases that you run on the same + system. + +
+ +
@@ -3713,8 +3792,8 @@ Dhcp4/subnet4 [] list (default)
Database Configuration - All leases issued by the server are stored in the lease database. Currently, - the only supported database is MySQL + All leases issued by the server are stored in the lease database. Currently + there are 3 database backends available: MySQL, PostgreSQL and experimental memfile. The server comes with an in-memory database ("memfile") configured as the default @@ -3735,12 +3814,13 @@ Dhcp4/subnet4 [] list (default) Database configuration is controlled through the Dhcp4/lease-database parameters. - The type of the database must be set to MySQL (although the string entered is "mysql"): + The type of the database must be set to "mysql", "postgresql" or "memfile": > config set Dhcp4/lease-database/type "mysql" Next, the name of the database is to hold the leases must be set: this is the - name used when the lease database was created (see ). + name used when the lease database was created (see + or ). > config set Dhcp4/lease-database/name "database-name" @@ -4878,8 +4958,8 @@ Dhcp6/subnet6/ list
Database Configuration - All leases issued by the server are stored in the lease database. Currently, - the only supported database is MySQL + All leases issued by the server are stored in the lease database. Currently + there are 3 database backends available: MySQL, PostgreSQL and experimental memfile. The server comes with an in-memory database ("memfile") configured as the default @@ -4900,12 +4980,13 @@ Dhcp6/subnet6/ list Database configuration is controlled through the Dhcp6/lease-database parameters. - The type of the database must be set to MySQL (although the string entered is "mysql"): + The type of the database must be set to "mysql", "postgresql" or "memfile": > config set Dhcp6/lease-database/type "mysql" Next, the name of the database is to hold the leases must be set: this is the - name used when the lease database was created (see ). + name used when the lease database was created (see + or ). > config set Dhcp6/lease-database/name "database-name" @@ -5844,8 +5925,8 @@ should include options from the isc option space: that are stored in the lease database. Removing non-last subnet will cause the configuration information to mismatch data in the lease database. It is possible to manually update subnet-id fields in - MySQL database, but it is awkward and error prone process. A better - reconfiguration support is planned. + MySQL or PostgreSQL database, but it is awkward and error prone + process. A better reconfiguration support is planned. diff --git a/src/lib/dhcpsrv/database_backends.dox b/src/lib/dhcpsrv/database_backends.dox index 94beadd35b..11ee9f7203 100644 --- a/src/lib/dhcpsrv/database_backends.dox +++ b/src/lib/dhcpsrv/database_backends.dox @@ -155,7 +155,6 @@ postgres=# \q created database using keatest credentials: @verbatim $ psql -d keatest -U keatest -$ psql keatest -U keatest -W Password for user keatest: psql (9.1.12) Type "help" for help.