Install Couchbase Server on CentOS 8 - CentLinux


Monday, 7 September 2020

Install Couchbase Server on CentOS 8


Couchbase is a NoSQL document-oriented database management system. In this guide, you will learn how to install Couchbase Server on CentOS 8.


Table of Contents:


What is Couchbase? :

Couchbase Server, originally known as Membase, is an open-source, distributed (shared-nothing architecture) multi-model NoSQL document-oriented database software.

Couchbase Server is optimized for interactive applications. These applications may serve many concurrent users by creating, storing, retrieving, aggregating, manipulating and presenting data. In support of these kinds of application needs, Couchbase Server is designed to provide easy-to-scale key-value or JSON document access with low latency and high sustained throughput. It is designed to be clustered from a single machine to very large-scale deployments spanning many machines.

A query language called the non-first normal form query language, N1QL (pronounced nickel), is used for manipulating the JSON data in Couchbase, just like SQL manipulates data in RDBMS. It has SELECT, INSERT, UPDATE, DELETE, MERGE statements to operate on JSON data. It was announced in March 2015 as "SQL for documents". (Courtesy: Wikipedia)


Environment Specification:

We are using a minimal CentOS 8 virtual machine with following specifications.

  • CPU - 3.4 Ghz (1 cores)
  • Memory - 3 GB
  • Storage - 20 GB
  • Operating System - CentOS 8.2
  • Hostname –
  • IP Address - /24


Updating Software Packages in CentOS 8:

Use a SSH client and connect with as root user.

As per best practice, we always recommend to update the existing software packages on CentOS 8 operating system, and then install any new software on that server.

Execute dnf command to update existing software packages on CentOS 8.

[root@couchbase-01 ~]# dnf update -y Last metadata expiration check: 0:00:20 ago on Sun 06 Sep 2020 07:39:54 PM PKT. Dependencies resolved. Nothing to do. Complete!

Our Linux operating system is already up-to-date, so there is nothing to update right now.


Disable Transparent HugePages in CentOS 8:

Transparent HugePages are enabled by default in CentOS 8. But it harms the performance of Couchbase server.

Therefore, it is required that, you should disable Transparent HugePages in CentOS 8 before installing Couchbase server.

Check the current status of Transparent HugePages.

