©2015 - 2022 Chad’s Technoworks. Disclaimer and Terms of Use

Chad’s TechnoWorks My Journal On Technology

Information Technology

Prev< 1 2 3 4 5 >Next

HOW TO INSTALL AND CONFIGURE COUCHBASE SERVER - page 4

ADDING NEW SERVER NODES TO THE CLUSTER


The demo procedures below pertains to building the 2nd node - lxnode2 - and for it to join the cluster.


Create dir for the Couchbase instance:


[root@lxnode2 ~]# mkdir -p /app/couchbase/inst1

[root@lxnode2 ~]# chown -R couchbas:nosql /app/couchbase


Ensure appropriate Firewall settings to open the ports.


Install Couchbase by following the instructions in Install Couchbase As Non-Root.


MULTI-INSTANCE CONFIG

Edit $CB_HOME/etc/couchbase/static_config and add the new instance name:

cb4inst1_n2 is for lxnode2

cb4inst1_n3 is for lxnode3

... and so on.


We are not changing the ports but just naming the instance.


example:


{short_name, "cb4inst1_n2"}.


Edit $CB_HOME/bin/couchbase-server and search for ns_1 and replace with new instance name:


sed -i 's/ns_1/cb4inst1_n2/g' bin/couchbase-server


The above command replaces the two occurrences of babysitter_of_ns_1 to babysitter_of_cb4inst1_n2.


example:


[couchbas@lxnode2 couchbase]$ cp $CB_HOME/bin/couchbase-server $CB_HOME/bin/couchbase-server.orig

[couchbas@lxnode2 couchbase]$ pwd

/app/couchbase/inst1/opt/couchbase

[couchbas@lxnode2 couchbase]$ cat $CB_HOME/bin/couchbase-server | grep "ns_1"

        -name 'babysitter_of_ns_1@127.0.0.1' \

        -eval "ns_babysitter_bootstrap:remote_stop('babysitter_of_ns_1@127.0.0.1')"

[couchbas@lxnode2 couchbase]$ sed -i 's/ns_1/cb4inst1_n2/g' bin/couchbase-server

[couchbas@lxnode2 couchbase]$ cat bin/couchbase-server | grep cb4inst1

        -name 'babysitter_of_cb3inst1_n2@127.0.0.1' \

        -eval "ns_babysitter_bootstrap:remote_stop('babysitter_of_cb4inst1_n2@127.0.0.1')"

[couchbas@lxnode2 couchbase]$



SETUP COUCHBASE INSTANCE OF THE NEW NODE


If you haven't done so, startup the couchbase server of the node to be added (in my case, lxnode2).

Ensure that the VIP is up and running on one of the network interfaces before starting. Use ifconfig -a to check.

Your instance cb4inst1_n2 should be running before we proceed with the setup.


http://lxnode2:8091


Fill-in appropriate Storage path for your data and index. (Don't forget to create the physical directory of the index.)

Specify the Server Hostname with the VIP (lxnode2cb-vip) 172.16.33.85

Select Join Cluster, provide the IP of any host instance of the current running cluster DC1-Cluster-A (lxnode1cb-vip) 172.16.33.84

and your cluster administrator password.

A couchbase server message appears in the Cluster Overview stating:

"This server has been associated with the cluster and will join on the next rebalance operation."

Select the Server Nodes tab, and you’ll be presented with the Active Servers. Then, select the Pending Rebalance button.

Proceed with the rebalance to complete the joining of a new cluster member.

That's it! This concludes our procedure to add a new node to a cluster.

You may use the same steps for additional nodes to be added. In my case I am adding one more node - lxnode3 - to have a 3-node cluster.