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 Repositories
First 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=1
Step 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 couchdb
Step 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 Service
Start 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 CouchDB
Now, 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}
2 Comments
if that can help anybody, I run the command to install like that:
sudo yum -y install epel-release && sudo yum -y install couchdb
And it solved the js conflict.
Hello, I am getting the following conflict, any Idea?
Installing:
couchdb x86_64 2.3.1-1.el6 bintray–apache-couchdb-rpm 19 M
Installing for dependencies:
couch-js x86_64 1:1.8.5-21.el6 bintray–apache-couchdb-rpm 1.8 M
Transaction Summary
================================================================================
Install 2 Package(s)
Total size: 21 M
Installed size: 46 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
ERROR with rpm_check_debug vs depsolve:
js <= 1.8.5 conflicts with couch-js-1:1.8.5-21.el6.x86_64
You could try running: rpm -Va –nofiles –nodigest
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx-2019-08-30-15-10o2ED_x.yumtx