This blog post is pretty out of date, you should check out Running Couchbase Cluster Under CoreOS on AWS instead
This tutorial will show you how to run a cluster of Couchbase Servers, where each node is running inside of a docker image.
This probably looks like a lot of layers, and you might be wondering if this will make your system crawl — but bear in mind that the Docker virtualization model is very lightweight, and so basically everything under CoreOS has very little resource overhead.
Install Docker and dependencies
If you are on OSX and don’t have Docker installed, check out Install Docker on OSX before proceeding.
Edit vagrant file to add port mappings
In order to access all the Couchbase Server nodes from the host, which doesn’t currently work, you would need to add the following entries to your Vagrantfile:
1 2 3 |
|
As mentioned, accessing all of the Couchbase Server nodes from the host does not currently work. However, I think at least some of these entries are needed, so to be on the safe side just add all of them.
Start CoreOS and ssh in
Execute the following commands in the directory where you have your CoreOS Vagrantfile. In my case, I have it under ~/Tools/coreos-vagrant
and it contains a Vagrantfile, a README.md file, and a few others.
Start CoreOS
1
|
|
SSH into CoreOS
1
|
|
Start docker image for a single node
Here’s how to fire up the first docker image
1
|
|
and you should see:
1 2 3 4 5 |
|
Find the name of the docker instance by running $ docker ps
1 2 3 |
|
In this case it’s purple_kangaroo.
Now take a look at the logs for that docker instance:
1 2 3 4 5 6 7 |
|
If you only want to run one Couchbase Server node, you are pretty much done and you can skip to the section below to login to the Couchbase Server admin
If you want to run a cluster of Couchbase Server nodes, read on.
Start docker images for other nodes
1
|
|
This will start another node that is linked to the initial node, and will be in the same cluster. There is some Weird Magic behind the scenes that makes that all work.
Go to Couchbase Server admin
Open http://localhost:8091/ in your browser, and you should see a login screen, where the default credentials are Administrator/password.
After you login, you should see the Admin UI with three nodes in your cluster: