In the general case, upgrading from etcd 2.0 to 2.1 can be a zero-downtime, rolling upgrade:- one by one, stop the etcd v2.0 processes and replace them with etcd v2.1 processes- after you are running all v2.1 processes, new features in v2.1 are available to the cluster

    Before , read through the rest of this guide to prepare.

    To upgrade an existing etcd deployment to 2.1, you must be running 2.0. If you’re running a version of etcd before 2.0, you must upgrade to 2.0 before upgrading to 2.1.

    Also, to ensure a smooth rolling upgrade, your running cluster must be healthy. You can check the health of the cluster by using command.

    Preparedness

    Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment.

    etcd 2.1 introduces a new feature, which is disabled by default. If your deployment depends on these, you may want to test the auth features before enabling them in production.

    While upgrading, an etcd cluster supports mixed versions of etcd members. The cluster is only considered upgraded once all its members are upgraded to 2.1.

    Internally, etcd members negotiate with each other to determine the overall etcd cluster version, which controls the reported cluster version and the supported features. For example, if you are mid-upgrade, any 2.1 features (such as the the authentication feature mentioned above) won’t be available.

    Limitations

    If you encounter any issues during the upgrade, you can attempt to restart the etcd process in trouble using a newer v2.1 binary to solve the problem. One known issue is that etcd v2.0.0 and v2.0.2 may panic during rolling upgrades due to an existing bug, which has been fixed since etcd v2.0.3.

    It might take up to 2 minutes for the newly upgraded member to catch up with the existing cluster when the total data size is larger than 50MB (You can check the size of the existing snapshot to know about the rough data size). In other words, it is safest to wait for 2 minutes before upgrading the next member.

    If all members have been upgraded to v2.1, the cluster will be upgraded to v2.1, and downgrade is not possible. If any member is still v2.0, the cluster will remain in v2.0, and you can go back to use v2.0 binary.

    Please backup your data directory of all etcd members if you want to downgrade the cluster, even if it is upgraded.

    Upgrade Procedure

    1. Check upgrade requirements.

    2. Stop the existing etcd process

    You will see similar error logging from other etcd processes in your cluster. This is normal, since you just shut down a member.

    1. 2015/06/23 15:45:09 sender: the connection with 6e3bd23ae5f1eae0 became inactive
    2. 2015/06/23 15:45:11 rafthttp: server streaming to 6e3bd23ae5f1eae0 at term 2 has been stopped
    3. 2015/06/23 15:45:11 stream: error sending message: stopped

    You could for data safety.

    3. Drop-in etcd v2.1 binary and start the new etcd process

    You will see the etcd publish its information to the cluster.

      4. Repeat step 2 to step 3 for all other members

      5. Finish

      When all members are upgraded, you will see the cluster is upgraded to 2.1 successfully:

      1. 2015/06/23 15:46:35 etcdserver: updated the cluster version from 2.0.0 to 2.1.0