title: Connect to a multi node Couchbase cluster on Docker in Java
body: <p>I created a first couchbase server with the following command:</p>
  
  <pre><code>docker run -d --name db1 -p 8091-8094:8091-8094 -p 11210:11210 couchbase
  </code></pre>
  
  <p>The second server I created without the parameters for port because otherwise docker can't deploy the container:</p>
  
  <pre><code>docker run -d --name db2 couchbase
  </code></pre>
  
  <p>Now I can access the web console of the first container and create a cluster with the second container.</p>
  
  <p>The problem is that I can't connect to the created cluster in Java because port 11210 is not published for the second container. I'm always getting a <em>TimeoutException</em>. How can I solve this?</p>