Install the container of OpenResty Edge Node
1. Preparation
The following documents/information need to be prepared before installation:
- Configuration package:
openresty-edge-VERSION.tar.gz
, download from Download Center. - Your Edge Admin’s IP and port, corresponding to
ADMIN_HOST
andADMIN_PORT
below. - Your Log Server’s IP and port, corresponding to
LOG_SERVER_HOST
andLOG_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
- Download Image
docker pull DOCKER_IMAGE
# example:
docker pull registry.openresty.com/edge/ubuntu/20.04/openresty-edge-node:22.6.1
3. Run Container
Create a new folder to be mounted in the container:
custom/
Copy
openresty-edge-VERSION.tar.gz
tocustom/
Generate the configuration file for Edge Node:
custom/config.ini
Please replace ADMIN_HOST
, ADMIN_PORT
, LOG_SERVER_HOST
and LOG_SERVER_PORT
with their actual contents.
#
# NOTICE: please feel free to edit these configurations if necessary.
#
# Both [admin] section and [log_server] section need to be configured below.
#
[admin]
# admin server host, default:
host = "ADMIN_HOST"
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_server]
# log server endpoints, default:
endpoints = "https://127.0.0.1:12346"
- Run Container
It is often desirable that after a container is destroyed, other Edge Node containers can inherit this container’s configuration, so we mount the Edge Node’s data directory.
Assume that the absolute path to custom/ is
/root/custom/
. Assume that the local data path is/root/node1-data
.
docker run -d -p 80:80 -p 443:443 --name openresty-edge-node \
-v /root/custom/:/usr/local/oredge-node/custom/ \
-v /root/node1-data/:/usr/local/oredge-node/data/ \
DOCKER_IMAGE
# example:
docker run -d -p 80:80 -p 443:443 --name openresty-edge-node \
-v /root/custom/:/usr/local/oredge-node/custom/ \
-v /root/node1-data/:/usr/local/oredge-node/data/ \
registry.openresty.com/edge/ubuntu/20.04/openresty-edge-node:22.6.1
- 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
The installation of OpenResty Edge Node is now complete.
4. Getting Started
Login to Edge Admin website:
URL:
https://ADMIN_HOST
If you are trying Edge, the URL and account password for Edge 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.
More:
If you have any questions, please contact us.