How to Install Apache CouchDB on CentOS/RHEL 7/6
Abstract: Restart CouchDB service after changing the password every time. CouchDB will encode this password. Step 4 – Start CouchDB Service Start CouchDB servic
CouchDB is an open source project and NoSQL, document oriented database server. It stored data with JSON documents. It also provides web interface to access documents online. Click here to read more details about CoutchDB
This tutorial will help you to install Apache CouchDB server on CentOS, RedHat 7/6 servers.
Step 1 – Enabel Yum RepositoriesFirst of all, use below command to install EPEL yum repository on your system. In case epel repository package not found, use this tutorial to install epel package.
yum install epel-release-7-11.noarch.rpm
Now create yum repository for Apache Couchdb. Create a file /etc/yum.repos.d/apache-couchdb.repo
file using the below content.
[bintray--apache-couchdb-rpm] name=Apache-couchdb baseurl=http://apache.bintray.com/couchdb-rpm/el$releasever/$basearch/ gpgcheck=0 repo_gpgcheck=0 enabled=1Step 2 – Install Apache CouchDB Package
Install CouchDB package using yum command line tool. It will also install many more dependencies on your system.
yum install couchdbStep 3 – Configure CouchDB
By default, CouchDB runs on port 5984 and will be accessible to localhost only. To make it available on network system edit CouchDB config file /opt/couchdb/etc/local.ini and update following values.
vim /opt/couchdb/etc/local.ini
Navigate to [chttpd] section and update port and bind_address as per system. Set 0.0.0.0 to bind address to make is accessible with every enterface.
[chttpd] port = 5984 bind_address = 192.168.10.30
Navigate to the end of this file and set the admin user and password. As per below settings we use admin as the username with password secret.
[admins] admin = secret
Restart CouchDB service after changing the password every time. CouchDB will encode this password.
Step 4 – Start CouchDB ServiceStart CouchDB service using following commands and also configure to autostart on system boot.
### on CentOS/RHEL 7 ### systemctl enable couchdb.service systemctl start couchdb.service ### on CentOS/RHEL 6 ### service couchdb start chkconfig couchdb on
CouchDB will start on port 5984 and will be accessible through a browser.
Step 5 – Create Database in CouchDBNow, create your first database on CouchDB server. For example, your CouchDB server ip is 192.168.10.20. First set the HOST variable with following details. This will make other commands to run easily. After that use curl to create a database.
HOST="http://admin:[email protected]:5984" curl -X PUT $HOST/mydb {"ok":true}