Developing, Hacking & Extending BigCouch
NB: if you only want to use or deploy BigCouch, you should use these instructions instead.
Prerequisites
You will need the following installed in order to build BigCouch:
- Erlang (>=R14)
- ICU
- OpenSSL
- Mozilla SpiderMonkey (>=1.7.0)
- GNU Make
- GNU Compiler Collection
- Python
- libcurl (>=7.18)
Instructions for obtaining these dependencies on various platforms can be found at https://github.com/cloudant/bigcouch/wiki/Installing-Dependencies.
Installing prerequisites on Ubuntu
sudo apt-get install erlang libicu42 libicu-dev libcurl4-openssl-devTo install Spidermonkey 1.9.2 from PPA:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 74EE6429
sudo bash -c 'echo "deb http://ppa.launchpad.net/commonjs/ppa/ubuntu karmic main" >> /etc/apt/sources.list.d/commonjs.list'
sudo apt-get update
sudo apt-get install libmozjs-1.9.2 libmozjs-1.9.2-dev
sudo ln -s /usr/lib/libmozjs-1.9.2.so /usr/lib/libmozjs.soInstalling prerequisites on Mac OS X with Homebrew
brew install erlang icu4c spidermonkey
brew ln icu4cInstalling prerequisites on RedHat/Centos
yum install js-devel libicu libicu-devel openssl openssl-devel python python-develErlang and LibCurl need to be installed from source to meet version requirements
Building and installing BigCouch
$CLOUDANT_SRC is the directory holding your downloaded source files, while $PREFIX is the prefix to which the software is installed (defaults to /opt/bigcouch):
cd $CLOUDANT_SRC
./configure -p $PREFIX
make
sudo make installsudo is only necessary when installing to a prefix which is not user-writeable. In any case, the installer tries to chown the database directory and logfile to the user who configured BigCouch.
Local development cluster
The make dev target will build a three-node cluster under the rel/ directory. Get the nodes running, like above, by doing the following (in separate terminals):
./rel/dev1/bin/bigcouch
./rel/dev2/bin/bigcouch
./rel/dev3/bin/bigcouchThese development nodes listen on ports 15984/15986 (dev1), 25984/25986 (dev2), and 35984/35986 (dev3). Now, once the nodes are started, join the dev2 node by sending this PUT to dev1’s listening backend port:
curl -X PUT http://127.0.0.1:15986/nodes/dev2@127.0.0.1 -d {}To verify the two-node cluster has been linked properly, on either node (via proper frontend port), try:
curl http://127.0.0.1:15984/_membershipYou should see something similar to this:
{"all_nodes":["dev1@127.0.0.1","dev2@127.0.0.1"],"cluster_nodes":["dev1@127.0.0.1","dev2@127.0.0.1"]}Add node 3 to the cluster by sending a similar PUT to either of the first two nodes.