Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
2.3 Upgrading to Couchbase Server 1.8
Chapter Sections
Chapters

2.3.1. Online (rolling) Upgrade Process

2.3.1.1. Upgrading to Couchbase Server 1.8.1 Using Swap Rebalance

Within an online or rolling upgrade, the upgrade process can take place without taking down the cluster or the associated application. This means that the cluster and applications can continue to function while you upgrade the individual nodes within the cluster.

The online upgrade process makes use of the auto-sharding and rebalancing functionality within Couchbase Server to enable one or more nodes within the cluster to be temporarily removed from the cluster, upgraded, and then re-enabled within the cluster again.

To perform an online upgrade of your cluster:

  1. Depending on the size and activity of your cluster, choose one or more nodes to be temporarily removed from the cluster and upgraded. You can upgrade one node at a time, or if you have capacity, multiple nodes by taking them out of the cluster at the same time.

    Note

    If necessary, you can add new nodes to your cluster to maintain performance while your existing nodes are upgraded.

  2. On the Manage->Server Nodes screen, click the Remove Server . This marks the server for removal from the cluster, but does not actually remove it.

    Figure 2.6. Online Upgrade — Marking a Node for Removal from a Cluster

    Online Upgrade — Marking a Node for Removal from a Cluster

  3. The Pending Rebalance will show the number of servers that require a rebalance to remove them from the cluster. Click the Rebalance button.

    Figure 2.7. Online Upgrade — Starting the Rebalance Process

    Online Upgrade — Starting the Rebalance Process

    This will start the rebalance process. Once rebalancing has been completed, the Server Nodes display should display only the remaining (active) nodes in your cluster.

    Figure 2.8. Online Upgrade — Cluster with the Node Removed

    Online Upgrade — Cluster with the Node Removed

  4. On the node to be upgraded, stop the Couchbase Server process. For guidance on specific platforms, see Section 3.2, “Startup and Shutdown of Couchbase Server” .

  5. With Couchbase Server shutdown on the node, you can perform a standard node upgrade to the new version of Couchbase Server. See Section 2.3.3, “Node Upgrade Process” for details.

  6. Couchbase Server should be started automatically after the upgrade. If not, restart the Couchbase Server process, using the methods described in Section 3.2, “Startup and Shutdown of Couchbase Server” .

  7. With the node upgraded, you need to add the node back to the cluster.

    On an existing node within the running cluster, navigate to the Manage-gt;Server Nodes page. Click the Add Server button. You will be prompted to enter the IP address and username/password of the server to add back to the cluster.

    Figure 2.9. Online Upgrade — Adding the Node back to the Cluster

    Online Upgrade — Adding the Node back to the Cluster

  8. The Pending Rebalance count will indicate that servers need to be rebalanced into the cluster. Click Rebalance to rebalance the cluster, and bring the node back into production.

You will need to repeate the above sequence for each node within the cluster in order to upgrade the entire cluster to the new version.

2.3.1.1. Upgrading to Couchbase Server 1.8.1 Using Swap Rebalance

Version Support Note: Couchbase Server 1.8.1

Swap rebalance functionality is available in Couchbase Server 1.8.1.

You can make use of the Swap Rebalance feature to easily and simply upgrade your servers to Couchbase Server 1.8.1, without reducing the performance of your cluster. For background information on the improvements with swap rebalance, see Section 5.3.3, “Swap Rebalance”.

Note

You must apply a patch to enable the swap rebalance functionality during upgrade. See step 3 below.

