Fauna Dev

Fauna Dev is a Docker image that runs a single Fauna node in your environment for development and testing.

Fauna Dev isn’t licensed or supported for multinode cluster.

Requirements

Fauna Dev has the following requirements:

  • Docker

  • CPU (minimum):

    • Dual-core

    • x86, AMD64, or ARM64

    • 2GHz clock speed

  • Memory: (minimum) 8 GB RAM (physical).

  • Storage: Local, block-based storage device (SSD, hard disk, EBS, iSCSI).

    Network file systems, such as CIFS or NFS, are not supported.

Installation

  1. Pull the latest Docker container:

    docker pull fauna/faunadb:latest
  2. Verify that the container executes correctly:

    docker run fauna/faunadb --help
    FaunaDB Enterprise Docker Image
    
    Options:
     --help               Print this message and exit.
     --init               Initialize the node (default action).
     --no-init            Doesn't initialize the node.
     --join host[:port]   Join a cluster through an active node specified in host and port.
     --config <path>      Specify a custom config file. Should be accessible inside the docker image.

Ports

When you run Fauna Dev, you have to expose the ports for the services running inside the Docker container so that your system can access them.

The port most commonly used for the Fauna Dev database service and used in the examples on this page is 8443.

If you adjust the Docker invocations to use different ports, ensure that your client programs use the ports that you specify.

The docker command -p option allows you to define a mapping from your host computer ports to the container ports, using the syntax hostPort:containerPort. hostPort and containerPort can be a single port number or a range expressed as low-high.

For example, to connect your host computer port 1234 to container port 6789, use -p 1234:6789.

See the Docker docs for more information. number

Run

Documentation for the configuration isn’t provided because Fauna isn’t licensed for on-premise production use.

There are several approaches to running Fauna Dev with Docker:

  1. As a single developer node with ephemeral data:

    docker run --rm --name faunadb -p 8443:8443 -p 8084:8084 fauna/faunadb

    This command starts a Fauna Dev node and initializes the single-node cluster.

    Using this invocation when the Docker container is stopped/killed causes all the data to be lost. This is useful for testing, where the database starts with a known state.

  2. As a single developer node with persisted data:

    docker run --rm --name faunadb -p 8443:8443 -p 8084:8084 \
      -v <host-directory or named-volume>:/var/lib/faunadb \
      fauna/faunadb

    This command starts Fauna Dev with a folder or volume bound to the Docker container data folder. When the Docker container is stopped/killed, all your data is maintained in the provided folder/volume.

  3. As a single developer node with persisted data and logs:

    docker run --rm --name faunadb -p 8443:8443 -p 8084:8084 \
      -v <host-directory or named-volume>:/var/lib/faunadb \
      -v <host-directory>:/var/log/faunadb \
      fauna/faunadb

    This command starts Fauna Dev, binding a local folder/volume to the Docker container data folder and another local folder/volume to the Docker container log folder. When the Docker container is stopped/killed, all of your data and logs are maintained in the provided folders/volumes.

  4. With managed configuration:

    docker run --rm --name faunadb -p 8443:8443 -p 8084:8084 \
      -v <host-directory or named-volume>:/var/lib/faunadb \
      -v <host-directory>:/var/log/faunadb \
      -v <path-to-config-file>:/etc/faunadb.yml \
      fauna/faunadb
      --config /etc/faunadb.yml

    This command starts Fauna Dev with path binds for the data, log, and configuration file, and indicates that the non-default configuration should be used.

    Here is an example configuration file. Adjust the configuration as appropriate:

    ---
    auth_root_key: secret
    cluster_name: fauna
    storage_data_path: /var/lib/faunadb
    log_path: /var/log/faunadb
    shutdown_grace_period_seconds: 0
    network_listen_address: 172.17.0.2
    network_broadcast_address: 172.17.0.2
    network_admin_http_address: 172.17.0.2
    network_coordinator_http_address: 172.17.0.2

Connect

To connect to a Fauna Dev instance using fauna-shell or a client application that uses one of the Fauna Drivers, the options needed are as follows:

Option Recommended value Description

secret

Your saved secret.

The secret required to connect to a Fauna Dev instance. If you run Fauna Dev with your own faunadb.yml configuration, you can specify the secret to use.

domain

localhost

Only for fauna-shell, Drivers, and Drivers

port

8443

Only for fauna-shell, Drivers, and Drivers

scheme

http

Only for fauna-shell, Drivers, and Drivers

endpoint

http://localhost:8443

Note that the recommended values are consistent, as described in the Run section. If you adjust the configuration, use your changes to the configuration to establish a connection.

For more information on configuring a connection to a Fauna instance, see the driver Client Configuration README.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!