Hamsa K
Editor
5 min read | 4 months ago

How to Install Apache CouchDB on Centos 8

Installing couchdb on centos 8

Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.CouchDB uses multiple formats and protocols to store, transfer, and process its data, it uses JSON to store data, JavaScript as its query language using MapReduce, and HTTP for an API.Unlike a relational database a CouchDB database does not store data and relationships in tables. Instead, each database is a collection of independent documents. Each document maintains its own data and self-contained schema.

Step1 : Enable couchdb repository

First install epel repository then we can create coudb repo.

[root@centos ~]# yum update
[root@centos ~]# yum install epel-release

now you can create repo file.you can use nano or vi as editor

[root@centos ~]# vi /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo

paste below content to above 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

save the file and exit.

Step 2: Install Couchdb

[root@centos ~]# dnf install couchdb
Dependencies resolved.
========================================================================================================================================================================
 Package                           Architecture                     Version                                 Repository                                             Size
========================================================================================================================================================================
Installing:
 couchdb                           x86_64                           3.0.0-1.el8                             bintray--apache-couchdb-rpm                            23 M
Transaction Summary
========================================================================================================================================================================
Install  1 Package
Total download size: 23 M
Installed size: 50 M
Is this ok [y/N]: y
Downloading Packages:
couchdb-3.0.0-1.el8.x86_64.rpm                                                                                                           42 kB/s |  23 MB     09:37
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                    42 kB/s |  23 MB     09:37
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                
  Running scriptlet: couchdb-3.0.0-1.el8.x86_64                                                                                                                     
  Installing       : couchdb-3.0.0-1.el8.x86_64                                                                                                                     
  Running scriptlet: couchdb-3.0.0-1.el8.x86_64                                                                                                                     
  Verifying        : couchdb-3.0.0-1.el8.x86_64                                                                                                                     
Installed:
  couchdb-3.0.0-1.el8.x86_64
Complete!

After installation, enable and start the couchDB service with below commands.

[root@centos ~]# systemctl start couchdb
[root@centos ~]# systemctl enable couchdb

Step3 : Configure couchdb

To be able to access webpage from any system on the network, open below file

[root@centos ~]# vi /opt/couchdb/etc/local.ini

you can look for the section (chttpd) and uncomment below lines in local.ini file

[chttpd]
port = 5984
bind_address = 0.0.0.0

We can also set a password to access the webpage. To do this, look for section [admins] in the same file (local.ini) and mention user name,password as below.

[admins]
admin = password

Replace password with your own password and save the file.once it is done then restart the service.

[root@centos ~]# systemctl restart couchdb

Step 4: verify couchdb 

The CouchDB server  will run on default on localhost:5984 To verify whether the installation was successful and service is running, run following curl command.

[root@centos ~]# curl http://127.0.0.1:5984/
[root@centos ~]# curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"3.0.0","git_sha":"03a77db6c","uuid":"9f2f2ee381053f531931fda94f393f26","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

If you are using firewalld on the server, you should open port 5984.

[root@centos ~]# firewall-cmd --zone=public --permanent --add-port=5984/tcp
[root@centos ~]# firewall-cmd --reload

Step 5: Access from browser

we can access CouchDB on browser through localhost. you can type http://localhost:5984/_utils/

you can visit couchdb documentation for more information.

 

 



Warning! This site uses cookies
By continuing to browse the site, you are agreeing to our use of cookies. Read our terms and privacy policy