Installing CouchDB 1.2 on CentOS 6
CouchDB has a really great idea behind it. Whether or not CouchDB delivers on it, I've been wanting to discover for a while. Only way to do that is kick the tires, so I started the process of figuring out how to install it.
First disappointment is discovering a general lack of documentation. But my first appreciation is how simple it is once you figure out what needs to be done.
CouchDB runs on erlang, so you need to install erlang from the EPEL repository. In order to use that repository on CentOS 6, run the following command:
Now that you have the source, unpack, configure, build, and install it.
Also, since you've installed from source instead of from a package, let's configure CouchDB to run as a daemon that starts up when we boot.
Time to Relax!
First disappointment is discovering a general lack of documentation. But my first appreciation is how simple it is once you figure out what needs to be done.
CouchDB runs on erlang, so you need to install erlang from the EPEL repository. In order to use that repository on CentOS 6, run the following command:
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpmNow you can install erlang:
sudo yum install erlangThat will bring with it a number of dependencies, such as wxWidgets. With erlang now available, it's time to download the CouchDB source code from here. As of this writing, the latest release is 1.2.0, although 1.3 is in alpha in master. I'm electing to use the stable release.
Now that you have the source, unpack, configure, build, and install it.
tar zxvf apache-couchdb-1.2.0.tar.gzIf you want to be able to reach the database from other computers on the network, you'll want to edit the configuration file:
./configure --with-erlang=/usr/lib64/erlang/usr/include
make
sudo make install
sudo emacs /usr/local/etc/couchdb/local.iniUnder the [httpd] section, uncomment the bind_address setting and change the value to 0.0.0.0 if you want couchdb to listen on all available interfaces.
Also, since you've installed from source instead of from a package, let's configure CouchDB to run as a daemon that starts up when we boot.
sudo ln -s /usr/local/etc/rc.d/couchdb /etc/init.d/couchdbFinally, let's create a couchdb service account that will run CouchDB, and then fix some file permissions to give the service account access to what it needs at runtime.
sudo chkconfig --add couchdb
sudo chkconfig --level 345 couchdb on
sudo adduser -r --home /usr/local/var/lib/couchdb -M --shell /bin/bash --comment "CouchDB Administrator" couchdb
sudo chown -R couchdb: /usr/local/var/lib/couchdb /usr/local/var/log/couchdb /usr/local/var/run/couchdb /usr/local/etc/couchdbThat's it! You've installed CouchDB on CentOS 6! Start the database with:
sudo service couchdb startYou should now be able to get the welcome result by browsing to http://localhost:5984/ (unless, of course, you just installed it on a remote machine).
Time to Relax!
This comment has been removed by the author.
ReplyDeleteFreshX, producer of the couchdb based wallaby application framework now offers precompiled RPM's as well as SRPMS of Qt4.8, CouchDB 1.2 and Elasticsearch for RedHat 6, CentOS 6 and Scientific 6.
ReplyDeletecheck the repo at
http://wallaby.freshx.de/repo/binary/Linux/RPM/
Hi John,
ReplyDeleteA nice clean and concise article thanks!
On a side note; I've been a bit miffed at the inability to simply and easily package specific CouchDB/Erlang builds, and started using this instead, maybe it will help in your future endeavours?: http://dgunix.com/167-creating-self-contained-couchdb-rpms-for-centos6/
Thanks, Darren.
Thanks for the extra info, guys!
ReplyDeleteI want to install couchDB of 1.2.0 ver on CentOS 6 without yum....please let me know the steps and dependencies
ReplyDeleteI want to install couchDB of 1.2.0 ver on CentOS 6 without yum....please let me know the steps and dependencies
ReplyDelete