Commit 1aae8b1f authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[master] Merge branch 'trac3080'

Adds support for Postgresql backend to Kea
parents 6acb47ca c0a4d644
......@@ -294,7 +294,9 @@ case "$host" in
# it should be avoided to rely on 'osx_version' unless there's no
# viable alternative.
osx_version=`/usr/bin/sw_vers -productVersion`
if [ test $osx_version = "10.9" ]; then
if [ test $osx_version = "10.9" \
-o $osx_version = "10.9.1" \
-o $osx_version = "10.9.2" ]; then
bind10_undefined_pthread_behavior=yes
fi
......@@ -969,6 +971,58 @@ AC_CHECK_HEADER(sys/filio.h)
# ... and at the shell level, so Makefile.am can take action depending on this.
AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
pg_config="no"
AC_ARG_WITH([dhcp-pgsql],
AC_HELP_STRING([--with-dhcp-pgsql=PATH],
[path to the PostgreSQL 'pg_config' script]),
[pg_config="$withval"])
if test "${pg_config}" = "yes" ; then
PG_CONFIG="/usr/bin/pg_config"
elif test "${pg_config}" != "no" ; then
PG_CONFIG="${withval}"
fi
if test "$PG_CONFIG" != "" ; then
if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
AC_MSG_ERROR([--with-dhcp-pgsql should point to a pg_config program])
fi
PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir`
PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$PGSQL_INCLUDEDIR"
PGSQL_LIBS=`$PG_CONFIG --libdir`
PGSQL_LIBS="-L$PGSQL_LIBS -lpq"
PGSQL_VERSION=`$PG_CONFIG --version`
AC_SUBST(PGSQL_CPPFLAGS)
AC_SUBST(PGSQL_LIBS)
# Check that a simple program using PostgreSQL functions can compile and link.
CPPFLAGS_SAVED="$CPPFLAGS"
LIBS_SAVED="$LIBS"
CPPFLAGS="$PGSQL_CPPFLAGS $CPPFLAGS"
LIBS="$PGSQL_LIBS $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <libpq-fe.h>],
[PGconn * c = PQconnectdb("dbname = 'postgres'");
PQfinish(c);])],
[AC_MSG_RESULT([checking for PostgreSQL headers and library... yes])],
[AC_MSG_RESULT([checking for PostgreSQL headers and library... no])
AC_MSG_ERROR([Needs PostgreSQL library])]
)
CPPFLAGS=$CPPFLAGS_SAVED
LIBS=$LIBS_SAVED
# Note that PostgreSQL is present in the config.h file
AC_DEFINE([HAVE_PGSQL], [1], [PostgreSQL is present])
fi
# ... and at the shell level, so Makefile.am can take action depending on this.
AM_CONDITIONAL(HAVE_PGSQL, test "$PG_CONFIG" != "")
# Check for log4cplus
log4cplus_path="yes"
......@@ -1743,6 +1797,26 @@ MySQL:
MYSQL_CPPFLAGS: ${MYSQL_CPPFLAGS}
MYSQL_LIBS: ${MYSQL_LIBS}
END
else
cat >> config.report << END
MySQL: no
END
fi
if test "$PGSQL_CPPFLAGS" != "" ; then
cat >> config.report << END
PostgreSQL:
PGSQL_VERSION: ${PGSQL_VERSION}
PGSQL_CPPFLAGS: ${PGSQL_CPPFLAGS}
PGSQL_LIBS: ${PGSQL_LIBS}
END
else
cat >> config.report << END
PostgreSQL: no
END
fi
if test "$enable_gtest" != "no"; then
......
......@@ -3565,19 +3565,19 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
<para>
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.
</para>
<section>
<title>Install MySQL</title>
<title>Building with MySQL support</title>
<para>
Install MySQL according to the instructions for your system. The client development
libraries must be installed.
</para>
</section>
<section>
<title>Build and Install BIND 10</title>
<para>
Build and install BIND 10 as described in <xref linkend="installation"/>, with
the following modification: to enable the MySQL database code, at the
......@@ -3590,8 +3590,8 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
...if not.
</para>
</section>
<section id="dhcp-database-create">
<title>Create MySQL Database and BIND 10 User</title>
<section id="dhcp-mysql-database-create">
<title>Create MySQL Database and Kea User</title>
<para>
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:
......@@ -3625,6 +3625,108 @@ Bye<userinput/>
$</screen>
</para>
</section>
<section>
<title>Building with PostgreSQL support</title>
<para>
Install PostgreSQL according to the instructions for your system. The client development
libraries must be installed. Client development libraries are often packaged as &quot;libpq&quot;.
</para>
<para>
Build and install BIND 10 as described in <xref linkend="installation"/>, with
the following modification: to enable the PostgreSQL database code, at the
"configure" step (see <xref linkend="configure"/>), specify the location of the
PostgreSQL configuration program "pg_config" with the "--with-dhcp-pgsql" switch,
i.e.
<screen><userinput>./configure [other-options] --with-dhcp-pgsql</userinput></screen>
...if Postgresql was installed in the default location, or:
<screen><userinput>./configure [other-options] --with-dhcp-pgsql=<replaceable>path-to-pg_config</replaceable></userinput></screen>
...if not.
</para>
</section>
<section id="dhcp-pgsql-database-create">
<title>Create PostgreSQL Database and Kea User</title>
<para>
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:
</para>
<para>
1. Log into PostgreSQL as "root":
<screen>$ <userinput>sudo -u postgres psql postgres</userinput>
Enter password:<userinput/>
:<userinput/>
postgres=#</screen>
</para>
<para>
2. Create the database:
<screen>postgres=# <userinput>CREATE DATABASE <replaceable>database-name</replaceable>;</userinput></screen>
... <replaceable>database-name</replaceable> is the name you have chosen for the database.
</para>
<para>
3. Create the user under which Kea will access the database (and give it a password), then grant it access to the database:
<screen>postgres=# <userinput>CREATE USER <replaceable>user-name</replaceable> WITH PASSWORD <replaceable>password</replaceable>;</userinput>
postgres=#> <userinput>GRANT ALL PRIVILEGES ON DATABASE <replaceable>database-name</replaceable> TO <replaceable>user-name</replaceable>;</userinput></screen>
</para>
<para>
4. Exit PostgreSQL:
<screen>postgres=# <userinput>\q</userinput>
Bye<userinput/>
$</screen>
</para>
<para>
5. Create the database tables using the new user's credentials.
After entering the following command, you will be prompted for the new
user's password. When the command completes you will be returned to
the shell prompt. You should see output similiar to following:
<screen>$ <userinput>psql -d <replaceable>database-name</replaceable> -U <replaceable>user-name</replaceable> -f <replaceable>path-to-bind10</replaceable>/share/bind10/dhcpdb_create.pgsql;</userinput>
Password for user <replaceable>user-name</replaceable>:
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE TABLE
START TRANSACTION
INSERT 0 1
INSERT 0 1
INSERT 0 1
COMMIT
CREATE TABLE
START TRANSACTION
INSERT 0 1
COMMIT
$
</screen>
</para>
<para>
If instead you encounter an error such as shown below:
</para>
<screen>
psql: FATAL: no pg_hba.conf entry for host "[local]", user "<replaceable>user-name</replaceable>", database "<replaceable>database-name</replaceable>", SSL off
</screen>
<para>
This indicates that the Postgresql configuration needs to be modified.
Kea uses password authentication when connecting to the database and must
have the appropriate entries added to Posgresql's pg_hba.conf file. This
file is normally located in the primary data directory for your Postgresql
server. The precise path may vary but the default location for Postgres 9.3
on Centos 6.5 is:
<filename>/var/lib/pgsql/9.3/data/pg_hba.conf</filename>.
Adding lines similiar to following should be sufficient:
</para>
<screen>
local <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> password
host <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> 127.0.0.1/32 password
host <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> ::1/128 password
</screen>
<para>
Please consult your PostgreSQL user manual before making these changes as they
may expose your other databases that you run on the same system.
</para>
</section>
</section>
</chapter>
......@@ -3736,8 +3838,8 @@ Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
<section>
<title>Database Configuration</title>
<para>
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.
<footnote>
<para>
The server comes with an in-memory database ("memfile") configured as the default
......@@ -3758,12 +3860,13 @@ Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
</note>
<para>
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":
<screen>
&gt; <userinput>config set Dhcp4/lease-database/type "mysql"</userinput>
</screen>
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 <xref linkend="dhcp-database-create"/>).
name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
or <xref linkend="dhcp-pgsql-database-create"/>).
<screen>
&gt; <userinput>config set Dhcp4/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
</screen>
......@@ -5212,8 +5315,8 @@ Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
<section>
<title>Database Configuration</title>
<para>
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.
<footnote>
<para>
The server comes with an in-memory database ("memfile") configured as the default
......@@ -5234,12 +5337,13 @@ Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
</note>
<para>
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":
<screen>
&gt; <userinput>config set Dhcp6/lease-database/type "mysql"</userinput>
</screen>
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 <xref linkend="dhcp-database-create"/>).
name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
or <xref linkend="dhcp-pgsql-database-create"/>).
<screen>
&gt; <userinput>config set Dhcp6/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
</screen>
......@@ -6501,13 +6605,36 @@ Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
development and should be treated as <quote>not implemented
yet</quote>, rather than actual limitations.</para>
<itemizedlist>
<listitem> <!-- see tickets #3234, #3281 -->
<para>
On-line configuration has some limitations. Adding new subnets or
modifying existing ones work, as is removing the last subnet from
the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
there are 4 subnets configured) will cause issues. The problem is
caused by simplistic subnet-id assignment. The subnets are always
numbered, starting from 1. That subnet-id is then used in leases
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 or PostgreSQL database, but it is awkward and error prone
process. A better reconfiguration support is planned.
</para>
</listitem>
<listitem> <!-- see tickets #3234, #3281 -->
<simpara>
Removal of a subnet during server reconfiguration may cause renumbering
of auto-generated subnet identifiers, as described in section
<xref linkend="ipv6-subnet-id"/>.
</simpara>
<listitem>
<para>
On startup, the DHCPv6 server does not get the full configuration from
BIND 10. To remedy this, after starting BIND 10, modify any parameter
and commit the changes, e.g.
<screen>
&gt; <userinput>config show Dhcp6/renew-timer</userinput>
Dhcp6/renew-timer 1000 integer (default)
&gt; <userinput>config set Dhcp6/renew-timer 1001</userinput>
&gt; <userinput>config commit</userinput></screen>
</para>
</listitem>
<listitem>
<simpara>Temporary addresses are not supported.</simpara>
</listitem>
<listitem>
<simpara>
......
......@@ -7,6 +7,9 @@ AM_CPPFLAGS += $(BOOST_INCLUDES)
if HAVE_MYSQL
AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
endif
if HAVE_PGSQL
AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
endif
AM_CXXFLAGS = $(B10_CXXFLAGS)
......@@ -54,6 +57,9 @@ libb10_dhcpsrv_la_SOURCES += memfile_lease_mgr.cc memfile_lease_mgr.h
if HAVE_MYSQL
libb10_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
endif
if HAVE_PGSQL
libb10_dhcpsrv_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h
endif
libb10_dhcpsrv_la_SOURCES += option_space_container.h
libb10_dhcpsrv_la_SOURCES += pool.cc pool.h
libb10_dhcpsrv_la_SOURCES += subnet.cc subnet.h
......@@ -77,6 +83,9 @@ libb10_dhcpsrv_la_LDFLAGS = -no-undefined -version-info 3:0:0
if HAVE_MYSQL
libb10_dhcpsrv_la_LDFLAGS += $(MYSQL_LIBS)
endif
if HAVE_PGSQL
libb10_dhcpsrv_la_LDFLAGS += $(PGSQL_LIBS)
endif
if USE_CLANGPP
# Disable unused parameter warning caused by some of the
......@@ -88,8 +97,8 @@ endif
EXTRA_DIST = dhcpsrv_messages.mes
# Distribute MySQL schema creation script and backend documentation
EXTRA_DIST += dhcpdb_create.mysql database_backends.dox libdhcpsrv.dox
dist_pkgdata_DATA = dhcpdb_create.mysql
EXTRA_DIST += dhcpdb_create.mysql dhcpdb_create.pgsql database_backends.dox libdhcpsrv.dox
dist_pkgdata_DATA = dhcpdb_create.mysql dhcpdb_create.pgsql
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir)
......
......@@ -121,4 +121,77 @@
The unit tests are run automatically when "make check" is executed (providing
that BIND 10 has been build with the \--with-dhcp-mysql switch (see the installation
section in the <a href="http://bind10.isc.org/docs/bind10-guide.html">BIND 10 Guide</a>).
@subsection dhcp-pgsql-unittest PostgreSQL unit-tests
Conceptually, the steps required to run PostgreSQL unit-tests are the same as
in MySQL. First, a database called <i>keatest</i> must be created. A database
user, also called <i>keatest</i> (that will be allowed to log in using password
<i>keatest</i>) must be created and given full privileges in that database. The
unit tests create the schema in the database before each test and delete it
afterwards.
PostgreSQL set up differs from system to system. Please consult your OS-specific
PostgreSQL documentation. The remainder of that section uses Ubuntu 13.10 x64 as
example. On Ubuntu, after installing PostgreSQL (with <tt>sudo apt-get install
postgresql</tt>), it is installed as user <i>postgres</i>. To create new databases
or add new users, initial commands must be issued as user postgres:
@verbatim
$ sudo -u postgres psql postgres
[sudo] password for thomson:
psql (9.1.12)
Type "help" for help.
postgres=# CREATE USER keatest WITH PASSWORD 'keatest';
CREATE ROLE
postgres=# CREATE DATABASE keatest;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE keatest TO keatest;
GRANT
postgres=# \q
@endverbatim
Now we are back to our regular, unprivileged user. Try to log into the newly
created database using keatest credentials:
@verbatim
$ psql -d keatest -U keatest
Password for user keatest:
psql (9.1.12)
Type "help" for help.
keatest=>
@endverbatim
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.
Alternatively, you may set up your environment, so the tests would be run from
unix account keatest. <tt>/etc/postgresql/9.1/main/pg_hba.conf</tt> config file
had to betweaked. It may be in a different location in your system. The following
lines:
@verbatim
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
@endverbatim
were replaced with:
@verbatim
local all all password
host all all 127.0.0.1/32 password
host all all ::1/128 password
@endverbatim
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.
In general case, it is a poor idea to run anything of value on a system
that runs tests. Use caution!
The unit tests are run automatically when "make check" is executed (providing
that BIND 10 has been build with the \--with-dhcp-pgsql switch (see the installation
section in the <a href="http://bind10.isc.org/docs/bind10-guide.html">BIND10 Guide</a>).
*/
......@@ -67,7 +67,7 @@ DbAccessParser::build(isc::data::ConstElementPtr config_value) {
// b. Check if the 'type; keyword known and throw an exception if not.
string dbtype = type_ptr->second;
if ((dbtype != "memfile") && (dbtype != "mysql")) {
if ((dbtype != "memfile") && (dbtype != "mysql") && (dbtype != "postgresql")) {
isc_throw(BadValue, "unknown backend database type: " << dbtype);
}
......
-- Copyright (C) 2012-2013 Internet Systems Consortium.
-- Permission to use, copy, modify, and distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
-- THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-- DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-- INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-- FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-- NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-- This is the BIND 10 DHCP schema specification for PostgreSQL.
-- The schema is reasonably portable (with the exception of some field types
-- specification, which are PostgreSQL-specific). Minor changes might be needed
-- for other databases.
-- To create the schema, either type the command:
-- psql -U <user> -W <password> <database> < dhcpdb_create.pgsql
-- ... at the command prompt, or log in to the PostgreSQL database and at the "postgres=#"
-- prompt, issue the command:
-- @dhcpdb_create.pgsql
-- Holds the IPv4 leases.
CREATE TABLE lease4 (
address BIGINT PRIMARY KEY NOT NULL, -- IPv4 address
hwaddr BYTEA, -- Hardware address
client_id BYTEA, -- Client ID
valid_lifetime BIGINT, -- Length of the lease (seconds)
expire TIMESTAMP WITH TIME ZONE, -- Expiration time of the lease
subnet_id BIGINT, -- Subnet identification
fqdn_fwd BOOLEAN, -- Has forward DNS update been performed by a server
fqdn_rev BOOLEAN, -- Has reverse DNS update been performed by a server
hostname VARCHAR(255) -- The FQDN of the client
);
-- Create search indexes for lease4 table
-- index by hwaddr and subnet_id
CREATE INDEX lease4_by_hwaddr_subnet_id ON lease4 (hwaddr, subnet_id);
-- index by client_id and subnet_id
CREATE INDEX lease4_by_client_id_subnet_id ON lease4 (client_id, subnet_id);
-- Holds the IPv6 leases.
-- N.B. The use of a VARCHAR for the address is temporary for development:
-- it will eventually be replaced by BINARY(16).
CREATE TABLE lease6 (
address VARCHAR(39) PRIMARY KEY NOT NULL, -- IPv6 address
duid BYTEA, -- DUID
valid_lifetime BIGINT, -- Length of the lease (seconds)
expire TIMESTAMP WITH TIME ZONE, -- Expiration time of the lease
subnet_id BIGINT, -- Subnet identification
pref_lifetime BIGINT, -- Preferred lifetime
lease_type SMALLINT, -- Lease type (see lease6_types
-- table for possible values)
iaid INT, -- See Section 10 of RFC 3315
prefix_len SMALLINT, -- For IA_PD only
fqdn_fwd BOOLEAN, -- Has forward DNS update been performed by a server
fqdn_rev BOOLEAN, -- Has reverse DNS update been performed by a server
hostname VARCHAR(255) -- The FQDN of the client
);
-- Create search indexes for lease4 table
-- index by iaid, subnet_id, and duid
CREATE INDEX lease6_by_iaid_subnet_id_duid ON lease6 (iaid, subnet_id, duid);
-- ... and a definition of lease6 types. This table is a convenience for
-- users of the database - if they want to view the lease table and use the
-- type names, they can join this table with the lease6 table
CREATE TABLE lease6_types (
lease_type SMALLINT PRIMARY KEY NOT NULL, -- Lease type code.
name VARCHAR(5) -- Name of the lease type
);
START TRANSACTION;
INSERT INTO lease6_types VALUES (0, 'IA_NA'); -- Non-temporary v6 addresses
INSERT INTO lease6_types VALUES (1, 'IA_TA'); -- Temporary v6 addresses
INSERT INTO lease6_types VALUES (2, 'IA_PD'); -- Prefix delegations
COMMIT;
-- Finally, the version of the schema. We start at 0.1 during development.
-- This table is only modified during schema upgrades. For historical reasons
-- (related to the names of the columns in the BIND 10 DNS database file), the
-- first column is called "version" and not "major".
-- NOTE: this MUST be kept in step with src/lib/dhcpsrv/tests/schema_copy.h,
-- which defines the schema for the unit tests. If you are updating
-- the version number, the schema has changed: please ensure that
-- schema_copy.h has been updated as well.
CREATE TABLE schema_version (
version INT PRIMARY KEY NOT NULL, -- Major version number
minor INT -- Minor version number
);
START TRANSACTION;
INSERT INTO schema_version VALUES (1, 0);
COMMIT;
-- Notes:
-- Indexes
-- =======
-- It is likely that additional indexes will be needed. However, the
-- increase in lookup performance from these will come at the expense
-- of a decrease in performance during insert operations due to the need
-- to update the indexes. For this reason, the need for additional indexes
-- will be determined by experiment during performance tests.
-- The most likely additional indexes will cover the following columns:
-- expire
-- To speed up the deletion of expired leases from the database.
-- hwaddr and client_id
-- For lease stability: if a client requests a new lease, try to find an
-- existing or recently expired lease for it so that it can keep using the
-- same IP address.
-- Field Sizes
-- ===========
-- If any of the VARxxx field sizes are altered, the lengths in the MySQL
-- backend source file (mysql_lease_mgr.cc) must be correspondingly changed.
-- Portability
-- ===========
-- Some columns contain binary data so are stored as BYTEA instead of
-- VARCHAR. This may be non-portable between databases: in this case, the
-- definition should be changed to VARCHAR.
......@@ -375,6 +375,90 @@ lease from the MySQL database for the specified address.
A debug message issued when the server is attempting to update IPv6
lease from the MySQL database for the specified address.
% DHCPSRV_PGSQL_ADD_ADDR4 adding IPv4 lease with address %1
A debug message issued when the server is about to add an IPv4 lease
with the specified address to the PostgreSQL backend database.
% DHCPSRV_PGSQL_ADD_ADDR6 adding IPv6 lease with address %1
A debug message issued when the server is about to add an IPv6 lease
with the specified address to the PostgreSQL backend database.
% DHCPSRV_PGSQL_DEALLOC_ERROR An error occured deallocating SQL statements while closing the PostgreSQL lease database: %1
This is an error message issued when a DHCP server (either V4 or V6) experienced
and error freeing database SQL resources as part of closing its connection to
the Postgresql database. The connection is closed as part of normal server
shutdown. This error is most likely a programmatic issue that is highly
unlikely to occur or negatively impact server operation.
% DHCPSRV_PGSQL_COMMIT committing to MySQL database
The code has issued a commit call. All outstanding transactions will be
committed to the database. Note that depending on the PostgreSQL settings,
the committal may not include a write to disk.
% DHCPSRV_PGSQL_DB opening PostgreSQL lease database: %1
This informational message is logged when a DHCP server (either V4 or
V6) is about to open a PostgreSQL lease database. The parameters of the
connection including database name and username needed to access it
(but not the password if any) are logged.
% DHCPSRV_PGSQL_DELETE_ADDR deleting lease for address %1
A debug message issued when the server is attempting to delete a lease for
the specified address from the PostgreSQL database for the specified address.
% DHCPSRV_PGSQL_GET_ADDR4 obtaining IPv4 lease for address %1