Is it possible to have multiple Foundationdb servers on a single machine?
(without simulating another machine in any way)
If by “server” you mean “processes” (or nodes) of the same cluster, yes you definitely can. If by “server” you mean logically separate “clusters” (or databases)… yes you can also do it!
multiple nodes belonging to the same cluster and assigned to the same “machine” logically: simply add new sections in the foundationdb.conf with different ports (4500, 4501, 4502, …). This is the most common way to use all the local resources (cpu cores + disk) of a host. See the configuration file documentation for how it works.
multiple nodes belonging to the same cluster but assigned to different “machines” logically. Same as above, but change the
locality_machineidof different sections.
- Under the hood, the cluster doesn’t know they run on the same host, so it could decide to put the only two replicas of some chunk of data one the same physical hardware (or even disk drive!), which would produce data losses if it goes down!
- This is only if you are testing to learn how stuff works on you local dev host, or a last resort if you ABSOLUTELY need to temporarily have a quorum of machines while doing unplanned live rocket surgery on a production cluster. DON’T DO IT! (unless you have to).
multiple separate clusters sharing the same hardware hosts: for nodes to belong to the same cluster, they need to use the same
fdb.clusterfile. If you create multiple sets of cluster files, with for example
A.clusterreferencing processes with ports in the range 450X, and a B.cluster file pointing to processes with ports in the range 451X, and then in the same foundationdb.conf file of your host, you define for example 4 sections in two pairs: ports 4501, 4502 pointing to A.cluster, and ports 4511 and 4512 pointing to B.cluster. The two pairs of nodes will belong to two different clusters, and never see each other, even though they live on the same host.
- You could use this if you want to maximize the utilization of limited hardware while having two logically separate clusters. But then if a host fails, both clusters are impacted at the same time. So it’s ok to strongly compartmentalize data, but not that great for fault tolerance.