Downgrade OpenResty Edge

1. Downgrade Edge Admin

  • Download Installer
curl -O https://openresty.com/client/oredge/openresty-edge-installer.sh
  • Run installer
sudo /bin/bash openresty-edge-installer.sh
  • Enter the action you want to perform Downgrade
What would you like to do?
[1] Install
[2] Upgrade
[3] Downgrade
[4] Uninstall
2
What you choose is: Downgrade.
  • Enter the version you want to downgrade (Version before upgrade)
Which version would you like to downgrade to? (like 22.6.1-1)
22.6.1-1
  • Enter the component you want to downgrade Edge Admin
Which component would you like to downgrade?
[1] Edge Admin
[2] Edge Admin DB
[3] Rebuild
[4] Edge Node
[5] Log Server
[6] Log Server DB
1
What you choose is: Edge Admin.
  • Enter the corresponding version of openresty-plus
Which version of openresty-plus would you like to downgrade to? (like 1.19.9.1.3-1)
1.19.9.1.15-1
  • If successful, the following prompt will be displayed at the end
Great! Downgrade openresty-edge-admin successfully.

2. Downgrade Edge Admin database

  • The procedure is the same, with the component Edge Admin DB selected for the upgrade
Which component would you like to downgrade?
[1] Edge Admin
[2] Edge Admin DB
[3] Rebuild
[4] Edge Node
[5] Log Server
[6] Log Server DB
2
What you choose is: Edge Admin DB.
  • Enter the current version
Which version are you currently on? (like 22.6.1)
22.6.1
  • If successful, the following prompt will be displayed at the end
Great! update admin database successfully.

3. Recompile

  • The procedure is the same, with the component Rebuild selected for the upgrade
Which component would you like to downgrade?
[1] Edge Admin
[2] Edge Admin DB
[3] Rebuild
[4] Edge Node
[5] Log Server
[6] Log Server DB
3
What you choose is: Rebuild.
  • Recompile a few applications that do not contain wildcard domains with less traffic first. Recompile several high-traffic applications that do not contain wildcard domains later.
Do you want to rebuild one application for test? [Y/N]:  y
Please input the application id: 1
rebuild application 1
  • Continue to follow the prompts to compile
Do you want to rebuild upgrade config? [Y/N]:  y
rebuild upgrade config
recompile upgrade configurations successfully

Do you want to rebuild all wildcard apps? [Y/N]:  y
rebuild all wildcard apps

Do you want to rebuild all apps? [Y/N]:  y
Do you want to compile concurrently? [Y/N]:  n
rebuild all apps

Do you want to rebuild all http_proxy apps? [Y/N]:  y
rebuild all http_proxy apps

Do you want to rebuild all socks5_apps? [Y/N]:  y
rebuild all sock5_proxy apps

Do you want to rebuild global? [Y/N]:  y
rebuild global
recompile global successfully

Do you want to rebuild waf? [Y/N]:  y
rebuild waf
recompiled all of the WAF rule sets successfully.

Do you want to rebuild dns? [Y/N]:  y
rebuild dns
recompile dns successfully.

Do you want to rebuild global-action? [Y/N]:  y
rebuild global-action
recompile global action successfully

Do you want to rebuild gateway? [Y/N]:  y
rebuild gateway
recompiled gateway successfully

rebuild done!

If the whole system behaves normally, the upgrade is complete!

This step may take longer to compile when there are many HTTP/HTTPS applications.

Do you want to rebuild all apps? [Y/N]:  y

We can choose concurrent compilation, which will start 4 processes to compile.

Do you want to compile concurrently? [Y/N]:  y

If that is not fast enough, you can modify the installer to specify a larger concurrency, but not larger than 8, e.g.

sudo /bin/bash utils/parallel-recompile.sh 8

4. Downgrade Edge Node

4.1 Migrate traffic(optional)

To avoid disrupting operations, before a Edge Node is upgraded, migrate the traffic on that Edge Node to another Edge Node that is not upgraded. This step is optional, but is highly recommended for the few Edge Nodes that are initially upgraded.

  • migrate away traffic
  • Upgrade
  • Verify

After it is OK, upgrade the remaining Edge Node without migrating traffic. Also, please pay attention to the error logs during the upgrade process.

If you are using the OpenResty Edge’s DNS to control traffic, follow these steps to migrate traffic.

Access the OpenResty Edge console:

  • Enter the [Gateway Clusters].
  • [Edit] The cluster where the node is located.
  • Modify the node’s [status] to [Disable DNS, disable caching cluster].
  • [Save]

Wait for the node no longer to have traffic or only a small amount of traffic. You could confirm by checking the access log:

tail -f /usr/local/oredge-node/logs/access.log

4.2 Downgrade

  • The procedure is the same, with the component Edge Node selected for the downgrade
Which component would you like to downgrade?
[1] Edge Admin
[2] Edge Admin DB
[3] Rebuild
[4] Edge Node
[5] Log Server
[6] Log Server DB
4
What you choose is: Edge Node.
  • If successful, the following prompt will be displayed at the end
Great! Downgrade openresty-edge-node successfully.

5. Downgrade Log Server

  • The procedure is the same, with the component Log Server selected for the upgrade
Which component would you like to downgrade?
[1] Edge Admin
[2] Edge Admin DB
[3] Rebuild
[4] Edge Node
[5] Log Server
[6] Log Server DB
5
What you choose is: Log Server.
  • If successful, the following prompt will be displayed at the end
Great! Downgrade openresty-edge-log-server successfully.

6. Downgrade Log Server Database

  • The procedure is the same, with the component Log Server DB selected for the upgrade
Which component would you like to downgrade?
[1] Edge Admin
[2] Edge Admin DB
[3] Rebuild
[4] Edge Node
[5] Log Server
[6] Log Server DB
2
What you choose is: Log Server DB.
  • Enter the current version
Which version are you currently on? (like 22.6.1)
22.6.1
  • If successful, the following prompt will be displayed at the end
Great! Downgrade log-server database successfully.

If you have any questions, please get in touch with us.