centos 7.4 deploys couchbase cluster

Courchbase is a relatively new and rapidly developing nosql database technology. In 2014, viber announced the use of couchbase to replace mongodb in order to meet the needs of 1 billion users. Currently, couchbase has been widely used in the production environment. The main domestic companies used are Sina, Tencent and so on. Due to the lack of Chinese materials, after reading some of the introduction in the official documents, the materials will be translated and summarized as follows.

Courchbase is a combination of CouchDB and MemBase. MemBase is based on Memcached. So couchbase combines couchbase's simplicity, reliability, memcached's high performance, and membase's scalability.

      

Courchbase can be used in stand-alone environments, or it can provide distributed data storage with other servers.



Installation of couchbase (node1, node2, node3)

1. Close firewalls and selinux

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@localhost ~]# vi /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@localhost ~]# setenforce 0


2. Download couchbase

[root@localhost ~]# wget https://packages.couchbase.com/releases/4.6.2/couchbase-server-enterprise-4.6.2-centos7.x86_64.rpm

Courchbase official address: https://www.couchbase.com/downloads


3. Verify whether the dependent packages are installed or not, if yum is not installed.

[root@localhost ~]# rpm -qa | grep "pkgconfig"
pkgconfig-0.27.1-4.el7.x86_64
[root@localhost ~]# rpm -qa | grep "openssl"
openssl-libs-1.0.1e-42.el7.9.x86_64
openssl-1.0.1e-42.el7.9.x86_64


4. Installing couchbase

[root@localhost ~]# rpm -ivh couchbase-server-enterprise-4.6.2-centos7.x86_64.rpm
//In preparation
Warning: Transparent hugepages looks to be active and should not be.
Please look at http://bit.ly/1ZAcLjD as for how to PERMANENTLY alter this setting.
Warning: Swappiness is not set to 0.
Please look at http://bit.ly/1k2CtNn as for how to PERMANENTLY alter this setting.
Minimum RAM required  : 4 GB
System RAM configured : 0.95 GB
Minimum number of processors required : 4 cores
Number of processors on the system    : 1 cores
//Upgrading/Installing...
   1:couchbase-server-4.6.2-3905      ################################# [100%]
Created symlink from /etc/systemd/system/multi-user.target.wants/couchbase-server.service to /usr/lib/systemd/system/couchbase-server.service.
You have successfully installed Couchbase Server.
Please browse to http://localhost.localdomain:8091/ to configure your server.
Please refer to http://couchbase.com for additional resources.
Please note that you have to update your firewall configuration to
allow connections to the following ports:
4369, 8091 to 8094, 9100 to 9105, 9998, 9999, 11209 to 11211,
11214, 11215, 18091 to 18093, and from 21100 to 21299.
By using this software you agree to the End User License Agreement.
See /opt/couchbase/LICENSE.txt.


5. Service Status and Boot-Up Self-Start

[root@test1 ~]# systemctl status couchbase-server
[root@test1 ~]# systemctl enable couchbase-server



2. Courchbase Cluster Configuration (node1)

Cluster initialization has the following ways, here we take the web console as an example:

* Couchbase web Console

* Couchbase Command Line Interface

* Couchbase's API (Couchbase REST API)

1. Browser Input http://192.168.146.126:8091/ Visit


2. Select the "Strata new cluster" option, where RAM Quota, Database path and Indexes path are set up.

In configuring the server interface, you have the following options:

* Create a new cluster

* Join an existing cluster now

* Configure Disk Storage

* Configure Server Hostname


3. Follow the default settings


4. The default bucket does not recommend excessive allocation. Check the Enable check box under Flush


5. Check for Consent


6. Setting up background Administrator password


7. Home page after landing


8. Create a new Bucket. RAM recommends default allocation of all memory except default to this Bucket. Check the Enable check box under Flush


9. Click on the bucket you just created to refresh it, as shown below


10. New cluster nodes and synchronization


11. Add a third unit according to the method of the previous step, and the effect is as follows:



Other links:

http://rdc.hundsun.com/portal/article/736.html

http://rdc.hundsun.com/portal/article/761.html



Tags: Database SELinux RPM OpenSSL

Posted on Thu, 16 May 2019 17:36:59 -0700 by phpfolk2003