# 1. Upgrade OpenResty Edge Log Server

  • Check and record the software version before the upgrade:

    # centos/redhat/fedora
    rpm -q openresty-edge-log-server
    # or
    rpm -q openresty-edge-log-server-prod
    
    # debian/ubuntu
    dpkg -l | grep openresty-edge-log-server
    # or
    dpkg -l | grep openresty-edge-log-server-prod
    
  • Install timescaledb

If you are using something other than openresty-postgresql, please install the timescaledb plugin yourself; If you have already installed it before, you can skip this step.

```bash
curl -O https://openresty.com/client/oredge/install-edge-postgresql-timscaledb.sh
sudo /bin/bash -x install-edge-postgresql-timscaledb.sh
```
  • Upgrade database

    # If this file is missing, please contact us for confirmation
    # Please replace [% script-version-number %] with the actual version number
    /bin/bash update-log-server-db-[% script-version-number %].sh
    
  • Download upgrade script

    curl -O https://openresty.com/client/oredge/upgrade-edge-log-server.sh
    

    If you get a message like the following:

    curl: command not found
    

    It is possible that curl is not installed on the system or that the system shell program does not contain a search path for curl.

    You can use absolute paths to retry.

    /usr/bin/curl -O https://openresty.com/client/oredge/upgrade-edge-log-server.sh
    

    Your system's path may be different, contact your webmaster or use a command such as which bash to check the path to correct the situation.

  • Execute the installation script:

    sudo /bin/bash -x upgrade-edge-log-server.sh
    
  • If the upgrade fails, the following steps can be performed to roll back.

    curl -O https://openresty.com/client/oredge/downgrade-edge-log-server.sh
    sudo /bin/bash -x downgrade-edge-log-server.sh [% old-package-version %]
    
    # E.g: sudo /bin/bash -x downgrade-edge-log-server.sh 1.1.0-1
    

# 2. 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.

  • Check and record the software version before the upgrade:

    # centos/redhat/fedora
    rpm -q openresty-edge-node
    # or
    rpm -q openresty-edge-node-prod
    
    # debian/ubuntu
    dpkg -l | grep openresty-edge-node
    # or
    dpkg -l | grep openresty-edge-node-prod
    
  • 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
    
  • Download upgrade script

    curl -O https://openresty.com/client/oredge/upgrade-edge-node.sh
    
  • Execute upgrade script

    sudo /bin/bash -x upgrade-edge-node.sh
    
  • If the upgrade fails, the following steps can be performed to roll back:

    curl -O https://openresty.com/client/oredge/downgrade-edge-node.sh
    sudo /bin/bash -x downgrade-edge-node.sh [% old-package-version %]
    
    # E.g: sudo /bin/bash -x downgrade-edge-node.sh 1.1.0-0
    

# 3. Upgrade OpenResty Edge Admin

  • Check and record the software version before the upgrade:

    # centos/redhat/fedora
    rpm -q openresty-edge-admin
    # or
    rpm -q openresty-edge-admin-prod
    
    # debian/ubuntu
    dpkg -l | grep openresty-edge-admin
    # or
    dpkg -l | grep openresty-edge-admin-prod
    
  • Upgrade database

    # If the file is missing, please contact us
    # Please replace [% script-version-number %] with the actual version number
    /bin/bash update-admin-db-[% script-version-number %].sh
    
  • Download upgrade script

    curl -O https://openresty.com/client/oredge/upgrade-edge-admin.sh
    
  • Upgrade admin

    sudo /bin/bash -x upgrade-edge-admin.sh
    
  • If the upgrade fails, the following steps can be performed to roll back:

    curl -O https://openresty.com/client/oredge/downgrade-edge-admin.sh
    sudo /bin/bash -x downgrade-edge-admin.sh [% old-package-version %]
    
    # E.g: sudo /bin/bash -x downgrade-edge-admin.sh 1.1.0-0
    

# 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.