Trying to make docker image; fdbcli says database not created

I am a brand new user!

I’m trying to set up a foundationdb docker image to run the server, exposing port 4500 to the local machine.

I’ve installed server and client using the .deb packages from the download page, as part of the Dockerfile setting up the server container.

While I can get the server to run, when I try to interact with it, I get this error (using fdbcli inside the docker container):

fdb> status

Using cluster file `/etc/foundationdb/fdb.cluster'.

The coordinator(s) have no record of this database. Either the coordinator
addresses are incorrect, the coordination state on those machines is missing, or
no database has been created.

  127.0.0.1:4500  (reachable)

fdb>

I looked at the tutorials, but they all assume that a database has been properly created and set up.

The server is started as:

sudo fdbserver -C /etc/foundationdb/fdb.cluster -d /var/lib/foundationdb/data/ -L /var/log/foundationdb/ -p 127.0.0.1:4500 -l 0.0.0.0:4500

(This runs inside the container)

What’s likely to be the problem here, and more specifically where can I find the necessary information to unblock myself? (I e, “the docs” is not a good answer; tries that – where specifically in the docs?)

2 Likes

It looks like the problem is that the cluster hasn’t been “configured”. Each FDB cluster needs to be told some configuration information about what kind of redundancy mode it should be using, what storage engine, etc. We have detailed information about configuration in our documentation.

For local development, you’ll probably want to run:

fdbcli --exec "configure new single memory ; status"

This configures a new database with single replication (as good as you can get with a single instance) and it uses the memory storage engine. (All data are still durable in a memory engine, but the dataset also must fit in memory and is not optimized for quick recovery.) You could substitute “ssd” for “memory” and that would also probably be fine. Most of our client installers do this transparently behind the scenes, so if you do have the debian package, if you so desired, you could find the script where this is invoked, though that’s probably not worth the effort, tbh.

2 Likes

Thanks! I had tried running configure new memory (after reading the meager output of help) but that didn’t work.
configure new single memory seems to work great!
That should probably go somewhere early in the “how to install and use” documentation path …

I’m kind of puzzled why you had to do this yourself; shouldn’t the debian packages have done it during the docker build process? Maybe there is something wrong with the Dockerfile.

FWIW the FreeBSD port doesn’t do this either. If I am adding a new cluster node, would I also want to do this?

Also, I’d happily contribute this as a “getting started” guide if you can point out where you’d like that to live.

This is only necessary when creating the database the first time. If you’re adding a new node to an existing cluster, you would incredibly not want to do this, as it would wipe your database. (And, if I recall correctly, fdbcli doesn’t let you do configure new on a running database anyway.)

documentation/sphinx/source/getting_started.rst ?

I’m trying to use the Docker image in my integration tests. Unfortunately, the Docker container doesn’t initialise a new database on startup.

How can I do the equivalent of fdbcli --exec “configure new single memory" for the Docker container? I can’t run docker exec from my test suite. Is there a way to configure the the database at image build time?

I’ve figured it out. If anybody is using FoundationDB with Scala, here’s how you can write integration tests using the foundationdb/foundationdb Docker image: https://gist.github.com/vyshane/3ac679d1c57d194e00ed004b27d5133c