Monday, April 15, 2024
HomeCentosInstall and configure Apache CouchDB in CentOS 8

Install and configure Apache CouchDB in CentOS 8

Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang. CouchDB server stores its data in named databases, which contains documents with JSON structure.
It is optimized for multi-tasking functions. CouchDB has two modes, standalone mode, and clustered mode. If you are using a single server you can use standalone mode and if you are using more than one server, then you can use clustered mode.CouchDB server stores its data in named databases, which contains documents with JSON structure. Each document consists of a number of fields and attachments. Fields can include text, numbers, lists, booleans, more. CouchDB includes a RESTful HTTP API that allows you to read, create, edit, and delete database documents.

Install EPEL Repo

dnf install epel-release -y

Create and install CouchDB repository

Create couchdb.repo file using following command.

vi /etc/yum.repos.d/couchdb.repo

Now add below configuration in this 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 changes to file and exit.

Install CouchDB on CentOS 8

Use following command to install CouchDB

dnf install couchdb -y

CouchDB Necessary Configuration

We are going to make couchdb configuration so that we can access it from any browser. Secondly, CouchDB can be configured in both clustered and Standalone mode. But, we gonna configure it in standalone mode.

We need to make changes in local.ini file located under /opt/couchdb/etc/ directory.

vi /opt/couchdb/etc/local.ini

If you want to access your DB from external IP addresses, locate [chttpd] section. Uncomment the port and bind-address lines. Also, set the bind-address from 127.0.0.1 to 0.0.0.0 to allow access from external IP addresses.

[chttpd]
port = 5984
bind_address = 0.0.0.0

Now locate [admins] section, uncomment the line admin = mypassword and set your desired password so that you can access admin account.

[admins]
admin = mypassword

Start and enable CouchDB services

systemctl start couchdb
systemctl enable couchdb
systemctl status couchdb

Now to make Firewall Configurations

CouchDb listen on port 5984 so we must enable this port in firewall.

firewall-cmd --permanent --zone=public --add-port=5984/tcp
firewall-cmd --reload

Access CouchDB Web Interface

CouchDB has been installed and configured, now verify that everyhting is going good regarding CouchDB.
Run below command to verify:

curl http://127.0.0.1:5984/

If everything is successful, you will see similar output.

Finally open your web browser, use following URL with your Server IP address and enter your admin login details to acces CouchDB.

http://YOUR-ERVER-IP:5984/_utils/

After logging in you can create your databases.

Click on Create DataBase , type database name , click on Partitioned and then click on create option.

You can see your created Database.

You can check its permissions.

That’s it.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here


spot_img

Most Popular