misfoc.us

  • Archive
  • RSS
  • Ask me anything

BigCouch Clustering

In a previous article, I wrote on how to install BigCouch 0.4 on FreeBSD. One of the benefits of going to BigCouch over straight up CouchDB is the clustering capabilities. I had to do some digging around and spend some time talking to rnewson in the irc room to get everything working. Here’s a quick step-by-step setup:

(paths are all freebsd based)

After getting BigCouch installed, you’ll need to edit /usr/local/bigcouch/etc/vm.args on each node:

node 1

-name bigcouch@123.456.789.200
-setcookie some_text

node 2

-name bigcouch@123.456.789.100
-setcookie some_text

(make sure that the name is fully qualified as it must be resolvable on each node)

If you’ve changed these settings while BigCouch was previously running, you’ll need to restart to load the new settings.

You now need to tell at least one member of the cluster about the other node(s): (the nodes db will be replicated to all members)

curl -X PUT http://123.456.789.100:5986/nodes/bigcouch@123.456.789.200 -d {}

Now that you have this in place, you can now create a new database:

curl -X PUT 'http://bigcouch.cluster.com:5984/new_database?n=3&q=32'

You should now see this database appear on both boxes.

Note:

The Q and N are fixed at database creation time.

This means that if you add a new node, the existing database does not automagically scale out to include the new node.

You have a couple ways of getting around this:

  1. Create a new database and use replication to migrate data to the new, larger cluster.
  2. Manually move shards from existing nodes to the new node. You can find some solid instructions for this option here
    • #bigcouch
    • #freebsd
    • #how-to
  • 1 year ago
  • 2
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

BigCouch 0.4 and FreeBSD

With great excitement, Cloudant announced the release of BigCouch 0.4 yesterday. One of the exciting features for me is FreeBSD support. For a complete list of new features, click here for the changelog. I didn’t find any good sources for installation help in FreeBSD, so I thought I would throw something up. Here goes:

Let’s start with the dependencies:
# pkg_add -r gmake libtool help2man erlang-lite icu spidermonkey curl git
# rehash
We’re going to grab the latest from Github for our setup:

(The source is available as a package here)

# git clone git://github.com/cloudant/bigcouch.git
# cd bigcouch
If you have bash installed in your environment, you can skip this next step:

(there was a push that changed the configure script from requiring bash, but was changed back after some issues with Solaris)

# grep -rl '/bin/bash' * | xargs sed -i "" 's/bash/sh/g'
If you’d like to change what ip the single-node port (5986) listens on, run this command:

(this is used for some admin functions)

# sed -i '' 's/127.0.0.1/<Desired IP>/g' rel/overlay/etc/default.ini
Next, we need to create a directory were we will be installing BigCouch:
# mkdir /usr/local/bigcouch
We’ll finish up with a quick config change and then the standard make stuff:
# ./configure -p /usr/local/bigcouch
# make
# make install
If all goes well, you should be able to fire up BigCouch:
# /usr/local/bigcouch/bin/bigcouch

There currently isn’t a port for FreeBSD that I’ve been able to find aside from this dated one on Github. After some more testing, I’ll most likely end up getting a port put together so I can get this build out puppetized easier, but that’s another project for another day.

    • #bigcouch
    • #couchdb
    • #freebsd
    • #opensource
  • 1 year ago
  • 14
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

About

A place for me to post about things that interest me. If you stick around, you might find something interesting!

Me, Elsewhere

  • @landrysplace on Twitter
  • adalan420 on Youtube
  • adalan on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union