Monday, September 10, 2012

Running multiple Couchbase servers on one physical

So it turns out there is no simple way to run multiple Couchbase nodes on a single machine (purely to play around) unlike other DBs  - eg: mongo. I haven't been able to figure out how to change ports on Couchbase either. So using VirtualBox to run couple VMs. Loaded with Ubuntu. Hope this helps you out!

Step 1 - Create two Ubuntu VMs
I'm running under Win 7. Choose your OS and run VirtualBox. Start with creating a new machine, give it a name and pick Linux -> Ubuntu. Pick a small RAM size (default 512M). Follow the wizard to the end. Upon starting it will prompt you for the image - download your version of choice and use that (I am using the Desktop version). Follow the wizard.

In the Settings change the Network to "Host-only Adapter"

You should end up with a 192.168.* address and allows other VMs and the host to have access.

TIP - You can right-click and "clone" to create a second one quickly! - Just change the host name in /etc/hostname

Step 2 - Install Couchbase
Follow the instructions on Couchbase site to setup the first node. Follow the install on http://localhost:8091 to create a new cluster.

On the second node after installing, pick to join a cluster and you should be set!