# Install the container of OpenResty Edge Node

# 1. Preparation

The following documents/information need to be prepared before installation:

  • openresty-edge-config.*.rpm or openresty-edge-config.*.deb, like: openresty-edge-config-0.0.1-1.or.noarch.rpm
  • Your Admin's IP and port, corresponding to [% admin-ip %] and [% admin-port %] below.
  • Your Log Server's IP and port, corresponding to [% log-server-ip %] and [% log-server-port %] below.
  • Image Address, corresponding to [% docker-image %] below.

# 2. Download Image

  • Login Registry
sudo docker login --username=[% registry-username %] registry.openresty.com
# enter password: [% registry-password %]
  • Downlaod Image
docker pull [% docker-image %]

# example:
docker pull registry.openresty.com/edge/centos/7/openresty-edge-node:1.1.0-5

# 3. Run Container

  • Create a new folder to be mounted in the container: custom/

  • Copy openresty-edge-config.*.rpm/deb to custom/

  • Generate the configuration file for Node: custom/config.ini

Please replace [% admin-ip %], [% admin-port %], [% log-server-ip %] and [% log-server-port %] with their actual contents.

#
# NOTICE: please feel free to edit these configurations if necessary.
#
# Both [admin] section and [log_cluster] section need to be configured below.
#

[admin]

# admin server host, default:
host = "[% admin-ip %]"
port = "[% admin-port %]"

# Another admin server host when you have deployed two admin servers.
# The node will choose one of them randomly.
# And node will retry another server automatically when one server is down.
# It is optional, please ignore it when you only deployed one admin.
# host2 = ""


[log_cluster]

# log server host, default:
host = "[% log-server-ip %]"
port = "[% log-server-port %]"
  • Run Container

Suppose the absolute path to custom/ is /root/custom/.


docker run -d -p 80:80 -p 443:443 --name openresty-edge-node -v /root/custom/:/usr/local/oredge-node/custom/ [% docker-image %]

# example:
docker run -d -p 80:80 -p 443:443 --name openresty-edge-node -v /root/custom/:/usr/local/oredge-node/custom/ registry.openresty.com/edge/centos/7/openresty-edge-node:1.1.0-5
  • If an error occurs, the container can be stopped and deleted using the following command:
docker stop openresty-edge-node
docker rm openresty-edge-node

Now, the installation of the OpenResty Edge Node container is complete.

You can use the installed Edge Node.

  • Login to Admin website:

    URL: https://[% admin-host %]

    If you are trying Edge, the URL and account password for Admin will be sent with your trial email.

    For the trial version, admin is deployed on our machines, while for the future purchase of the full version, we will provide the installation package for self-deployment.

  • After login, go to the gateway clusters tab, there you will see the join request from the newly deployed node.

    According to the information in the join request, confirm that it is your own node, and then click approve.

    The procedure of approval is to add a new node to a gateway cluster. So before you approve, you need to create a cluster on the GUI, and then you can choose when you approve.

After the edge node service is deployed according to the above documents, openresty edge is up and running.

# 4. Start the OpenResty Edge service

We provide online documentations:

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

In addition we have provided videos:

https://blog.openresty.com/en/tags/openresty-edge/

https://www.youtube.com/channel/UCXVmwF-UCScv2ftsGoMqxhw

If you have any questions, please contact us.