Chapter 38. Rolling Upgrades

38.1. Performing Rolling Upgrades

Upgrade Red Hat JBoss Data Grid clusters without downtime or data loss.

You can perform rolling upgrades only:

  • in Remote Client-Server mode.
  • using the Hot Rod protocol.

38.1.1. Setting Up the Target Cluster

The target cluster is the desired version of JBoss Data Grid to which you migrate data.

Note

Rolling upgrades are supported from JBoss Data Grid version 6.6.2.

  1. Start the target cluster with unique network properties or a different JGroups cluster name to keep it separate from the source cluster.
  2. Configure a RemoteCacheStore on each node in the target cluster for each cache you want to migrate from the source cluster.

    Note

    The RemoteCacheStore on the target cluster is in addition to any other persistent store.

    RemoteCacheStore settings
    • remote-server must point to the source cluster via the outbound-socket-binding property.
    • remoteCacheName must match the cache name on the source cluster.
    • hotrod-wrapping must be true (enabled).
    • shared must be true (enabled).
    • purge must be false (disabled).
    • passivation must be false (disabled).
    • protocol-version matches the Hot Rod protocol version of the source cluster.

      JBoss Data Grid Version

      Hot Rod Protocol Version

      7.2

      2.6

      7.1

      2.6

      7.0

      2.5

      6.6.2

      2.4 (Requires 2.5.)
      If you plan to perform a rolling upgrade from JBoss Data Grid version 6.6.2, contact your Red Hat support team to upgrade to Hot Rod version 2.5.

Example RemoteCacheStore Configuration

<distributed-cache>
   <remote-store cache="MyCache" socket-timeout="60000" tcp-no-delay="true" protocol-version="2.5" shared="true" hotrod-wrapping="true" purge="false" passivation="false">
      <remote-server outbound-socket-binding="remote-store-hotrod-server"/>
   </remote-store>
</distributed-cache>
...
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
  ...
  <outbound-socket-binding name="remote-store-hotrod-server">
     <remote-destination host="198.51.100.0" port="11222"/>
  </outbound-socket-binding>
  ...
</socket-binding-group>

38.1.2. Migrating Data to the Target Cluster

  1. Configure the target cluster to handle all client requests instead of the source cluster:

    1. Configure all clients to point to the target cluster instead of the source cluster.
    2. Restart each client node.

      The target cluster lazily loads data from the source cluster on demand via RemoteCacheStore.

  2. Fetch data from the source cluster.

    Note

    You synchronize data on the target cluster to fetch data from the source cluster. If you are migrating from JBoss Data Grid 6.6.2, you must synchronize data on each node in the target cluster.

    Do one of the following on the target cluster for each cache that you want to migrate:

    JMX
    Invoke the synchronizeData operation and specify the hotrod parameter on the RollingUpgradeManager MBean. See RollingUpgradeManager.
    CLI
    $ JDG_HOME/bin/cli.sh --connect controller=127.0.0.1:9990 -c "/subsystem=datagrid-infinispan/cache-container=clustered/distributed-cache=MyCache:synchronize-data(migrator-name=hotrod)"

    Data migrates to all nodes in the target cluster in parallel, with each node receiving a subset of the data.

    Use the following parameters to tune the operation:

    • read-batch configures the number of entries to read from the source cluster at a time. The default value is 10000.
    • write-threads configures the number of threads used to write data. The default value is the number of processors available.

      For example:

      synchronize-data(migrator-name=hotrod, read-batch=100000, write-threads=3)

The synchronizeData method call is blocking so no other operations are performed until the data migration is complete.

38.1.3. Finalizing Rolling Upgrades

After the target cluster fetches all data from the source cluster, do the following:

  1. Disable the RemoteCacheStore on the target cluster.

    Note

    You must complete this step on each node in the target cluster.

    Do one of the following:

    JMX
    Invoke the disconnectSource operation and specify the hotrod parameter on the RollingUpgradeManager MBean. See RollingUpgradeManager.
    CLI
    $ JDG_HOME/bin/cli.sh --connect controller=127.0.0.1:9990 -c "/subsystem=datagrid-infinispan/cache-container=clustered/distributed-cache=MyCache:disconnect-source(migrator-name=hotrod)"
  2. Decommission the source cluster.