Search:

Search all manuals
Search this manual
Manual
Membase Manual 1.7
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
3 Getting Started with Membase Server
Chapter Sections
Chapters

3.3. Upgrading to Membase 1.7

3.3.1. Upgrading to Membase Server 1.7.x

Note

In-Place upgrades to 1.7.0 are supported from all versions, but please note the version-specific steps.

Rolling upgrades to 1.7.0 are not supported.

In-Place Upgrades.  It's important to ensure that your disk write queue (Monitoring your disk write queue) has been completely drained before shutting down the Membase Server service. This will ensure that all data has been persisted to disk and will be available after the upgrade. It is a best practice to turn off the application and allow the queue to drain prior to beginning the upgrade.

Before beginning any upgrade, a backup should be taken as a best practice (Section 4.7, “Backup and Restore with Membase”)

Upgrade Steps

  1. Download membase-server- edition_and_arch _1.7.0 and copy it to every node in your cluster.

  2. Turn off your application, so that no requests are going to your Membase cluster.

  3. Ensure that Disk Write Queue size reaches zero (all data has been persisted to disk).

  4. Next, on each individual node (and this may be concurrent):

    1. Backup each node's data using mbbackup

    2. Backup each node's configuration files - While the upgrade script will perform a backup of the configuration and data files, it is our recommended best practice to take your own backup of the files located at:

      /etc/opt/membase/PREVIOUS_VERSION/ns_1/config.dat
      /etc/opt/membase/PREVIOUS_VERSION/ip
      /var/opt/membase/PREVIOUS_VERSION/data/ns_1/

      Under Windows, they are located at

      c:\program files\membase\server\config\ns_1\config.dat
      c:\program files\membase\server\data\ns_1

      Important

      If you have multiple version subdirectories in your /etc/opt/membase directory, you must first cleanup the directory so only the last, most recent version remains. This can happen if you've been regularly upgrading, such as from 1.6.5 to 1.6.5.3 to 1.6.5.4. In this case, move the /etc/opt/membase/1.6.5 and /etc/opt/membase/1.6.5.3 subdirectories to a different place. That is, only the /etc/opt/membase/1.6.5.4 subdirectory should remain when you "ls /etc/opt/membase".

    3. Use platform specific upgrade commands to upgrade each node to 1.7.0, as root or using sudo

      Red Hat / CentOS:

      rpm -U membase-server-edition_and_arch_1.7.0.rpm

      Ubuntu:

      dpkg -i membase-server-edition_and_arch_1.7.0.deb

      Windows:

      membase-server-edition_and_arch_1.7.0_setup.exe
  5. The previous upgrade command will stop membase, install 1.7.0, upgrade configuration files and data records, uninstall the previous version, and restart the membase server.

  6. If your previous version was < 1.6.5 (such as 1.6.0, 1.6.1, 1.6.3), you will need to also run the following of manually creating a symbolic-link:

    /etc/init.d/membase-server stop
    mkdir -p /opt/membase/1.6.1
    ln -s /var/opt/membase/1.6.1/data /opt/membase/1.6.1/data
    /etc/init.d/membase-server start

    Note

    This step is not applicable to Windows.

  7. After every node has been upgraded and restarted, and you can follow the steps below to monitor its progress of "warming up"

  8. Turn your application back on.

Manually Controlled Upgrade Options

Note

This section is not applicable to Windows.

By using environment variable flags, you may also optionally take more control of the upgrade steps. The available environment variables are:

Example flag usage:

Using mbupgrade manually

After using the INSTALL_DONT_AUTO_UPGRADE option, you can use the /opt/membase/bin/mbupgrade program later to fully control the upgrade steps.

It's command-line options include:

Usage: mbupgrade [-c path/to/previous/config/dir] [-a AUTO] [-d FILENAME] [-n] [-s FACTOR]

  -c <path/to/previous/config/dir>
       -- example: -c /etc/opt/membase/1.6.5.3.1

  -a <yes|no>
       -- automatic or non-interactive mode; default is 'no';
          'yes' to force automatic 'yes' answers to all questions

  -d <dbdir_output_file>
       -- retrieve db directory from config file and exit

  -n   -- dry-run; don't actually change anything

  -s <free_disk_space_needed_factor>
       -- free disk space needed, as a factor of current bucket usage
       -- default value is 2.0
       -- example: -s 1.0

Dry-run of mbupgrade

Warning

This section is not applicable to Windows.

The mbupgrade program can be run using the -n flag, which tells mbupgrade to not modify any files, but just describe the changes it would make. An example dry-run output would be:

[root@Config126VM0 ~]# /opt/membase/bin/mbupgrade -c /etc/opt/membase/1.6.4 -n
Dry-run mode: no actual upgrade changes will be made.
Upgrading your Membase Server to basestar-352-gad964c0.
The upgrade process might take awhile.
Analysing...
Target node: ns_1@127.0.0.1

Membase should not be running.
  Please use: /etc/init.d/membase-server stop
Is the Membase server already stopped? [yes|no]
yes

Database dir: /var/opt/membase/1.6.4/data/ns_1
Is that the expected database directory to upgrade? [yes|no]
yes

Buckets to upgrade: default
Are those the expected buckets to upgrade? [yes|no]
yes

Checking disk space available for buckets in directory:
  /var/opt/membase/1.6.4/data/ns_1
  Free disk bucket space wanted: 98304.0
  Free disk bucket space available: 7306170368
  Free disk space factor: 2.0
  Ok.

Analysis complete.
Proceed with config & data upgrade steps? [yes|no]
yes

SKIPPED (dry-run): Copying /etc/opt/membase/1.6.4/ns_1/config.dat.rpmsave
SKIPPED (dry-run):     cp /etc/opt/membase/1.6.4/ns_1/config.dat.rpmsave /opt/membase/var/lib/membase/config/config.dat
Ensuring bucket data directories.
SKIPPED (dry-run): Ensuring bucket data directory: /var/opt/membase/1.6.4/data/ns_1/default-data
SKIPPED (dry-run):     mkdir -p /var/opt/membase/1.6.4/data/ns_1/default-data
SKIPPED (dry-run): Ensuring dbdir owner/group: /var/opt/membase/1.6.4/data/ns_1
SKIPPED (dry-run):     chown -R membase:membase /var/opt/membase/1.6.4/data/ns_1
Upgrading buckets.
SKIPPED (dry-run): Upgrading bucket: default
SKIPPED (dry-run):     /opt/membase/bin/mbdbupgrade /var/opt/membase/1.6.4/data/ns_1/default /var/opt/membase/1.6.4/data/ns_1/default-data
SKIPPED (dry-run): Ensuring bucket owner/group: /var/opt/membase/1.6.4/data/ns_1/default-data
SKIPPED (dry-run):     chown -R membase:membase /var/opt/membase/1.6.4/data/ns_1/default-data

Done.
[root@Config126VM0 ~]#

Useful commands