Multiple hosts, single container on each host
A typical Couchbase Server cluster with each node running on a dedicated host.
The multiple-hosts, single-container setup presents a typical Couchbase Server cluster, where each node runs on a dedicated host. All nodes are considered to be in the same datacenter with high-speed network links between them. We assume that the datacenter LAN configuration allows each host in the cluster to see each other host via known IPs.
Currently, the only supported approach for Couchbase Server on this deployment architecture is to use the --net=host flag.
--net=host flag will have the following effects:
The container will use the host’s own networking stack, and bind directly to ports on the host.
Removes networking complications with Couchbase Server being behind an NAT.
From a networking perspective, it is effectively the same as running Couchbase Server directly on the host.
There is no need to use
-pto expose any ports. Each container will use the IP address(es) of its host.
Increased efficiency, as there will be no Docker-imposed networking overhead.
Start a container on each host with the following command:
docker run -d -v ~/couchbase:/opt/couchbase/var --net=host couchbase/server
Access the Couchbase Web Console via port 8091 on any of the hosts.
Follow the same steps as in Single host, multiple containers section. However, use the host IP address itself rather than having Docker inspect and discover the IP address.