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:
- Create a new database and use replication to migrate data to the new, larger cluster.
- Manually move shards from existing nodes to the new node. You can find some solid instructions for this option here
2 Notes/ Hide
-
mobileandwebdesignbunch likes this
-
danfairs likes this
-
misfocus posted this