Can't get a CouchDB Cluster working (connection_closed)

fly.toml looks okay to me.

Also would be fantastic if I didn’t have to specify NODENAME on startup so that nodes could auto-discover and connect and I wouldn’t need to create individual apps for each node

Not really, each node of your Fly app is already 6pn DNS and IPv6 addressable:

<fly-alloc-id>.vm.<app-name>.internal

Where <fly-alloc-id> is the first 4 bytes (8 hex chars: eda70bcd) of the FLY_ALLOC_ID env var (ex: eda70bcd-2f09-45b7-b1d9-1f8f084c62ea) preset for that instance of your Fly app’s VM. Though, I believe this information is only accessible runtime.

See also: Send request to a specific VM - #2 by greg (via 6pn) and Is it possibly for a client to connect to a particular instance - #4 by jerome (with http over fly-proxy).

You can grab an app’s 6pn IP address like so:

flyctl dig <appname>.internal -a <appname>

Or, programmatically too, ref: Best way to internally send a request to ALL running vms? - #8 by kurt / Specify instance-id in fly-replay header - #10 by ignoramous

Make sure <appname> listens on :: or fly-local-6pn or _local_ip.internal to respond to incoming 6pn requests: Private networking not working - #4 by kurt

NB: Just like the <fly-alloc-id> Even the 6pn addresses allocated change between deploys/restarts, unless you use volumes: Can an instance have a persistent network identity? - #7 by kurt


All in all, you’re in for quite a wild ride (: