Articles

How to Install CouchDB on CentOS 8

CouchDB is an open source NoSQL database based on common standards to facilitate Web accessibility and compatibility with a variety of devices. NoSQL databases are useful for very large sets of distributed data, especially for the large amounts of non-uniform data in various formats that is characteristic of big data.

Install CouchDB on CentOS 8; Through this tutorial, we will learn how to install CouchDB on CentOS 8.

How to Install CouchDB on CentOS 8

Follow the following steps to install CouchDB on CentOS 8:

  • Step 1 – Enabling CouchDB Repository
  • Step 2 – Installing CouchDB on CentOS
  • Step 3 – Configuring CouchDB
  • Step 4 – Verifying CouchDB Installation

Step 1 – Enabling CouchDB Repository

First of all, open terminal and execute the following command on command line or terminal to enable the vendor repository and install the binary packages:

sudo nano /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo

Then paste the following content to the file:

[bintray--apache-couchdb-rpm]
name=bintray--apache-couchdb-rpm
baseurl=http://apache.bintray.com/couchdb-rpm/el$releasever/$basearch/
gpgcheck=0
repo_gpgcheck=0
enabled=1

Step 2 – Installing CouchDB on CentOS

Now, execute the following command on command line or terminal to Install the CouchDB packages:

sudo dnf install couchdb

Once the installation is completed, enable and start the CouchDB service:

sudo systemctl enable --now couchdb

Step 3 – Configuring CouchDB

We can configure CouchDB using the Fauxton, at http://127.0.0.1:5984/_utils#setup or from the command-line. The Setup Wizard will guide you through the mode selection and admin creation.

We’ll create the admin user and the databases from the command-line.

So, open terminal and execute the following command on command line or terminal to set password for admin:

sudo nano /opt/couchdb/etc/local.ini

Then add admin password into the following file and save it:

[admins]
admin = mysecretpassword

After that restart the CouchDB service to change the password to a hash:

sudo systemctl restart couchdb

Note that, we can use curl to create the system databases _users, _replicatorand _global_changes:

curl -u ADMINUSER:PASS -X PUT http://127.0.0.1:5984/_users
curl -u ADMINUSER:PASS -X PUT http://127.0.0.1:5984/_replicator
curl -u ADMINUSER:PASS -X PUT http://127.0.0.1:5984/_global_changes

Step 4 – Verifying CouchDB Installation

To verify whether the installation was successful and the service is running, so run the following curl command that will print information about the CouchDB database in JSON format:

curl http://127.0.0.1:5984/

Conclusion

Through this tutorial, we have learned how to install CouchDB on CentOS 8.

Images mentioned above related to CentOS are either copyright property of respective image owners.

Rabins Sharma Lamichhane

Rabins Sharma Lamichhane is the owner of RabinsXP who is constantly working for increasing the Internet of Things (IoT) in Nepal. He also builds android apps and crafts beautiful websites. He is also working with various social services. The main aim of Lamichhane is to digitally empower the citizens of Nepal and make the world spiritually sound better both in terms of technology and personal development. Rabins is also the first initiator of Digital Nepal.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button