Learn how to install Couchbase Server on CentOS 8 with our comprehensive guide. Follow step-by-step instructions to set up and configure Couchbase for optimal performance on your Linux system. #centlinux #linux #nosql
Couchbase is a distributed, NoSQL, document-oriented database management system that is designed for interactive applications. It combines the flexibility of JSON data modeling with a distributed architecture for performance, scalability, and high availability. Here are some key points about Couchbase:
Overall, Couchbase provides a scalable and flexible database solution for modern applications that require fast access to large volumes of diverse data types.
Couchbase and MongoDB are both popular NoSQL databases, each with its own strengths and features. Here’s a comparison between the two:
Choosing between Couchbase and MongoDB depends on specific project requirements, such as performance needs, data structure complexity, and scalability demands. Both databases excel in different areas, catering to diverse use cases in modern application development.
Recommended Online Training: MongoDB – Learn NoSQL Databases – Complete Bootcamp
We are using a minimal CentOS 8 virtual machine with following specifications.
Read Also: How to install CockroachDB Cluster on CentOS 8
Use a SSH client and connect with couchbase-01.centlinux.com 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.
# 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. The output may vary on your server machine.
Transparent HugePages are enabled by default in CentOS 8. But it harms the performance of Couchbase database.
Therefore, it is required that, you should disable Transparent HugePages on your Linux operating system before installing the NoSQL database server.
Check the current status of Transparent HugePages.
# cat /sys/kernel/mm/transparent_hugepage/enabled [always] madvise never
As expected, Transparent HugePages are already enabled in our Linux operating system.
To disable Transparent HugePages, you have to edit GRUB boot menu. For this purpose, edit the GRUB configuration file in vim text editor.
# 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 rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet transparent_hugepage=never"
Generate new GRUB boot menu based on customized configuration file.
# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... done
Restart Linux operating system to apply new settings.
# systemctl reboot
After restart, check the status of HugePages again.
# cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never]
You have disabled Transparent HugePages on your Linux operating system. But you 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 disable or enable 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.
# mkdir /etc/tuned/no-thp
Create a tuned configuration file.
# 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.
# tuned-adm profile no-thp
The Linux kernel’s swappiness setting defines how aggressively it will swap memory pages versus dropping pages from the page cache.
A higher value increases swap aggressiveness, while a lower value tells the Linux 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 Database 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 Linux operating system to have too much control over what memory pages are in RAM is likely to lower your NoSQL database performance. Therefore, it’s recommended that swappiness should be set to 0.
Check current setting of swappiness.
# cat /proc/sys/vm/swappiness 60
Set the swappiness setting to 0 for the running system.
# sysctl -w vm.swappiness=0 vm.swappiness = 0
Verify the current setting of swappiness again.
# cat /proc/sys/vm/swappiness 0
To make swappiness setting persistent, we have to add it in Kernel parameter file.
# echo 'vm.swappiness=0' >> /etc/sysctl.d/99-swappiness.conf
Couchbase software is provided through their official yum repository.
Therefore, you are required to install Couchbase yum repository first on your Linux operating system.
# dnf install -y https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-x86_64.rpm
Build cache for newly installed yum repositories.
# 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.
You have already added required yum repository, therefore, you can now easily install Couchbase on CentOS 8 server by using dnf command.
# 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 http://couchbase-01.centlinux.com:8091/ to configure your server. Refer to http://docs.couchbase.com 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: https://docs.couchbase.com/server/6.6/install/install-ports.html 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!
You have learned to install Couchbase on CentOS 8.
The default process and file descriptor limits are not sufficient for couchbase user. Therefore, you have to explicitly increase these limits.
Create a configuration file in /etc/security/limits.d directory by using vim text editor.
# 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
Couchbase database uses following service ports.
Therefore, you need to allow incoming traffic to these ports, to make them accessible across the network.
# firewall-cmd --permanent --add-port={8091-8096,9140,11210,11211,11207,18091-18096}/tcp success # firewall-cmd --reload success
Open URL http://couchbase-01.centlinux.com:8091 in a web browser.
Since, you are accessing Couchbase web console for the first time, therefore, you are being asked to setup this cluster node.
If you are already running a Couchbase cluster, then you can add this node to your existing cluster.
Because you don’t have any Couchbase cluster, therefore, you have to create 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 web interface.
Click on ‘Save & Finish’.
You will be redirected to the Dashboard. It is currently empty, 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 can see some graphs based on the sample data.
Before you start using it, we recommend that you should buy and read Pro Couchbase Server 2nd Edition (PAID LINK) by Apress. This book will help you in understanding the NoSQL document-oriented database management system.
Setting up Couchbase Server on CentOS 8 opens up powerful possibilities for scalable, high-performance data management in your applications. With its flexible JSON data model and distributed architecture, Couchbase is an excellent choice for projects requiring real-time analytics, content management, and more.
If you need guidance or assistance with installing Couchbase Server on CentOS 8, I provide expert services to ensure a smooth setup process. Check out my Fiverr gig for detailed instructions and personalized support: Linux System Admin
Let’s get your Couchbase deployment up and running efficiently!
Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…
Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…
Discover how to change Apache port in Linux easily. Follow our simple guide to modify…
Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…
Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…
Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…
This website uses cookies.
View Comments
Hey there! thanks for the article. Reading Couchbase website, it recommends VM swappiness setting to be 1 on RHEL8 (it was 0 on RHEL7). However, in your article you set it to 0. Which one is the right one and why?
Thanks for highlighting the problem.
You are right, the Swappiness should be 1 on RHEL 8 or later versions. However, it depends upon the implementation of the swappiness setting by that Linux Operating System.
Though you can still pass the memory management control to Couchbase server by setting swappiness to 0.
Therefore, I suggest that you can go with the Couchbase recommended setting. But thoroughly test it before implementing on the production environment.