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.

docker 04

Currently, the only supported approach for Couchbase Server on this deployment architecture is to use the --net=host flag.

Using the --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 -p to 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

Configure Couchbase Cluster

  • Access the Couchbase Web Console via port 8091 on any of the hosts.

  • Follow the same steps as in Single Host, Multiple Containerssection. However, use the host IP address itself rather than having Docker inspect and discover the IP address.