By using the hot upgrade feature, users can quickly and safely upgrade the EMQX in the production environment, and avoid the decrease in system availability caused by restarting the service.
TIP
Currently EMQX for Windows and MacOSX does not support hot upgrade feature.
WARING
WARING
Hot upgrade between EMQX (opensource) and EMQX Enterprise is not allowed, please operate with caution.
- View the currently installed version list of EMQX.
- Download the software package to be upgraded from the EMQX website.
Visit , Select the corresponding version and operating system type, and then select the “zip” package type.
- Find the installation directory of EMQX:
$ EMQX_ROOT_DIR=$(emqx root_dir)
$ echo ${EMQX_ROOT_DIR}
"/usr/lib/emqx"
- Put the downloaded zip package in the
releases
directory under the EMQX installation directory:
$ cp emqx-4.2.1.zip ${EMQX_ROOT_DIR}/releases/
- Upgrade to the specified version:
- Check the version list again, and the status of the previous version will become
old
:
$ emqx versions
Installed versions:
* 4.2.0 old
The above emqx upgrade 4.2.1
command actually performs three actions:
unpack
install
permanent
If you don’t want to persist while upgrading, you can use the --no-permanent
parameter:
Release 4.2.1 not found, attempting to unpack releases/emqx-4.2.1.tar.gz
Unpacked successfully: "4.2.1"
Installed Release: 4.2.1
At this time, the version has been successfully upgraded to 4.2.1. However, if you restart EMQX, it will revert to the old version 4.2.0. Now, if you check the version list, you will find that the state of 4.2.1 is , not the permanent version:
After the system has been running stably for a period of time, if you decide to make the new version permant, you can execute the install
command again:
$ emqx install 4.2.1
Release 4.2.1 is already installed and current, making permanent.
Made release permanent: "4.2.1"
If you find a problem and want to roll back after the upgrade, you can execute the version downgrade command. For example, the following example will roll back EMQX to version 4.2.0:
$ emqx downgrade 4.2.0
Release 4.2.0 is marked old, switching to it.
Made release permanent: "4.2.0"