How to configure fdb

Hi Guys,

I’m from Wavefront and working on https://github.com/apple/foundationdb/issues/53.
I don’t so familiar with fdb, can you please help me to understand how should I start?

  1. Is it possible to simulate the situation in a local mac or there should be a separate cluster(I want to debug the part of code where memory recovery is called)? And how to figure out Is the cluster healthy (to know should we abort the recovery or not)?

  2. And can you please explain how should I configure compiled fdb? I’ve run fdbserver (./bin/fdbserver -p 127.0.0.1:4699 -d data/data/ -L data/logs/), after running ./bin/fdbcli it prints
    "The database is unavailable

fdb> status

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:4699 (reachable)"
How should I configure and use compiled fdb?

Thanks,
Vruyr

  1. I’d probably put an ASSERT(false); at the place in the code where memory recovery is called, and then run simulation tests until the assert is hit. Then you have a reproducible test that causes memory recovery to be called that you can use. (And I’m hoping @Evan would know much faster than I about where “healthy” comes from.)

  2. It sounds like you’re almost there. You just need to run configure new single memory to create a database if you haven’t previously made one with datafiles in data/data/ before.

Thanks for help.

Several more questions please.

  1. How to generate fdb.cluster file?
    I had already installed foundationdb package and for testing copied default fdb.cluster (from /usr/local/etc/founationdb/fdb.cluster), changed the port and it worked. But what should I do if I don’t have any already generated fdb.cluster?

  2. Can you please explain the meaning cluster in foundationdb?
    In docs - “In FoundationDB, a “cluster” refers to one or more FoundationDB processes spread across one or more physical machines that together host a FoundationDB database.”
    “FoundationDB processes” - it means fdbserver?
    So if I install foundationdb on my mac (client and server) what will be the cluster in that case?

I’ve generally just written cluster files by hand, which is pretty simple. Take a look at the cluster file format documentation. The main trick is just knowing what the IP is going to be of the process that you’ll start so that you can write it in the cluster file beforehand.

e.g. if you’re running one local process ./fdbserver -p 127.0.0.1:4000, then your cluster file could look like localtest:localtest@127.0.0.1:4000.

A cluster is a collection of one or more processes that hosts a single database. A “FoundationDB process” is fdbserver. In your case, your cluster would be the one fdbserver process running on your Mac.