This guide will help you set up and use Edge Sync.
Edge Sync (formerly “Local Operator Console”) is an HTTP server that stands in for ZEDEDA Cloud as a controller when your edge nodes don’t have Internet access, and thus don’t have access to ZEDEDA Cloud. In doing so, Edge Sync enables you to ensure continuity of service during planned and unplanned outages, to run your edge nodes primarily on an air-gapped network, or to more efficiently transition your nodes to the cloud from an air-gapped network.
Rather than completely replacing ZEDEDA Cloud, however, Edge Sync focuses on managing edge node and edge application configurations. It also collects runtime metrics from your nodes and applications.
When you use Edge Sync, your edge nodes will still periodically try to connect to ZEDEDA Cloud as normal. When they cant, they’ll fall back to your edge sync server. When they can connect to ZEDEDA Cloud, they will always prioritize those configurations, thus avoiding conflicting configurations.
You can run Edge Sync on any machine as long as your edge nodes can access it over some local network, e.g., LAN or WLAN.
- Your edge node must be running at least EVE-OS version 9.7.
- Your edge nodes must be onboarded to ZEDEDA Cloud before you can use them with Edge Sync. Edge Sync does not support onboarding edge nodes.
- You must have Docker running on the machine that will run Edge Sync.
- Edge Sync can't manage an edge node that it runs on.
Set up Edge Sync
The procedures in this section will help you set up your Edge Sync server. After you’re all set up, you’ll be ready to use Edge Sync with its API.
The Edge Sync image is hosted on Docker Hub. You either need to pull it onto your server directly, or you need to copy it onto your server.
Follow these steps to download Edge Sync.
- Open your terminal.
- Pull the Edge Sync image from Docker Hub.
docker pull zededa/edge-sync
- Verify that your machine has the Edge Sync image.
docker images
- Ensure that you see something similar to the following in the output of the previous command.
zededa/edge-sync latest 76a1607cab7d 1 month ago 6.19MB
To start Edge Sync on your server, run the following Docker command in your server’s terminal.
Note that this command opens two listening ports: 1180 for the API and for the datastore.
docker run -p 1180:1180 -p 8100:8100 zededa/edge-sync
Edge nodes will only fall back to Edge Sync if you have enabled the feature for the edge node. To do so, complete the following procedure for each edge node that should use Edge Sync.
- Log in to ZEDEDA Cloud.
- Click on Edge Nodes on the left side nav.
- Click on the edge node that you want to enable.
- Go to the node’s Basic Info tab.
- Click the Edit icon.
- Check the box labeled Edge Sync.
- Enter the URL of your Edge Sync server, e.g., http://IP_ADDRESS:1180
- Replace IP_ADDRESS in the previous URL with the IP address of your LOC server.
- Click Save.
Before you can send configurations to your Edge Sync server, you'll need to download them from ZEDEDA Cloud. The following procedure explains how to do so manually using the ZEDEDA GUI.
- Log in to ZEDEDA Cloud.
- Click on Edge Nodes on the left side nav.
- Click on the edge node for which you want to download a configuration.
- Click on the More Actions icon.
- Click on Download Edge Sync Config.
- Find the config file in your Downloads directory.
Using Edge Sync: the Edge Sync API
After you set up Edge Sync, you can manage and monitor your fleet of edge nodes using the following endpoints, which enable you to build custom integrations and applications to meet your needs.
API base URL: api/v1/user
In the following CURL request examples, replace $LOCURL with the local URL or IP address of your Edge Sync server.
POST: /config
Uploads a device config bundle. Each file in the bundle is a protobuf config response.
Options | |
-F, --form <name=content> | Causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388 |
Example:
Substiture $LOCURL.
curl -F file=@config-bundle.json http://$LOCURL/api/v1/user/config
Example of a config bundle that contains a single configuration:
{"EdgeSyncBlobList": [{"devId":"d8bf6b3a-917f-44dc-bdae-7542e7f7de88","config":"0adf4b0adc4b0a…..“}]}
GET: /devs
Returns list of UUIDs of all online devices in JSON format. Devices are considered online if there is a recent ‘metrics’ update from an edge node.
Example:
Substitute $LOCURL.
curl http://$LOCURL/api/v1/user/devs
GET: /id/$UUID/info
Returns a ZInfoMsg for the specified device in JSON format. If the device is not online, Edge Sync returns 404 Not Found.
Example:
Substitute $LOCURL and $UUID.
curl http://$LOCURL/api/v1/user/id/$UUID/info
GET: /id/$UUID/metrics
Returns a ZInfoMsg for the specified device in JSON format. If the device is not online, Edge Sync returns404 Not Found.
Example:
Substitute $LOCURL and $UUID.
curl http://$LOCURL/api/v1/user/id/$UUID/metrics
POST: /id/$UUID/command/{shutdown|shutdown-poweroff}
Supported commands:
- shutdown: shuts all application down
- shutdown-poweroff: shuts all application down and powers the device off
Example:
Substitute $LOCURL and $UUID. Choose one command from {shutdown|shutdown-poweroff}.
curl -X POST http://$LOCURL/api/v1/user/id/$UUID/command/{shutdown|shutdown-poweroff}
POST: /id/$UUID/app/$APPUUID/command/{purge|restart}
Supported commands:
- purge: purges application
- restart: restarts application
Example:
Substitute $LOCURL, $UUID, and $APPUUID; choose one commands from {purge|restart}.
curl -X POST http://$LOCURL/api/v1/user/id/$UUID/app/$APPUUID/command/{purge|restart}