Saturday, July 15, 2017

Installing CouchDB on Red Hat Enterprise Linux

     I got this up and running on RHEL 7.3. It took awhile to get through all the dependencies. Unlike what it says on the CouchDB Installation page, there is no RPM for this. Your'e going to have to download, compile, punch things to get this installed. Hopefully this guide will help to expedite this and get your document database up and running.

1. Get the RPM dependencies that are actually available

sudo yum install autoconf autoconf-archive automake \
curl-devel libicu-devel libtool gcc-c++

2. Install the wxWidgets libraries 


yum install wxBase-2.8.12-1.el6.x86_64.rpm


yum install wxGTK-2.8.12-1.el6.x86_64.rpm


yum install wxGTK-gl-2.8.12-1.el6.x86_64.rpm

3. Install Erlang


yum install esl-erlang_19.0~centos~6_amd64.rpm

4. Install Mozilla SpiderMonkey 1.8.5


tar -xvf js185-1.0.0.tar.gz

cd js-1.8.5/js/src


make && make install

This is optional, its just where I personally chose to put these files

cd back to root dir where the js-1.8.5 folder is

move js-1.8.5 to /var/lib/js-1.8.5

cp -r js-1.8.5 /var/lib

5. Time to install CouchDB


tar -xzf apache-couchdb-2.0.0.tar.gz

cd apache-couchdb-2.0.0


Change the below line in ./apache-couchdb-2.0.0/src/couch/rebar.config.script to point to where you put the SpiderMonkey files. For this example I changed:

{"linux",  CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ " -DXP_UNIX -I/usr/local/include/js"}, 


{"linux",  CouchJSPath, CouchJSSrc, [{env, [{"CFLAGS", JS_CFLAGS ++ " -DXP_UNIX -I/var/lib/js-1.8.5/js/src"},

Then make

make release

This is another optional step, it's just where I chose to put these files:

cp -r apache-couchdb-2.0.0/rel /var/lib/apache-couchdb-2.0.0/

Need to change the default.ini so we can access Fauxton from another server

vi /var/lib/apache-couchdb-2.0.0/rel/couchdb/etc/default.ini

Need to change bind_address under [chttpd] to

Now we can start up CouchDB

 nohup ./bin/couchdb/couchdb

If you want to make this run at start up add




6. Install the default databases

curl -X PUT

curl -X PUT

curl -X PUT

That should do it. You can then go to http:<servername>:5984/_utils to complete the configuration:

Figure 1. CouchDB Web UI

(Pro tip... If you are going to be using remote replication. I found the replication page in the web ui to not be working properly, best to use the REST API for this. Here is a good example of how to do this)

No comments:

Post a Comment