[root@couchbase-01 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled [always] madvise never

As expected, Transparent HugePages are already enabled in our CentOS 8 operating system.

To disable Transparent HugePages, we need to edit GRUB boot menu. For this purpose, we customize the GRUB configuration file.

[root@couchbase-01 ~]# vi /etc/default/grub

Locate GRUB_CMDLINE_LINUX and append "transparent_hugepage=never" at the end of line.

GRUB_CMDLINE_LINUX="resume=/dev/mapper/cl-swap rhgb quiet transparent_hugepage=never"

Generate new GRUB boot menu based on customized configuration file.

[root@couchbase-01 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... done

Restart CentOS 8 machine to apply new settings.

[root@couchbase-01 ~]# systemctl reboot

After restart, check the status of HugePages again.

[root@couchbase-01 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never]

We have disabled Transparent HugePages on our CentOS 8 operating system. But we are also required to configure tuned service as well.

tuned service is used for monitoring and tuning in a Linux system. tuned service can be used to enable or disable Transparent HugePages.

Therefore, we need to create a profile for tuned service and disable the Transparent HugePages in that profile.

Create a directory for new tuned profile.

[root@couchbase-01 ~]# mkdir /etc/tuned/no-thp

Create a tuned configuration file.

[root@couchbase-01 ~]# vi /etc/tuned/no-thp/tuned.conf

Add following lines in that file.

[main] include=virtual-guest [vm] transparent_hugepages=never

Enable the no-thp profile by using following command.

[root@couchbase-01 ~]# tuned-adm profile no-thp


Change Swappiness in CentOS 8:

The Linux kernel's swappiness setting defines how aggressively the kernel will swap memory pages versus dropping pages from the page cache.

A higher value increases swap aggressiveness, while a lower value tells the kernel to swap as little as possible to disk and favor RAM.

The swappiness range is from 0 to 100, and most Linux distributions have swappiness set to 60 by default.

Couchbase Server is optimized with its managed cache to use RAM, and is capable of managing what should be in RAM and what shouldn’t be. Allowing the operating system to have too much control over what memory pages are in RAM is likely to lower Couchbase Server’s performance. Therefore, it’s recommended that swappiness be set to 0.

Check current setting of swappiness.

[root@couchbase-01 ~]# cat /proc/sys/vm/swappiness 60

Set the swappiness setting to 0 for the running system.

[root@couchbase-01 ~]# sysctl -w vm.swappiness=0 vm.swappiness = 0

Verify the current setting of swappiness again.

[root@couchbase-01 ~]# cat /proc/sys/vm/swappiness 0

To make swappiness setting persistent, we have to add it in Kernel parameter file.

[root@couchbase-01 ~]# echo 'vm.swappiness=0' >> /etc/sysctl.d/99-swappiness.conf


Installing Couchbase Official Repository in CentOS 8:

Couchbase software is provided through their official yum repository. Therefore, we need to install Couchbase yum repository first on our CentOS 8 operating system.

[root@couchbase-01 ~]# dnf install -y Last metadata expiration check: 0:03:34 ago on Sun 06 Sep 2020 07:39:54 PM PKT. couchbase-release-1.0-x86_64.rpm 30 kB/s | 12 kB 00:00 Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: couchbase-release x86_64 1.0-8 @commandline 12 k Transaction Summary ================================================================================ Install 1 Package Total size: 12 k Installed size: 5.7 k Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : couchbase-release-1.0-8.x86_64 1/1 Running scriptlet: couchbase-release-1.0-8.x86_64 1/1 Verifying : couchbase-release-1.0-8.x86_64 1/1 Installed: couchbase-release-1.0-8.x86_64 Complete!

Build cache for Couchbase yum repository.

[root@couchbase-01 ~]# dnf makecache CentOS-8 - AppStream 7.3 kB/s | 4.3 kB 00:00 CentOS-8 - Base 6.2 kB/s | 3.9 kB 00:00 CentOS-8 - Extras 3.7 kB/s | 1.5 kB 00:00 Couchbase Server 52 kB/s | 119 kB 00:02 Couchbase Server (Community Edition) 29 kB/s | 106 kB 00:03 Couchbase SDK package repository 8.2 kB/s | 6.7 kB 00:00 Metadata cache created.


Installing Couchbase Server on CentOS 8:

We have added Couchbase yum repository, therefore, we can install Couchbase software on our CentOS 8 system by using dnf command.

[root@couchbase-01 ~]# dnf install -y couchbase-server Last metadata expiration check: 0:53:49 ago on Sun 06 Sep 2020 07:48:23 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: couchbase-server x86_64 6.6.0-7909 couchbase-server 361 M Installing dependencies: bzip2 x86_64 1.0.6-26.el8 BaseOS 60 k Transaction Summary ================================================================================ Install 2 Packages Total download size: 361 M Installed size: 847 M Downloading Packages: (1/2): bzip2-1.0.6-26.el8.x86_64.rpm 271 kB/s | 60 kB 00:00 (2/2): couchbase-server-enterprise-6.6.0-centos 1.0 MB/s | 361 MB 05:56 -------------------------------------------------------------------------------- Total 1.0 MB/s | 361 MB 05:57 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : bzip2-1.0.6-26.el8.x86_64 1/2 Running scriptlet: couchbase-server-6.6.0-7909.x86_64 2/2 Minimum RAM required : 4 GB System RAM configured : 2.63 GB Minimum number of processors required : 4 cores Number of processors on the system : 1 cores Installing : couchbase-server-6.6.0-7909.x86_64 2/2 Running scriptlet: couchbase-server-6.6.0-7909.x86_64 2/2 You have successfully installed Couchbase Server. Please browse to to configure your server. Refer to for additional resources. Please note that you have to update your firewall configuration to allow external connections to a number of network ports for full operation. Refer to the documentation for the current list: By using this software you agree to the End User License Agreement. See /opt/couchbase/LICENSE.txt. Verifying : bzip2-1.0.6-26.el8.x86_64 1/2 Verifying : couchbase-server-6.6.0-7909.x86_64 2/2 Installed: bzip2-1.0.6-26.el8.x86_64 couchbase-server-6.6.0-7909.x86_64 Complete!

Couchbase server has been installed successfully.


Set Process/File Descriptors Limits for Couchbase User:

The default process and file descriptor limits are not sufficient for couchbase user. Therefore, we need to explicitly increase these limits.

Create a configuration file in /etc/security/limits.d directory.

[root@couchbase-01 ~]# vi /etc/security/limits.d/couchbase.conf

And add following settings therein.

couchbase soft nproc 10000 couchbase hard nproc 10000 couchbase soft nofile 70000 couchbase hard nofile 70000


Configure Linux Firewall for Couchbase:

Couchbase Server uses following service ports.

  • 8091/18091 - Cluster Administration Console (HTTP/HTTPS)
  • 8092/18092 - Views and XDCR Access (HTTP/HTTPS)
  • 8093/18093 - Query Service (HTTP/HTTPS)
  • 8094/18094 - Search Service (HTTP/HTTPS)
  • 8095/18095 - Analytics Service (HTTP/HTTPS)
  • 8096/18096 - Eventing Service (HTTP/HTTPS)
  • 9140 - Eventing Service Debugger
  • 11210,11211,11207 - Data Service

Therefore, we need to allow incoming traffic to these ports, to make them accessible from the network.

[root@couchbase-01 ~]# firewall-cmd --permanent --add-port={8091-8096,9140,11210,11211,11207,18091-18096}/tcp success [root@couchbase-01 ~]# firewall-cmd --reload success


Configuring Couchbase Server on CentOS 8:

Open URL in a web browser.


Since, we are accessing Couchbase web console for the first time, therefore, we are being asked to setup this Couchbase node.

If you are already running a Couchbase cluster then you can add this node to your existing cluster.

We do not have any Couchbase cluster, therefore, we are creating a new cluster.

Click on 'Setup New Cluster'.


Provide information to create a new cluster and click on 'Next: Accept Terms'.


Read and accept the license agreement and click on 'Configure Disk, Memory, Services'.


Change settings here according to your requirement. Don't worry, you can also change these settings later from the Couchbase web interface.

Click on 'Save & Finish'.


You will be redirected to the Dashboard of Couchbase web interface. It is empty now, because there isn't any bucket created yet.

Click on 'Settings > Sample Buckets'.


Choose a sample and click on 'Load Sample Data'.

Go back to Dashboard again.


Now, you will see some graphs based on the sample data.



We have successfully installed Couchbase server on CentOS 8. Before you start using Couchbase, we recommend that you should buy and read Pro Couchbase Server 2nd Edition by Apress. This book will help you understanding Couchbase architecture and usage.

No comments:

Post a Comment