Rolling Upgrades
Riak nodes now negotiate with each other to determine supported operating modes. This allows clusters containing mixed-versions of Riak to properly interoperate without special configuration, and simplifies rolling upgrades.
In previous Riak versions, users were required to disable new features during the rolling upgrade process, and then enable them after all nodes were upgraded. This is now handled automatically by Riak.
If you are upgrading from Riak Search, please read Upgrading from Riak Search before performing a rolling upgrade.
Debian/Ubuntu
The following example demonstrates upgrading a Riak node that has been installed with the Debian packages provided by Basho.
1. Stop Riak
riak stop
2. Backup Riak etc and data directories
sudo tar -czf riak_backup.tar.gz /var/lib/riak /etc/riak
3. Upgrade Riak
sudo dpkg -i <riak_package_name>.deb
4. Restart Riak
riak start
5. Verify Riak is running the new version
riak-admin status
6. Wait for the riak_kv service to start
riak-admin wait-for-service riak_kv <target_node>
- <target_node> is the node which you have just upgraded (e.g. riak@192.168.1.11)
7. Wait for any hinted handoff transfers to complete
riak-admin transfers
- While the node was offline other nodes may have accepted writes on it's behalf. This data is transferred to the node when it becomes available.
8. Repeat the process for the remaining nodes in the cluster
RHEL/Centos
The following example demonstrates upgrading a Riak node that has been installed with the RHEL/Centos packages provided by Basho.
1. Stop Riak
riak stop
2. Backup Riak etc and data directories
sudo tar -czf riak_backup.tar.gz /var/lib/riak /etc/riak
3. Upgrade Riak
sudo rpm -Uvh <riak_package_name>.rpm
4. Restart Riak
riak start
5. Verify Riak is running the new version
riak-admin status
6. Wait for the riak_kv service to start
riak-admin wait-for-service riak_kv <target_node>
- <target_node> is the node which you have just upgraded (e.g. riak@192.168.1.11)
7. Wait for any hinted handoff transfers to complete
riak-admin transfers
- While the node was offline other nodes may have accepted writes on it's behalf. This data is transferred to the node when it becomes available.
8. Repeat the process for the remaining nodes in the cluster
9. Once all nodes have been upgraded, add the following additions to the
app.config file in /etc/riak on each node. First add to the riak_kv section:
{legacy_keylisting, false},
{mapred_system, pipe},
{vnode_vclocks, true}
and then add to the riak_core section:
{platform_data_dir, "/var/lib/riak"}
10.\ Either run riak stop followed by riak start on all of the nodes in
the cluster or use riak attach on each node and execute the following
commands:
> application:set_env(riak_kv, legacy_keylisting, false). > application:set_env(riak_kv, mapred_system, pipe). > application:set_env(riak_kv, vnode_vclocks, true).
Solaris/OpenSolaris
The following example demonstrates upgrading a Riak node that has been installed with the Solaris/OpenSolaris packages provided by Basho.
1. Stop Riak
riak stop
“bash sudo svcadm disable riak ”
2. Backup Riak etc and data directories
sudo gtar -czf riak_backup.tar.gz /opt/riak/data /opt/riak/etc
3. Uninstall Riak
sudo pkgrm BASHOriak
4. Install the new version of Riak
sudo pkgadd -d <riak_package_name>.pkg
4. Restart Riak
riak start
“bash sudo svcadm enable riak ”
5. Verify Riak is running the new version
riak-admin status
6. Wait for the riak_kv service to start
riak-admin wait-for-service riak_kv <target_node>
- <target_node> is the node which you have just upgraded (e.g. riak@192.168.1.11)
7. Wait for any hinted handoff transfers to complete
riak-admin transfers
- While the node was offline other nodes may have accepted writes on it's behalf. This data is transferred to the node when it becomes available.
8. Repeat the process for the remaining nodes in the cluster
