# 1. Upgrade OpenResty Edge Node

Upgrade 1 Nodes first, and then upgrade all Node after there are no problems, please pay attention to the error log during the upgrade.

  • Take the Node you want to upgrade offline.
    • 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 to no longer have traffic. You could confirm by checking the access log: tail -f /usr/local/oredge-node/logs/access.log
  • Upgrade:
// Copy [% customer %]-openresty-edge-node-prod-[% os %]-[% date %].tar.gz to the current directory
tar -zxvf [% customer %]-openresty-edge-node-[% os %]-[% date %].tar.gz
cd [% customer %]-openresty-edge-node-[% os %]-[% date %]

// The installation process may need to download some third-party dependencies
sudo bash -x upgrade-openresty-edge-node.sh

If you encounter any error, you can rollback:

sudo yum downgrade -y openresty-edge-node-prod-[% package-version-number %].noarch
sudo systemctl start upgrade-oredge-node

# 2. Upgrade OpenResty Edge Log Server

  • Upgrade postgresql timescaledb(we need to perform this step if our Log Server version <= 0.0.1.88

    • Install postgresql timescaledb:

        // Copy [% customer %]-openresty-postgresql-timescaledb-[% os %]-[% date %].tar.gz to the current directory
        tar -zxvf [% customer %]-openresty-postgresql-timescaledb-[% os %]-[% date %].tar.gz
        cd [% customer %]-openresty-postgresql-timescaledb-[% os %]-[% date %]
        sudo bash -x install-openresty-postgresql-timescaledb.sh
      
    • Configure postgresql timescaledb:

      If your version of PostgreSQL is 9: (rpm -q openresty-postgresql)

      // The path of postgresql.conf is modified according to the actual, the following is the default path
      (sudo grep -vF "shared_preload_libraries = 'timescaledb'" /var/postgres/data/postgresql.conf; echo "shared_preload_libraries = 'timescaledb'") | sudo tee /var/postgres/data/postgresql.conf
       sudo /etc/init.d/openresty-postgresql restart
      

      If your version of PostgreSQL is 12:(rpm -q openresty-postgresql12)

      // The path of postgresql.conf is modified according to the actual, the following is the default path
      (sudo grep -vF "shared_preload_libraries = 'timescaledb'" /var/postgres12/data/postgresql.conf; echo "shared_preload_libraries = 'timescaledb'") | sudo tee /var/postgres12/data/postgresql.conf
      sudo /etc/init.d/openresty-postgresql12 restart
      
  • Upgrade database

sh update-log-server-db-[% date %]-[% start-version %]-[% end-version %].sh
  • Upgrade log server
// Copy [% customer %]-openresty-edge-log-server-[% os %]-[% date %].tar.gz to the current directory
tar -zxvf [% customer %]-openresty-edge-log-server-[% os %]-[% date %].tar.gz
cd [% customer %]-openresty-edge-log-server-[% os %]-[% date %]
sudo bash -x upgrade-openresty-edge-log-server.sh

If you encounter any error, you can rollback:

sudo yum downgrade -y openresty-edge-log-server-prod-[% package-version-number %].noarch
sudo systemctl start upgrade-oredge-log-server

# 3. Upgrade OpenResty Edge Admin

  • Upgrade database
sh update-admin-db-[% date %]-[% start-version %]-[% end-version %].sh

// if this step has been performed before, you do not need to perform it again
sh update-admin-db-waf-[% date %].sh
  • Upgrade admin
// Copy [% customer %]-openresty-edge-admin-[% os %]-[% date %].tar.gz to the current directory
tar -zxvf [% customer %]-openresty-edge-admin-[% os %]-[% date %].tar.gz
cd [% customer %]-openresty-edge-admin-[% os %]-[% date %]

// The installation process may need to download some third-party dependencies
sudo bash -x upgrade-openresty-edge-admin.sh

If you encounter any error, you can rollback:

sudo yum downgrade -y openresty-edge-admin-prod-[% package-version-number %].noarch.rpm
sudo systemctl start upgrade-oredge-admin

# 4. recompile

  1. It is recommended to recompile the application in the following order:

    1. Recompile a few applications with less traffic first 2) Recompile several high-traffic applications 3) Recompile all applications 4) Recompile global rules
    cd /usr/local/oredge-admin/
    # recompile the specified application (replace APP-ID with application ID)
    sudo bash utils/recompile-apps.sh http APP-ID
    # recompile all applications
    sudo bash utils/recompile-apps.sh http
    sudo bash utils/recompile-apps.sh http_proxy
    sudo bash utils/recompile-apps.sh socks5_proxy
    # recompile global rules
    sudo bash utils/recompile-apps.sh global
    # recompile waf rules
    sudo bash utils/recompile-apps.sh waf
    # recompile DNS applications
    sudo bash utils/recompile-apps.sh dns
    # recompile global actions
    sudo bash utils/recompile-apps.sh global-action
    # recompile gateway (may trigger OpenResty Edge Node reload)
    sudo bash utils/recompile-apps.sh gateway
    

If you have any questions, please contact us.