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
Download membase-server-
edition_and_arch _1.7.0 and copy it to
every node in your cluster.
Turn off your application, so that no requests are going to your Membase cluster.
Ensure that Disk Write Queue size reaches zero (all data has been persisted to disk).
Next, on each individual node (and this may be concurrent):
Backup each node's data using mbbackup
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
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".
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.rpmUbuntu:
dpkg -i membase-server-edition_and_arch_1.7.0.debWindows:
membase-server-edition_and_arch_1.7.0_setup.exeThe 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.
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
This step is not applicable to Windows.
After every node has been upgraded and restarted, and you can follow the steps below to monitor its progress of "warming up"
Turn your application back on.
Manually Controlled Upgrade Options
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:
INSTALL_DONT_AUTO_UPGRADE - when set to
'1', the rpm/dpkg command will not automatically invoke the
'mbupgrade' script that's included in 1.7.0. This means the
rpm/dpkg step will not upgrade configuration and will not
upgrade data records, but the rpm/dpkg step will stop membase,
install 1.7.0 software and uninstall the previous version.
INSTALL_DONT_START_SERVER - when set to
'1', the rpm/dpkg command will not automatically start the
membase server as its last step. If you use the
INSTALL_DONT_AUTO_UPGRADE flag, you should also specify the
INSTALL_DONT_START_SERVER=1 flag.
Example flag usage:
For RedHat / CentOS
INSTALL_DONT_START_SERVER=1 INSTALL_DONT_AUTO_UPGRADE=1 rpm -U membase-server-community_x86_64_1.7.0.rpmFor Ubuntu
INSTALL_DONT_START_SERVER=1 INSTALL_DONT_AUTO_UPGRADE=1 dpkg -i membase-server-community_x86_64_1.7.0.debExample output when using flags:
[root@Config126VM0 ~]# INSTALL_DONT_START_SERVER=1 INSTALL_DONT_AUTO_UPGRADE=1 rpm -U membase-server-community_x86_64_basestar-352-gad964c0.rpm Stopping membase ... Stopping Membase server[ OK ] Upgrading membase ... /opt/membase/bin/mbupgrade -c /etc/opt/membase/1.6* -a yes Skipping mbupgrade due to INSTALL_DONT_AUTO_UPGRADE ... Skipping server start due to INSTALL_DONT_START_SERVER ... You have successfully installed Membase Server. Please browse to http://test-centos-02: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: 11211, 11210, 4369, 8091 and from 21100 to 21299. By using this software you agree to the End User License Agreement. See /opt/membase/LICENSE.txt. Stopping Membase server[FAILED] warning: /etc/opt/membase/1.6.4/ns_1/config.dat saved as /etc/opt/membase/1.6.4/ns_1/config.dat.rpmsave [root@Config126VM0 ~]#
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
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
General
Make sure to run as root and use sudo -u membase
command where necessary. On
Windows, it is recommended to run as Administrator.
Stop Membase Service
service membase-server stopor
/etc/init.d/membase-server stopOn Windows:
net stop membaseserverBackup Config Files
sudo -u membase cp /etc/opt/membase/previous_version/ns_1/config.dat /tmp sudo -u membase cp /etc/opt/membase/previous_version/ip /tmp/
On Windows:
copy c:\program files\membase\server\config\ns_1\config.dat c:\temp copy c:\program files\membase\server\ip c:\temp
Backup Data files
sudo -u membase mkdir /tmp/membase_data_backup
sudo -u membase cp -r /opt/membase/previous_version/data/ns_1 /tmp/membase_data_backupOn Windows:
xcopy /e c:\program files\membase\data\ns_1 c:\temp\backup