Hello,
I’m struggling to understand how the networking works once fdb is running in a container.
Lets take this docker-compose.yml
as an example
services:
foundationdb:
image: foundationdb/foundationdb:7.3.63
network_mode: host
user: root
init: true
environment:
FDB_CLUSTER_FILE: /etc/foundationdb/fdb.cluster
entrypoint: ["/usr/bin/fdbmonitor"]
command: '--conffile /var/foundationdb.conf'
volumes:
- ./fdb.cluster:/var/fdb.cluster
- ./foundationdb.conf:/var/foundationdb.conf
fdb-ops:
build: .
network_mode: host
environment:
FDB_CLUSTER_FILE: /etc/foundationdb/fdb.cluster
volumes:
- ./fdb.cluster:/etc/foundationdb/fdb.cluster
webserver:
image: nginx:alpine
network_mode: host
container_name: simple-webserver
fdb.cluster:
docker:docker@127.0.0.1:4600
foundationdb.conf:
[fdbmonitor]
[general]
restart_delay = 60
cluster_file = /var/fdb.cluster
[fdbserver]
command = /usr/bin/fdbserver
public_address = 127.0.0.1:$ID
listen_address = public
datadir = /var/lib/foundationdb/data/$ID
locality_machineid = test
locality_dcid = test1
trace_format = json
[fdbserver.4600]
All of this is running on host networking.
I would want to reach the cluster from the fdb-ops
container.
I can reach the webserver from the fdb-ops
container using curl localhost:80
but it doesn’t seem like I’m able to reach the fdb cluster where I expect it to be on localhost:4600
. Why?
From the host machine I see the process is listening on
tcp LISTEN 0 128 127.0.0.1:4600 0.0.0.0:* users:(("fdbserver",pid=393730,fd=14))
I cant even access it when I try from inside the fdb container
bash-5.1# fdbcli -C /var/fdb.cluster
Using cluster file `/var/fdb.cluster'.
^CERROR: Asynchronous operation cancelled (1101)
bash-5.1# cat /var/fdb.cluster
docker:docker@127.0.0.1:4600
What am I missing in my understanding here?