How to create a foundation db

I downloaded source code from git and tried to compile from the source.
After “make”, i saw all the cli commands are installed under bin.
While I am trying to do ./fdbcli, first it complains there is no fdb.cluster file. I just created one with:
localtest:localtest@127.0.0.1:4000

Then I started a server: ./fdbserver -p 127.0.0.1:4000
While I do the cli again, it complains no database:
./fdbcli
Using cluster file fdb.cluster'. The database is unavailable; typestatus’ for more information.
Welcome to the fdbcli. For help, type help'. fdb> status Using cluster filefdb.cluster’.
Could not communicate with a quorum of coordination servers:
127.0.0.1:4000 (unreachable)

Do I miss something?

The easiest way to do this is actually to just go install one of the packages from the downloads page, that will automatically set up a one-process FDB cluster running as a service in the background and will go through the initial configuration steps to set up a database.

To do this manually, you’ll need to write a cluster file:

local:local@127.0.0.1:4000

and save it as local.cluster.

You’ll then start fdbserver: ./bin/fdbserver -p 127.0.0.1:4000 -C local.cluster
and then in another window run fdbcli: ./bin/fdbcli -C local.cluster

You’ll then need to initialize the database from fdbcli:

fdbcli> configure new single ssd

and then you should be able to have a working single process cluster locally from custom-built source. If you want to connect more fdbserver instances, then you’ll need to change the port in -p, but keep using the same -C local.cluster. If you wish to connect to this cluster from an application, you’ll need to configure it to use the local.cluster clusterfile as well.

1 Like