]> git.ipfire.org Git - thirdparty/pdns.git/blob - docs/backends/lmdb.rst
419899c9db45198331f78e19f6642ea5eed15dee
[thirdparty/pdns.git] / docs / backends / lmdb.rst
1 LMDB backend
2 ============
3
4 * Native: Yes
5 * Master: Yes
6 * Slave: Yes
7 * Superslave: No
8 * Case: All lower
9 * DNSSEC: Yes
10 * Disabled data: No
11 * Comments: No
12 * Module name: lmdb
13 * Launch name: ``lmdb``
14
15 Enabling the backend
16 --------------------
17
18 When building PowerDNS yourself, append ``lmdb`` to ``--with-modules`` or ``--with-dynmodules``. It is expected that most pre-built packages contain this backend or be separately installable.
19
20
21 Settings
22 --------
23
24 .. _setting-lmdb-filename:
25
26 ``lmdb-filename``
27 ^^^^^^^^^^^^^^^^^
28
29 Path to the LMDB file (e.g. */var/spool/powerdns/pdns.lmdb*)
30
31 .. warning::
32 On systemd systems,
33 When running PowerDNS via the provided systemd service file, `ProtectSystem <http://www.freedesktop.org/software/systemd/man/systemd.exec.html#ProtectSystem=>`_ is set to ``full``, this means PowerDNS is unable to write to e.g. ``/etc`` and ``/home``, possibly being unable to write to the LMDB database.
34
35 .. _setting-lmdb-shards:
36
37 ``lmdb-shards``
38 ^^^^^^^^^^^^^^^^^
39
40 Records database will be split into this number of shards e.g. lmdb-shards=64
41 Default is 2 on 32 bits systems, and 64 on 64 bits systems.
42
43 .. _setting-lmdb-sync-mode:
44
45 ``lmdb-sync-mode``
46 ^^^^^^^^^^^^^^^^^^
47
48 Synchronisation mode: sync, nosync, nometasync, mapasync
49 Default: mapasync
50
51 * ``sync``: LMDB synchronous mode. Safest option, but also slightly slower. Can also be enabled with ``lmdb-sync-mode=``
52 * ``nosync``: don't flush systems buffers to disk when committing a transation.
53 This means a system crash can corrupt the database or lose the last transactions if buffers are not yet flushed to disk.
54 * ``nometasync``: flush system buffers to disk only once per transaction, omit the metadata flush. This maintains database integrity, but can potentially lose the last committed transaction if the operating system crashes.
55 * ``mapasync``: (default). Use asynchronous flushes to disk. As with nosync, a system crash can then corrupt the database or lose the last transactions.
56
57
58 LMDB Structure
59 --------------
60
61 PowerDNS will create the database structure, no need to manually create the database schema.
62 Also, it is not possible to directly query the LMDB DB, so recommendation is to use either the API, or pdnsutil.