Apache CouchDB is a free and open source NoSQL based database management system. CouchDB is a single node database which can also be clustered to run on different servers. CouchDB uses HTTP protocol and JSON format for sending the data. Hence the database is compatible with all the software which supports this. It is very reliable and secure database management system and used by numerous web applications.
In this tutorial, we will be installing Apache CouchDB on CentOS 7 server.
CouchDB does not require any special hardware requirements. It can be installed on servers with a small amount of RAM to very large servers according to your needs. All the required dependencies will be installed throughout the tutorial. You will need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run sudo -i to switch to root user.
Before installing any package it is recommended that you update the packages and repository using the following command.
yum -y update
Once the system is updated, you will need to install some dependencies which are required to install CouchDB. Some of the dependencies are not available on default YUM repository, hence you will need to install EPEL repository also. Run the following command for same.
yum -y install epel-releaseyum -y update
You can install the dependencies using the following command.
You can now access the admin panel using the following link.
To check if everything has installed correctly, you can access the following link.
If you want CouchDB instance to start automatically, you can setup Systemd service. It is recommended to create a systemd service for running CouchDB so that it can run in the background and can be automatically started on failures and boot time. Run the following command to create a systemd service file.
If you do not have nano installed, you can run yum -y install nano. Now paste the following text into the nano editor.
Now you can start CouchDB service and configure it to automatically start at boot time using following commands.
systemctl start couchdbsystemctl enable couchdb
To check if CouchDB service is started correctly, you can run the following command to check the status of the CouchDB service.
systemctl status couchdb
You should get output similar to shown below.
[root@liptan-pc ]# systemctl status couchdb
● couchdb.service - CouchDB service
Loaded: loaded (/etc/systemd/system/couchdb.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2017-05-12 11:28:59 UTC; 8s ago
Main PID: 6354 (beam)
├─6354 /home/couchdb/couchdb/bin/../erts-5.10.4/bin/beam -K true -A 16 -Bd -- -root /home/couchdb/couchdb/bin...
├─6381 sh -s disksup
May 12 11:28:59 liptan-pc couchdb: [info] 2017-05-12T11:28:59.700471Z couchdb@localhost <0.7.0> --------...lhost
By default the server will listen to localhost on port 5984 only, if you want your CouchDB instance to be accessed from everywhere you will need to edit the CouchDB configuration file, run the following command to open the configuration file with nano editor.
Find the following lines into the file:
;port = 5984
;bind_address = 127.0.0.1
Uncomment the lines and change the lines as shown below.
port = 5984
bind_address = 0.0.0.0
Now restart the CouchDB service.
systemctl restart couchdb
Now you will need to disable your SELinux because reverse proxy does not work with SELinux policies. To temporary disable SELinux without restarting the server, run the following command.
To completely disable the SELinux you will need to edit /etc/selinux/config file.
If you don't have nano installed, you can install it using yum -y install nano Find the following line:
Change it to:
Now you will need to reboot your server so that the new configuration can take effect. Once the server is up again you can access your application at the following URL.
You will see the admin panel of CouchDB.
In this tutorial, we learned to install CouchDB on CentOS 7. You can now use CouchDB to create and store data in NoSQL database. Make sure that you create an admin user by clicking Admin Party! option from the sidebar.
Facebook0TwitterReddit0StumbleUpon0 Do you need to increase the memory limit in WordPress? Getting an error about memory Exhausted? The memory limit is one of the most common WordPress errors as the default limit of memory in WordPress is only set to 64mb! But there’s good news! The Memory Exhausted error is...
Facebook0TwitterReddit0StumbleUpon0 A vulnerability has been discovered in the “All In One WordPress Migration” WordPress plugin. All versions earlier than, and including 6.97 contain a vulnerability which allows Cross-Site Scripting (XSS).With over 2 million active installations, this vulnerability has the potential to be high impact, however, this is lessened by the...
Facebook0TwitterReddit0StumbleUpon0HostPresto will be launching a European point of presence in the coming weeks, specifically in Amsterdam. For customers needing their data located within the EU still please contact support to request migration to this location with ticket subject ‘EU Migration’. We will ensure this is actioned well before the Brexit...