FaunaDB Dev
Congratulations! Your download is ready.
-
1
Pull latest Docker image
To get a docker image of FaunaDB, simply run:
$ docker pull fauna/faunadb:latest
-
2
Usage
$ 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.
If you are a developer and want a FaunaDB instance up and running, the simplest way to do it is by running:
$ docker run --rm --name faunadb -p 8443:8443 fauna/faunadb
-
3
Persisted data
The above command will start a FaunaDB instance and initialize the cluster. However, when you kill the docker container, all your data will be lost. In order to prevent this, you can map a volume to the folder
/var/lib/faunadb
and all data stored in FaunaDB will be persisted between executions.$ docker run --rm --name faunadb -p 8443:8443 \ -v <host-directory or named-volume>:/var/lib/faunadb \ fauna/faunadb
-
4
FaunaDB logs
To access the FaunaDB logs, you can also map a volume to the folder
/var/log/faunadb
:$ docker run --rm --name faunadb -p 8443:8443 \ -v <host-directory or named-volume>:/var/lib/faunadb \ -v <host-directory>:/var/log/faunadb \ fauna/faunadb
-
5
FaunaDB config
The previous command will start a FaunaDB instance using the default configurations. If you want to specify your own parameters, you can map a config file and pass it to the command line:
$ docker run --rm --name faunadb -p 8443:8443 \ -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 is an example config file:
--- auth_root_key: secret network_datacenter_name: NoDc storage_data_path: /storage/data log_path: /storage/log network_datacenter_name: NoDc 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
For more information about the above configurations and others, visit How to Operate FaunaDB.
-
Deprecation notice - As of the API v3.0 release: Zip, RPM, and DEB installs will be deprecated and replaced with Docker.
-
1
Download RPM
-
2
Installing
After downloading the .rpm package, open up a terminal app and run the following commands:
$ sudo rpm -i <download-directory>/faunadb-2.11.3-0.rpm
Alternatively, you can install FaunaDB using the
yum
command line. For this, you will need to add the Fauna repository:$ cat | sudo tee /etc/yum.repos.d/fauna-core-noarch.repo <<EOF [fauna-core-noarch] baseurl = https://repo.fauna.com/rpm/stable gpgcheck = 1 gpgkey = https://repo.fauna.com/faunadb-gpg-public.key name = Fauna, Inc Enterprise Database sslverify = 1 EOF $ sudo yum install faunadb
Both methods will install FaunaDB and create a
faunadb
user in your machine. -
3
Configuring
Before running FaunaDB, it's necessary to create a yaml config file at
/etc/faunadb.yml
. Here is an example file with the bare minimum configurations necessary to startup the server:$ cat | sudo tee /etc/faunadb.yml <<EOF --- auth_root_key: secret network_datacenter_name: NoDc network_listen_address: 127.0.0.1 network_broadcast_address: 127.0.0.1 network_admin_http_address: 127.0.0.1 network_coordinator_http_address: 127.0.0.1 EOF
For more information about the above configurations and others, visit How to Operate FaunaDB.
-
4
Running
Now it's time to start FaunaDB. To do this, run:
$ sudo systemctl start faunadb-enterprise
Now, make sure the service is running:
$ systemctl status faunadb faunadb-enterprise.service - FaunaDB Enterprise Edition Loaded: loaded (/usr/lib/systemd/system/faunadb.service; disabled; vendor preset: disabled) Active: active (running) since Tue 2018-08-14 12:00:38 EDT; 17s ago Process: 1311 ExecStartPre=/bin/chmod 755 /run/faunadb (code=exited, status=0/SUCCESS) Process: 1309 ExecStartPre=/bin/chown faunadb:faunadb /run/faunadb (code=exited, status=0/SUCCESS) Process: 1307 ExecStartPre=/bin/mkdir -p /run/faunadb (code=exited, status=0/SUCCESS) Main PID: 1313 (java) CGroup: /system.slice/faunadb.service └─1313 java -Djava.net.preferIPv4Stack=true -Dhttp.connection.timeout=2 -Dhttp.connection-manager.timeout=2 -Dhttp.socket.timeout=6 -Xmx249714K -Xms249714K -Xss256k -Xloggc:/var/log/faunadb/gc.log -XX:+UseG1GC -XX:MaxGCPauseMillis=200 ... Aug 14 12:00:41 localhost.localdomain faunadb[1313]: Loaded configuration from /etc/faunadb.yml... Aug 14 12:00:42 localhost.localdomain faunadb[1313]: Network Host ID: 127.0.0.1 Aug 14 12:00:42 localhost.localdomain faunadb[1313]: Cluster name: fauna Aug 14 12:00:42 localhost.localdomain faunadb[1313]: Datacenter name: NoDc Aug 14 12:00:47 localhost.localdomain faunadb[1313]: Data path: /var/lib/faunadb Aug 14 12:00:47 localhost.localdomain faunadb[1313]: Temp path: /var/lib/faunadb/tmp Aug 14 12:00:47 localhost.localdomain faunadb[1313]: Snapshot path: /var/lib/faunadb/snapshots Aug 14 12:00:48 localhost.localdomain faunadb[1313]: Admin endpoint: 127.0.0.1:8444 Aug 14 12:00:48 localhost.localdomain faunadb[1313]: API endpoint: 127.0.0.1:8443 Aug 14 12:00:48 localhost.localdomain faunadb[1313]: FaunaDB is ready.
This indicates that FaunaDB initialized successfully and loaded our config file at
/etc/faunadb.yml
.It also indicates that it's saving the data in the
/var/lib/faunadb
directory.If it's the first time you're running the service, you will need to initialize the repository before issuing queries to FaunaDB. To do that, an admin tool is provided:
$ faunadb-admin init Loaded configuration from /etc/faunadb.yml... Node has initialized the cluster.
-
5
Testing
To confirm that the instance is responding to queries, a simple test can be run:
$ curl http://127.0.0.1:8443/ping { "resource": "Scope write is OK" }
If you see the above message, you are ready to go.
-
6
Dependencies
FaunaDB depends on Java 8 to run, so you might need to install it if you haven't already:
$ sudo yum install java-1.8.0-openjdk
-
Deprecation notice - As of the API v3.0 release: Zip, RPM, and DEB installs will be deprecated and replaced with Docker.
-
1
Download DEB
-
2
Installing
After downloading the .deb package, open up a terminal app and run the following commands:
$ sudo dpkg -i <download-directory>/faunadb-2.11.3-0.deb
Alternatively, you can install FaunaDB using the
apt
command line. For this, you will need to add the Fauna repository:$ echo "deb [arch=all] https://repo.fauna.com/debian stable non-free" | sudo tee /etc/apt/sources.list.d/faunadb.list $ curl https://repo.fauna.com/faunadb-gpg-public.key | sudo apt-key add - $ sudo apt-get update $ sudo apt-get install faunadb
Both methods will install FaunaDB and create a
faunadb
user in your machine. -
3
Configuring
Before running FaunaDB, it's necessary to create a yaml config file at
/etc/faunadb.yml
. Here is an example file with the bare minimum configurations necessary to startup the server:$ cat | sudo tee /etc/faunadb.yml <<EOF --- auth_root_key: secret network_datacenter_name: NoDc network_listen_address: 127.0.0.1 network_broadcast_address: 127.0.0.1 network_admin_http_address: 127.0.0.1 network_coordinator_http_address: 127.0.0.1 EOF
For more information about the above configurations and others, visit How to Operate FaunaDB.
-
4
Runnning
Now it's time to start FaunaDB. To do this, run:
$ sudo systemctl start faunadb-enterprise
Now, make sure the service is running:
$ systemctl status faunadb faunadb.service - FaunaDB Enterprise Edition Loaded: loaded (/lib/systemd/system/faunadb.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-08-09 18:12:32 -03; 16min ago Process: 8388 ExecStartPre=/bin/chmod 755 /run/faunadb (code=exited, status=0/SUCCESS) Process: 8387 ExecStartPre=/bin/chown faunadb:faunadb /run/faunadb (code=exited, status=0/SUCCESS) Process: 8384 ExecStartPre=/bin/mkdir -p /run/faunadb (code=exited, status=0/SUCCESS) Main PID: 8392 (java) Tasks: 326 (limit: 4915) CGroup: /system.slice/faunadb.service └─8392 java -Djava.net.preferIPv4Stack=true -Dhttp.connection.timeout=2 -Dhttp.connection-manager.tim Aug 09 18:12:34 ubuntu faunadb[8392]: Loaded configuration from /etc/faunadb.yml... Aug 09 18:12:35 ubuntu faunadb[8392]: Network Host ID: 127.0.0.1 Aug 09 18:12:35 ubuntu faunadb[8392]: Cluster name: fauna Aug 09 18:12:35 ubuntu faunadb[8392]: Datacenter name: NoDC Aug 09 18:13:09 ubuntu faunadb[8392]: Data path: /var/lib/faunadb Aug 09 18:13:09 ubuntu faunadb[8392]: Temp path: /var/lib/faunadb/tmp Aug 09 18:13:10 ubuntu faunadb[8392]: Snapshot path: /var/lib/faunadb/snapshots Aug 09 18:13:10 ubuntu faunadb[8392]: Admin endpoint: 127.0.0.1:8444 Aug 09 18:13:10 ubuntu faunadb[8392]: API endpoint: 127.0.0.1:8443 Aug 09 18:13:10 ubuntu faunadb[8392]: FaunaDB is ready.
This indicates that FaunaDB initialized successfully and loaded our config file at
/etc/faunadb.yml
.It also indicates that it's saving the data in the
/var/lib/faunadb
directory.If it's the first time you're running the service, you will need to initialize the repository before issuing queries to FaunaDB. To do that, an admin tool is provided:
$ faunadb-admin init Loaded configuration from /etc/faunadb.yml... Node has initialized the cluster.
-
5
Testing
To confirm that the instance is responding to queries, a simple test can be run:
$ curl http://127.0.0.1:8443/ping { "resource": "Scope write is OK" }
If you see the above message, you are ready to go.
-
6
Dependencies
FaunaDB depends on Java 8 to run, so you might need to install it if you haven't already:
$ sudo apt-get install openjdk-8-jre-headless
-
Deprecation notice - As of the API v3.0 release: Zip, RPM, and DEB installs will be deprecated and replaced with Docker.
-
1
Download ZIP
-
2
Installing
After downloading the .zip package, open up a terminal app and run the following commands:
$ unzip <download-directory>/faunadb-2.11.3-0.zip $ cd faunadb-2.11.3
-
3
Configuring
Before running FaunaDB, it's necessary to create a yaml config file at
./etc/faunadb.yml
. Here is an example file with the bare minimum configurations necessary to startup the server:$ cat | tee ./etc/faunadb.yml <<EOF --- auth_root_key: secret storage_data_path: ./storage/data log_path: ./storage/log network_listen_address: 127.0.0.1 network_broadcast_address: 127.0.0.1 network_admin_http_address: 127.0.0.1 network_coordinator_http_address: 127.0.0.1 network_cluster_name: "fauna" network_datacenter_name: "NoDC" EOF
For more information about the above configurations and others, visit How to Operate FaunaDB.
Make sure the data and log directories exist:
$ mkdir -p ./storage/data $ mkdir -p ./storage/log
-
4
Running
Now it's time to start FaunaDB. To do this, run:
$ ./bin/faunadb FaunaDB Enterprise Edition 2.11.3 ================================= Starting... Loaded configuration from faunadb-2.11.3/./etc/faunadb.yml... Network Host ID: 127.0.0.1 Cluster name: fauna Datacenter name: NoDC Data path: ./storage/data Temp path: ./storage/data/tmp Snapshot path: ./storage/data/snapshots Admin endpoint: 127.0.0.1:8444 API endpoint: 127.0.0.1:8443 FaunaDB is ready.
This indicates that FaunaDB initialized successfully and loaded our config file at
./etc/faunadb.yml
.It also indicates that it's saving the data in the
./storage/data
directory.If it's the first time you're running the service, you will need to initialize the repository before issuing queries to FaunaDB. To do that, an admin tool is provided:
$ ./bin/faunadb-admin init Loaded configuration from faunadb-2.11.3/./etc/faunadb.yml... Node has initialized the cluster.
-
5
Testing
To confirm that the instance is responding to queries, a simple test can be run:
$ curl http://127.0.0.1:8443/ping { "resource": "Scope write is OK" }
If you see the above message, you are ready to go.