Upgrade from 4.3 to 4.4
EMQX 4.3 and 4.4 nodes co-exist in the same cluster. Hence it’s possible to apply a rolling upgrade of a EMQX cluster. Note that it is the latest version of 4.4 For example: connection_low_watermark_alarm configured for e4.3.7 e4.4.1 feature. If you upgrade from e4.3.7 to e4.4.0, it will not be recognized and you need to upgrade to e4.4.1. So it is recommended to upgrade to the latest version of 4.4.
The upgrade steps of each EMQX node are summarised below:
- Optional: remove the node from load-balancer
- Stop the node, (e.g.
emqx stop,systemctl stop emqx) - Backup ‘data’ and ‘etc’ directories. (more details below)
- Uninstall v4.3
- Install v4.4, and restore the backup directories for ‘data’ and ‘etc’
- Start v4.4, and monitor alerts/error logs
- Optional: add the node back to the load-balancer
Data and config backup
Before upgrading, please make sure to backup data and etc directories. The data directory can be located in below possible paths depending on installation and configuration.
- Where the environment variable
EMQX_NODE__DATA_DIRpoints to - Where the
node.data_dirconfig key points to inemqx.conf /opt/emqx/datawhen running in docker (typically a mounted volume)<install-path>/datawhen installed from zip package extraction/var/lib/emqx/datawhen installed from RPM or DEB packages
Take RPM or DEB installation for example.
## Create a backup dirmkdir -p ~/emqx-backup/etc/mkdir -p ~/emqx-backup/data/## Ensure EMQX is stoppedsystemctl stop emqxsystemctl status emqx## Copy the directoriescp -r /etc/emqx ~/emqx-backup/etc/cp -r /var/lib/emqx/ ~/emqx-backup/data/
Uninstall v4.3
- Taking RPM installation for example
## Inspect the current installationrpm -qa | grep emqx## uninstallrpm -e emqx-4.3.x-x.x86_64
Install v4.4 and restore data and config from backup
- Taking RPM installation for example
rpm -ivh emqx-4.4.0-otp24.1.5-3-centos7-amd64.rpm
- Restore the data and config from backup
cp -r ~/emqx-backup/etc/ /etc/emqx/cp -r ~/emqx-backup/data/ /var/lib/emqx/
Start v4.4
- Taking systemctl for example
# Startsystemctl start emqx# Check statussystemctl status emqx
Monitor the new service
- Check clustering status
The v4.4 node should automatically re-join the cluster
/usr/bin/emqx_ctl cluster status
- Inspect the logs to make sure everything is working as expected
## Find the latest log rotation filels -htl /var/log/emqx/emqx.log.*[0-9] | head -n 1## Check the latest (100) lines where N is the latest rotation found abovetail -f -n 100 /var/log/emqx/emqx.log.N
- Check EMQX dashboard to see if the node is running as expected.
