Skip to content

Lightning Stream with PowerDNS Authoritative server

This section explains how to install and run Lightning Stream with the PowerDNS Authoritative server.

Configuring PowerDNS Authoritative server 4.8+

To install PowerDNS Authoritative server, please read its installation instructions. Make sure to install version 4.8 or higher for Lightning Stream Enterprise. Also install the lmdb backend for PowerDNS Authoritative server, if packaged separately.

Warning

Lightning Stream Enterprise is only supported when used in conjuction with a supported release of PowerDNS Authoritative server. For a list of supported release see the PowerDNS Support Commitment webpage

Lightning Stream requires the following PowerDNS Authoritative server settings:

# Lightning Stream uses the LMDB backend 
launch=lmdb

# Run in Lightning Stream compatible mode.
# This flag:
# * forces flag-deleted on
# * forces random-ids on
# * handles duplicate entries in databases that can result from domains being added on two Lightning Stream nodes at the same time
# * aborts startup if shards is not set to 1
lmdb-lightning-stream=yes

# Path to the directory where the LMDB databases for this instance will be stored.
# This MUST be unique per instance, if you are running more than one on the same server.
lmdb-filename=/path/to/lmdb

# Run it with a single shard, to simplify management and configuration.
# Note that this cannot safely be changed later!
lmdb-shards=1

# You may want a lower number than 16000 MB, which is the default on 64 bit systems.
lmdb-map-size=1000

# You may want to reduce the cache interval to 1 second, or disable it
# altogether with 0, to quickly see your changes. The default is 300 seconds.
# An interval of 1 second will likely provide you with most of the benefits of caching,
# with a barely noticeable delay. Note that zone-cache-refresh-interval *must* be nonzero
# in order to make use of the Authoriative Server Views feature.
zone-cache-refresh-interval=1
zone-metadata-cache-ttl=1

Configuring Lightning Stream Enterprise

A basic Lightning Stream Enterprise configuration for PowerDNS Authoritative looks like this:

instance: unique-instance-name  # IMPORTANT: change this
lmdbs:
  main:
    # Auth 'lmdb-filename'
    path: /path/to/lmdb
    schema_tracks_changes: true
    options:
      no_subdir: true
      create: true      # optional for 'main', as auth will create it on startup, if needed
      map_size: 1000MB  # for create=true, make sure to match auth's lmdb-map-size
  shard:
    # Auth 'lmdb-filename' plus '-0' for the first shard
    path: /path/to/lmdb-0
    schema_tracks_changes: true
    options:
      no_subdir: true
      create: true      # strongly recommended for shards
      map_size: 1000MB  # for create=true, make sure to match auth's lmdb-map-size

storage:
  #type: fs
  type: s3
  options:
    #root_path: /tmp/snapshots
    access_key: minioadmin
    secret_key: minioadmin
    region: us-east-1
    bucket: lightningstream-auth48 # use a different bucket or prefix for each auth version
    create_bucket: true
    endpoint_url: http://localhost:9000

http:
  address: ":8500"  # for status and metrics

Please check the configuration section for details and other options.

Lightning Stream Enterprise can be run in the foreground as follows:

$ lightningstream-enterprise --config=/path/to/config.yaml sync

Ensure that both PowerDNS Authoritative and Lightning Stream Enterprise have write access to the LMDBs, for example by running them under the same system user.