Use 127.0.0.1, not localhost
On a single machine, set everyhost to 127.0.0.1, not localhost.
localhost resolves to both ::1 and 127.0.0.1, and the node-to-node gRPC channels flap between the two address families and drop mid-query.
A multi-node engine on one host
This is the multi-node embedded-metadata Engine, with both nodes on one machine. Because the two processes share a host, give every node-to-node port a distinct value so they do not collide. Leavestorage_manager_port at its default: only node 0, the leader, binds it.
--detach: each node’s readiness check needs its peer, so starting them one at a time deadlocks.
--http-port of the node you send queries to.
The same approach works with standalone metadata: configure the nodes as in Deploy with standalone metadata, give each node distinct ports as above, and run dedicated-pensieve alongside them on the same host.
Two engines on one host
This is Multiple engines, with both Engines on one machine. Distinct per-node ports are not enough here, because the storage manager runs on a fixed port, 1717, on each Engine’s leader node. By default an Engine binds every listener on all interfaces (0.0.0.0), so two leaders on one host would both try to claim 0.0.0.0:1717 and the second fails to start.
Set engine.listen_host to give each Engine a distinct bind address and the collision goes away: each leader binds 1717 on its own address.
On Linux every address in 127.0.0.0/8 is loopback with no setup, so two loopback aliases are the simplest choice.
Bind Engine A to 127.0.0.1 and Engine B to 127.0.0.2, set each Engine’s nodes[].host to its own bind address, and point both at the same metadata service and bucket:
id: engine-b, listen_host: 127.0.0.2, and both nodes[].host set to 127.0.0.2.
Because the two Engines bind different addresses, Engine B reuses Engine A’s port numbers unchanged.
listen_host must be an address that the same Engine’s nodes[].host entries resolve to, since each node both binds and advertises that address.
Leave listen_host unset (the default) whenever an Engine has a machine to itself: it then binds 0.0.0.0 and is reachable on every interface.
A single-node Engine is its own leader and has no peer depending on the leader’s port, so several single-node Engines colocate on one host without setting listen_host at all.