]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#71,!314] Added config-backend.json examples.
authorMarcin Siodelski <marcin@isc.org>
Thu, 23 May 2019 07:36:21 +0000 (09:36 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 27 May 2019 13:23:50 +0000 (15:23 +0200)
doc/Makefile.am
doc/examples/kea4/config-backend.json [new file with mode: 0644]
doc/examples/kea6/config-backend.json [new file with mode: 0644]

index 18aaeaf90de137d41512cf465167d5f582bd654e..8c98c82405b0f5ae35903e37ee0d55d23c3e26a7 100644 (file)
@@ -26,6 +26,7 @@ nobase_dist_doc_DATA += examples/kea4/cassandra.json
 nobase_dist_doc_DATA += examples/kea4/classify.json
 nobase_dist_doc_DATA += examples/kea4/classify2.json
 nobase_dist_doc_DATA += examples/kea4/comments.json
+nobase_dist_doc_DATA += examples/kea4/config-backend.json
 nobase_dist_doc_DATA += examples/kea4/dhcpv4-over-dhcpv6.json
 nobase_dist_doc_DATA += examples/kea4/global-reservations.json
 nobase_dist_doc_DATA += examples/kea4/ha-load-balancing-primary.json
@@ -48,6 +49,7 @@ nobase_dist_doc_DATA += examples/kea6/cassandra.json
 nobase_dist_doc_DATA += examples/kea6/classify.json
 nobase_dist_doc_DATA += examples/kea6/classify2.json
 nobase_dist_doc_DATA += examples/kea6/comments.json
+nobase_dist_doc_DATA += examples/kea6/config-backend.json
 nobase_dist_doc_DATA += examples/kea6/dhcpv4-over-dhcpv6.json
 nobase_dist_doc_DATA += examples/kea6/duid.json
 nobase_dist_doc_DATA += examples/kea6/global-reservations.json
diff --git a/doc/examples/kea4/config-backend.json b/doc/examples/kea4/config-backend.json
new file mode 100644 (file)
index 0000000..e695716
--- /dev/null
@@ -0,0 +1,78 @@
+// This is an example configuration file for the DHCPv4 server in Kea.
+// It demonstrates how to enable Kea Configuration Backend using MySQL.
+// It requires that libdhcp_mysql_cb.so library is available and
+// optionally libdhcp_cb_cmds.so hooks library.
+
+{ "Dhcp4":
+
+{
+    // Kea is told to listen on ethX interface only.
+    "interfaces-config": {
+        "interfaces": [ "ethX" ]
+    },
+
+    // Use memfile lease database backend.
+    "lease-database": {
+        "type": "memfile",
+        "lfc-interval": 3600
+    },
+
+    // This parameter controls how the server accesses the configuration
+    // database. Currently only one database type is available - "mysql".
+    // It requires that libdhcp_mysql_cb.so hooks library is loaded.
+    "config-control": {
+        // A list of database backends to connect to. Currently, it is limited
+        // to a single backend.
+        "config-databases": [
+            {
+                "type": "mysql",
+                "name": "kea",
+                "user": "kea",
+                "password": "kea",
+                "host": "localhost",
+                "port": 3306
+            }
+        ],
+        // Controls how often the server polls the database for the
+        // configuration updates. The setting below implies that it
+        // will take up to approx. 20 seconds for the server to
+        // discover and fetch configuration changes.
+        "config-fetch-wait-time": 20
+    },
+
+    // Hooks libraries that enable configuration backend are loaded.
+    "hooks-libraries": [
+        // The libdhcp_mysql_cb.so is required to use MySQL Configuration
+        // Backend.
+        {
+            "library": "/usr/local/lib/kea/hooks/libdhcp_mysql_cb.so"
+        }
+        // The libdhcp_cb_cmds.so is optional. It allows for managing the
+        // configuration in the database. If this library is not loaded,
+        // the configuration can be managed directly using available
+        // tools that work directly with the MySQL database.
+        //,{
+            // "library": "/usr/local/lib/kea/hooks/libdhcp_cb_cmds.so"
+        //}
+    ]
+},
+
+// The following configures logging. It assumes that messages with at
+// least informational level (info, warn, error and fatal) should be
+// logged to stdout. Alternatively, you can specify stderr here, a filename
+// or 'syslog', which will store output messages via syslog.
+"Logging": {
+    "loggers": [
+        {
+            "name": "kea-dhcp4",
+            "output_options": [
+                {
+                    "output": "stdout"
+                }
+            ],
+            "severity": "INFO"
+        }
+    ]
+}
+
+}
diff --git a/doc/examples/kea6/config-backend.json b/doc/examples/kea6/config-backend.json
new file mode 100644 (file)
index 0000000..73d1dd5
--- /dev/null
@@ -0,0 +1,78 @@
+// This is an example configuration file for the DHCPv4 server in Kea.
+// It demonstrates how to enable Kea Configuration Backend using MySQL.
+// It requires that libdhcp_mysql_cb.so library is available and
+// optionally libdhcp_cb_cmds.so hooks library.
+
+{ "Dhcp6":
+
+{
+    // Kea is told to listen on ethX interface only.
+    "interfaces-config": {
+        "interfaces": [ "ethX" ]
+    },
+
+    // Use memfile lease database backend.
+    "lease-database": {
+        "type": "memfile",
+        "lfc-interval": 3600
+    },
+
+    // This parameter controls how the server accesses the configuration
+    // database. Currently only one database type is available - "mysql".
+    // It requires that libdhcp_mysql_cb.so hooks library is loaded.
+    "config-control": {
+        // A list of database backends to connect to. Currently, it is limited
+        // to a single backend.
+        "config-databases": [
+            {
+                "type": "mysql",
+                "name": "kea",
+                "user": "kea",
+                "password": "kea",
+                "host": "localhost",
+                "port": 3306
+            }
+        ],
+        // Controls how often the server polls the database for the
+        // configuration updates. The setting below implies that it
+        // will take up to approx. 20 seconds for the server to
+        // discover and fetch configuration changes.
+        "config-fetch-wait-time": 20
+    },
+
+    // Hooks libraries that enable configuration backend are loaded.
+    "hooks-libraries": [
+        // The libdhcp_mysql_cb.so is required to use MySQL Configuration
+        // Backend.
+        {
+            "library": "/usr/local/lib/kea/hooks/libdhcp_mysql_cb.so"
+        }
+        // The libdhcp_cb_cmds.so is optional. It allows for managing the
+        // configuration in the database. If this library is not loaded,
+        // the configuration can be managed directly using available
+        // tools that work directly with the MySQL database.
+        //,{
+            // "library": "/usr/local/lib/kea/hooks/libdhcp_cb_cmds.so"
+        //}
+    ]
+},
+
+// The following configures logging. It assumes that messages with at
+// least informational level (info, warn, error and fatal) should be
+// logged to stdout. Alternatively, you can specify stderr here, a filename
+// or 'syslog', which will store output messages via syslog.
+"Logging": {
+    "loggers": [
+        {
+            "name": "kea-dhcp6",
+            "output_options": [
+                {
+                    "output": "stdout"
+                }
+            ],
+            "debuglevel": 0,
+            "severity": "INFO"
+        }
+    ]
+}
+}