Buy Percona ServicesBuy Now!

Upgrading Percona XtraDB Cluster

This guide describes the procedure for upgrading Percona XtraDB Cluster version 5.6 to the latest version 5.7 without downtime (rolling upgrade). This means that replication between nodes will continue during the upgrade.

Rolling upgrade from earlier versions to 5.7 is not supported. If you are running Percona XtraDB Cluster version 5.5, it is recommended to shut down all nodes, then remove and re-create the cluster from scratch. Alternatively, you can perform a rolling upgrade from PXC 5.5 to 5.6, and then follow the current procedure to upgrade from 5.6 to 5.7.

The following documents contain details about relevant changes in the 5.7 series of MySQL and Percona Server. Make sure you deal with any incompatible features and variables mentioned in these documents when upgrading to Percona XtraDB Cluster 5.7.

To upgrade the cluster, follow these steps for each node:

  1. Make sure that all nodes are synchronized.

  2. Stop the mysql service:

    $ sudo service mysql stop
    
  3. Remove existing Percona XtraDB Cluster and Percona XtraBackup packages, then install Percona XtraDB Cluster version 5.7 packages. For more information, see Installing Percona XtraDB Cluster.

    For example, if you have Percona software repositories configured, you might use the following commands:

    • On CentOS or RHEL:

      $ sudo yum remove percona-xtrabackup* Percona-XtraDB-Cluster*
      $ sudo yum install Percona-XtraDB-Cluster-57
      
    • On Debian or Ubuntu:

      $ sudo apt-get remove percona-xtrabackup* percona-xtradb-cluster*
      $ sudo apt-get install percona-xtradb-cluster-57
      
  4. In case of Debian or Ubuntu, the mysql service starts automatically after install. Stop the service:

    $ sudo service mysql stop
    
  5. Back up grastate.dat, so that you can restore it if it is corrupted or zeroed out due to network issue.

  6. Start the node outside the cluster by setting the wsrep_provider variable to none. For example:

    sudo mysqld --skip-grant-tables --user=mysql --wsrep-provider='none'
    

    Note

    As of Percona XtraDB Cluster 5.7.6, the --skip-grant-tables option is not required.

  7. Open another session and run mysql_upgrade.

  8. When the upgrade is done, stop the mysqld process. You can either run sudo kill on the mysqld process ID, or sudo mysqladmin shutdown with the MySQL root user credentials.

    Note

    On CentOS, the my.cnf configuration file is renamed to my.cnf.rpmsave. Make sure to rename it back before joining the upgraded node back to the cluster.

  9. Now you can join the upgraded node back to the cluster.

    In most cases, starting the mysql service should run the node with your previous configuration:

    $ sudo service mysql start
    

    For more information, see Adding Nodes to Cluster.

    Note

    As of version 5.7, Percona XtraDB Cluster runs with PXC Strict Mode enabled by default. This will deny any unsupported operations and may halt the server upon encountering a failed validation.

    If you are not sure, it is recommended to first start the node with the pxc_strict_mode variable set to PERMISSIVE:

    $ sudo mysqld --pxc-strict-mode=PERMISSIVE
    

    After you check the log for any experimental or unsupported features and fix any encountered incompatibilities, you can set the variable back to ENFORCING at run time:

    mysql> SET pxc_strict_mode=ENFORCING;
    
  10. Repeat this procedure for the next node in the cluster until you upgrade all nodes.

Visit Percona Store


General Inquiries

For general inquiries, please send us your question and someone will contact you.