# Cluster

For clusters with a scale of about 10 nodes, we could install Edge Admin and the Edge Log Server to be deployed on the same machine to lower the costs. If the scale becomes larger in the future, they can be deployed separately.

  • Edge Admin and Edge Log Server: It is recommended to use a machine with 4 cores, 16G memory and 200G SSD hard disk.
  • Edge Node: Depends on the volume of business. It is roughly 1 cpu core with 2g memory, such as 8c16g, 200G hard disk.

# Architecture

See the attachment for the architecture diagram:

Mainly contains three roles:

  • Node: A specific gateway.
  • Admin: Used to manage Node.
  • Log-Server: Used to store and view logs.

# Installation

  1. We will need to access the following public network addresses. If your network has a firewall, you need to add proper rules to white list them.

     openresty.com 443
     openresty.org 443
     pkg.openresty.com 443
     api.openresty.com 443
    
  2. Database installation and initialization

    listening port 5432.

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

    Database initialization (shell script is attached).

    # Initialize the Admin pg database
    bash init_admin_db_[% version %].sh
    
    # Initialize the Log-Server pg database
    bash init_log_server_db_[% version %].sh
    
  3. Admin Web Installation

    Listening ports 443 and 12345. (443 provides management background, 12345 is used to communicate with Node)

    # Copy [% customer %]-openresty-edge-admin-prod-[% os %]-[% date %].tar.gz to the current directory
    tar -zxvf [% customer %]-openresty-edge-admin-prod-[% os %]-[% date %].tar.gz
    cd [% customer %]-openresty-edge-admin-prod-[% os %]-[% date %]
    sudo bash -x install-openresty-edge-admin.sh
    

    Put the certificate and private key here (you can skip it if you don’t have one)

    /usr/local/oredge-admin/conf/ssl/ssl.crt
    /usr/local/oredge-admin/conf/ssl/ssl.key
    

    The configuration that needs to be modified: (If Database, Admin, Log-Server use the same machine, you can use the default configuration)

    1.Database address

    2.Log-Server address

    Configuration file: (This file will not be automatically overwritten by subsequent upgrades, please be careful not to leave a space at the beginning of the line)

    sudo vim /usr/local/oredge-admin/conf/config.ini
    

    Then reload Admin

    sudo systemctl reload oredge-admin
    

    At this point Admin should be able to be used normally (we only opened https): https://your-admin.com/

    Login account: (please change the password after successful login)

    username: admin
    password: [% password %]
    
  4. Log-Server Installation

    Listening ports 8089 and 12346. (8089 is used to communicate with Admin, 12346 is used to communicate with Node)

    # Copy [% customer %]-openresty-edge-log-server-prod-[% os %]-[% date %].tar.gz to the current directory
    tar xf [% customer %]-openresty-edge-log-server-prod-[% os %]-[% date %].tar.gz
    cd [% customer %]-openresty-edge-log-server-prod-[% os %]-[% date %]
    sudo bash -x install-openresty-edge-log-server.sh
    

    The configuration that needs to be modified:

    1.Database address

    2.Log-Server address

    Configuration file: (This file will not be automatically overwritten by subsequent upgrades, please be careful not to leave a space at the beginning of the line)

    sudo vim /usr/local/oredge-log-server/conf/config.ini
    

    Then restart Log-Server:

    sudo systemctl reload oredge-log-server
    
  5. Edge Node Installation

    # Copy [% customer %]-openresty-edge-node-prod-[% os %]-[% date %].tar.gz to the current directory
    tar -zxvf [% customer %]-openresty-edge-node-prod-[% os %]-[% date %].tar.gz
    cd [% customer %]-openresty-edge-node-prod-[% os %]-[% date %]
    sudo bash -x install-openresty-edge-node.sh
    

    The configuration that needs to be modified:

    1.Admin address

    2.Log-Server address

    Configuration file: (This file will not be automatically overwritten by subsequent upgrades, please be careful not to leave a space at the beginning of the line)

    sudo vim /usr/local/oredge-node/conf/config.ini
    

    Then reload Node:

    sudo systemctl reload oredge-node
    

    So far, the full set of OpenResty Edge has been built.

  6. Start the OpenResty Edge service

    We provide online documentation, it is recommended to start with this “Quick Start”:

    https://doc.openresty.com/en/edge-admin/get-started.html

    If you have any questions, please contact us.