How to Update Your Couchbase Server from 2.2 to 3.0.1

When anyone considers upgrading any software or hardware, their major concern is that the minimum number of users should be impacted during the process. When it comes to upgrading the Couchbase server, which runs on a cluster, it provides 2 modes of upgrading.

1. Off line upgrade: In this process, all the nodes from the cluster are shut down at the same time and then each node is upgraded simultaneously. Once all the nodes are upgraded, they again form a cluster of nodes. We are not going to elaborate on the offline way of upgrading the Couchbase server, as our main agenda is to upgrade the server with no downtime approach.
2. No Downtime: The Couchbase server provides us the capability to upgrade it to a higher version with no downtime. The server will consistently be in running mode without letting the user know that it is being upgraded.

couchbase_image

 

Let’s assume that there are 3 nodes which form a cluster and all 3 nodes have Couchbase version 2.2. We have to follow the below steps to upgrade this cluster. Please note that we are assuming that load is bearable by 2 nodes because we are not going use any extra machine. In simple terms we will detach 1 node from the cluster, upgrade it, and add it to the cluster. This way of upgrading the Couchbase server is known as a “True rolling upgrade.”

Before moving to the steps in the process, we need to keep in mind that once rebalancing completes, we need to wait for at least 5 minutes before moving to the next step. Also keep in mind that there is a way to upgrade Couchbase from a lower version to a higher version with no downtime, but once all the nodes gets upgraded in the cluster, it cannot be brought back to the lower version by any means.

Getting Started

We want to start with upgrading the 1st node by following the directions below:
1. Get on the node1 through putty. Execute the below command to get the Couchbase updated version file. The below command will download the new RPM file in current directory.

wget http://packages.couchbase.com/releases/3.0.1/couchbase-server-community-3.0.1-centos6.x86_64.rm

2. Take the backup of existing data from Couchbase Server. First create a directory for the backup and then use the Couchbase backup tool cbbackup
3. Get on to node2 and remove node1 from the cluster.
4. Open http://node2:port and navigate to the “Server Nodes” tab and wait for the rebalance to complete. The rebalancing will take some time to complete, which depends on size of data. Once rebalance is completed, the node will be removed from the cluster automatically.
5. Get on the node1 through putty and stop the node. Once the node has been stopped, follow the next step.
6. Uninstall the Couchbase 2.2 version from node1 and install the new Couchbase server 3.3 from the rpm which has been downloaded at step 1. The installation would be completed with a minute.
7. Start the Couchbase server at node1.
8. Now get on to node2 and add the node node1 in cluster. Open UI Console http://node2:port and verify that the node1 has been added to the cluster. Once the node has been added, rebalancing will be started automatically. The rebalancing will take some time which depends on size of the data.

Upgrading the 2nd Node

Once the rebalancing is complete, you can move on to upgrading the 2nd node by following these steps:
1. Follow step 1 and 2 as described above for upgrading 1st node.
2. Get on to node3 and remove node2 from the cluster.
3. Open http://node3:port and navigate to the “Server Nodes” tab and wait for rebalancing to complete. The rebalancing will take some time to complete which depends on size of data. Once rebalance is completed, the node will be removed from the cluster automatically.
4. Get on node2 through putty and stop the node. Once the node has been stopped, follow the next step.
5. Uninstall the Couchbase 2.2 version from node2 and install the new Couchbase server 3.3 from the rpm which has been downloaded.
6. Start the Couchbase server at node2.
7. Now get on to node3 and add the node node2 in cluster. Open UI Console http://node3:port and verify that the node2 has been added to the cluster. Once the node has been added, rebalancing will be started automatically. Wait for the rebalancing to complete.
Now we have a cluster of 3 nodes having 2 nodes with Couchbase 3.0.1 version and 1 node is at Couchbase 2.2 version. Now we will upgrade the 3rd node also.

Upgrading the 3rd Node

To upgrade the 3rd node:
1. Follow steps 1 and 2 as described above for upgrading the 1st node.
2. Get on to node1 and remove node3 from the cluster.
3. Open http://node1:port and navigate to “Server Nodes” tab and wait for rebalance to complete. The rebalancing will take some time to complete which depends on size of data. Once rebalance is completed, the node will be removed from the cluster automatically.
4. Get on the node3 through putty and stop the node. Once the node has been stopped, follow the next step.
5. Uninstall the Couchbase 2.2 version from node3 and install the new Couchbase server 3.3 from the rpm which has been downloaded.
6. Start the Couchbase server at node3.
7. Now get on to node1 and add the node node3 in the cluster. Open UI Console http://node1:port., verify that the node3 has been added to the cluster. Once the node has been added, rebalancing will be started automatically. Wait for the rebalancing to complete.

That’s It!

Once that is done, you have successfully upgraded your Couchbase server from 2.2 to 3.0.1. Have questions or issues making the transition? Leave a comment below and I will get back to you ASAP!

Dharmveer Kedia

Dharmveer Kedia

Dharmveer Kedia is working as a Module Lead for 3Pillar Global. He is a sun-certified Java programmer and has over seven years of experience in the field of software development with various domain knowledge of Services and Investment Banking. Prior to joining 3Pillar, he worked with NIIT Technologies. He holds a B-Tech in Computer Science and Engineering. In his leisure time, he loves to travel, play cricket, and watch movies.

Leave a Reply

Related Posts

The 3 Keys to Building Products That Drive Retention –... I had the privilege of being invited to speak at the Wearable Technology Show in Santa Clara this week, where I gave a bit of a reprisal of a talk I d...
High Availability and Automatic Failover in Hadoop Hadoop in Brief Hadoop is one of the most popular sets of big data processing technologies/frameworks in use today. From Adobe and eBay to Facebook a...
3Pillar CEO David DeWolf Quoted in Enterprise Mobility Excha... David DeWolf, Founder and CEO of 3Pillar Global, was recently quoted in a report by Enterprise Mobility Exchange on the necessity of understanding and...
How the Right Tech Stack Fuels Innovation – The Innova... On this episode of The Innovation Engine podcast, we take a look at how choosing the right tech stack can fuel innovation in your company. We'll talk ...
The Road to AWS re:Invent 2018 – Weekly Predictions, P... For the last two weeks, I’ve been making predictions of what might be announced at AWS’ upcoming re:Invent conference. In week 1, I made some guesses ...