You will need one spare node to start the upgrade process.

  1. Install Couchbase Server 1.8.1 on one spare node.

  2. Add the new node with Couchbase Server 1.8.1 to the cluster.

    Warning

    For swap rebalance to take effect, the number of nodes being removed and added to the cluster must be identical. Do not rebalance the cluster until the new Couchbase Server 1.8.1 node has become orchestrator of the new cluster.

    You must wait for the new node to be identified within the cluster and identify itself itself as the orchestrator node. This will ensure that the node will manage the rebalance operation and perform a swap rebalance operation. You can check for this by opening the Log portion of the Web UI for the following sequence of messages attributed to the new node:

    Node ns_1@10.3.2.147 joined cluster
    Haven't heard from a higher priority node or a master, so I'm taking over.
    Current master is older and I'll try to takeover (repeated 1 times)

    Once the new node has been assigned as the orchestrator, all rebalances performed will be swap rebalances, assuming they meet the swap rebalance criteria.

  3. Download the patch from http://packages.couchbase.com/releases/1.8.1/MB-5895.erl. This patch must be applied only for the first rebalance to enable swap rebalance during the upgrade process.

    You must apply the patch to the newley added Couchbase Server 1.8.1 node. To apply the patch:

    • For Linux:

      Execute the following command on the new Couchbase Server 1.8.1 node:

      shell> /opt/couchbase/bin/curl -v --user Administrator:password -X POST  \
          -d @MB-5895.erl http://localhost:8091/diag/eval

      The output should be similar to the following, showing the connection opened without an explicit server response:

      * About to connect() to localhost port 8091 (#0)
      *   Trying 127.0.0.1... connected
      * Connected to localhost (127.0.0.1) port 8091 (#0)
      * Server auth using Basic with user 'Administrator'
      > POST /diag/eval HTTP/1.1
      > Authorization: Basic QWRtaW5pc3RyYXRvcjpUYW1zaW4=
      > User-Agent: curl/7.21.4-DEV (i686-pc-linux-gnu) libcurl/7.21.4-DEV zlib/1.2.3.4
      > Host: localhost:8091
      > Accept: */*
      > Content-Length: 1797
      > Content-Type: application/x-www-form-urlencoded
      > Expect: 100-continue
      >
      < HTTP/1.1 100 Continue
      < HTTP/1.1 200 OK
      < Server: MochiWeb/1.0 (Any of you quaids got a smint?)
      < Date: Tue, 17 Jul 2012 15:29:17 GMT
      < Content-Length: 2
      <
      * Connection #0 to host localhost left intact
      * Closing connection #0

      If the command fails for any reason, please verify the command and resubmit.

    • For Windows:

      Open a command prompt and execute the following command on the new Couchbase Server 1.8.1 node using the following command:

      shell> C:\Program Files\Couchbase\Server\bin>curl -v --user Administrator:password -X POST \
           -d @MB-5895.erl http://localhost:8091/diag/eval

      The output should be similar to the following, showing the connection opened and no explicit error response from the server:

      * timeout on name lookup is not supported
      * About to connect() to localhost port 8091 (#0)
      *   Trying 127.0.0.1... connected
      * Connected to localhost (127.0.0.1) port 8091 (#0)
      * Server auth using Basic with user 'Administrator'
      > POST /diag/eval HTTP/1.1
      > Authorization: Basic QWRtaW5pc3RyYXRvcjpUYW1zaW4=
      > User-Agent: curl/7.21.4-DEV (i686-pc-linux-gnu) libcurl/7.21.4-DEV zlib/1.2.3.4
      > Host: localhost:8091
      > Accept: */*
      > Content-Length: 1405
      > Content-Type: application/x-www-form-urlencoded
      > Expect: 100-continue
      >
      < HTTP/1.1 100 Continue
      < HTTP/1.1 200 OK
      < Server: MochiWeb/1.0 (Any of you quaids got a smint?)
      < Date: Tue, 17 Jul 2012 15:29:17 GMT
      < Content-Length: 2
      <
      * Connection #0 to host localhost left intact
      * Closing connection #0

      If the command fails for any reason, please verify the command and resubmit.

  4. Mark one of your existing Couchbase 1.8.0 nodes for removal from the cluster.

  5. Perform a rebalance operation.

    The rebalance will operate as a swap rebalance and move the data directly from the Couchbase 1.8.0 node to the new Couchbase 1.8.1 node.

    You can monitor the progress by viewing the Active vBuckets statistics. This should show the number of active vBuckets in the 1.8.0 node being removed as reducing, and the number of active vBuckets in the new 1.8.1 node increasing.

    You can monitor this through the UI by selecting the vBuckets statistic in the Monitoring section of the Administration Web Console.

    Statistics Monitoring during Swap Rebalance

Repeat steps 1-5 (add/remove and swap rebalance operation), but without the patch upload for all the remaining Couchbase Server 1.8.0 nodes within the cluster so that each node is upgraded to Couchbase Server 1.8.1.

With a Couchbase Server 1.8.1 node in the cluster, you can perform a swap rebalance with multiple nodes, as long as the number of nodes being swapped out, and the number being swapped in are identical. For example, if you have four nodes in your cluster, after the initial rebalance, you can add three new nodes, and remove your existing three 1.8.0 nodes in one rebalance operation.

For more information on swap rebalance, see Section 5.3.3, “Swap Rebalance”.

Once complete, your entire cluster should now be running Couchbase Server 1.8.1.