Edge Failover
Edge Failover - User Guide
What Does This Solution Do?
This Docker container provides an automated backup system for edge computing devices. Think of it as a "smart switch" that automatically activates a backup device when your primary device stops working.
The Problem It Solves
In industrial or remote environments, edge devices are critical for operations. When the main device fails, you need a backup to take over immediately to avoid downtime. Manually switching to a backup device can be slow and requires someone to be available 24/7.
How It Works (Simple Version)
If you have two identical Edge Devices:
- Parent Edge Device (Primary): Handles your normal operations
- Child Edge Device (Backup): Sits idle, ready to help
This service acts like a "watchdog" that:
- Continuously monitors Parent Edge Device via either PING or some equivalent API call to make sure it's working
- Copies the settings from Parent Edge Device regularly (like backing up your phone contacts)
- When Parent Edge Device fails: Automatically configures Child Edge Device with the same settings and puts it to work
- When Parent Edge Device comes back: Switches back to monitoring Parent Edge Device and cleans up Child Edge Device
What You Need to Provide
To run this container, you need to tell it:
- Where is Parent Edge Device? (https://{Parent Edge Device URL})
- Where is Child Edge Device? (https://{Child Edge Device URL})
- How to connect to both Edge Devices (API Keys)
- PING_INTERVAL aka How often to check if Parent Edge Device is working (optional, defaults to every 30 seconds)
Setting Up the Container
Step 1: Prepare Your Information
- Parent Edge Device's web address
- Child Edge Device's web address
- Parent Edge Device's access token
- Child Edge Device's access token
Step 2: Run the Container
Use Docker to start the container with your information:
(Please contact your Litmus representative for the docker image)
docker run -d \
-e EDGE_URL_PARENT=https://{Parent Device URL} \
-e EDGE_URL_CHILD=https://{Child Device URL} \
-e EDGE_API_TOKEN_PARENT=parent_device_api_key \
-e EDGE_API_TOKEN_CHILD=child_device_api_key \
-e PING_INTERVAL=30 \
{docker_image_name}:{latest}What Happens Next
Once running, the container will:
Normal Operation (Both Edge Devices working)
- Check Parent Edge Device every 30 seconds: "Are you okay?"
- Parent Edge Device responds: "Yes, I'm working fine"
- Copy Parent Edge Device's current settings every few minutes
- Keep Child Edge Device on standby
When Parent Edge Device Fails
- Check Parent Edge Device: "Are you okay?"
- No response from Parent Edge Device
- ALERT: "Parent Edge Device is down! Activating backup!"
- Copy all of Parent Edge Device's settings to Child Edge Device
- Child Edge Device starts handling the work
When Parent Edge Device Recovers
- Check Parent Edge Device: "Are you okay?"
- Parent Edge Device responds: "Yes, I'm back!"
- SWITCH BACK: "Parent Edge Device is healthy again!"
- Clean up Child Edge Device (remove the copied settings)
- Parent Edge Device takes over the work again
What You'll See in the Logs
The container will show you messages like:
- "Parent is healthy" - Everything is normal
- "Parent is down - applying template to child" - Backup is activating
- "Parent is back online - cleaning up child" - Switching back to main
- "Successfully fetched template with X keys" - Settings copied successfully
Important Notes
Data Storage
- The container saves Parent Edge Device's settings to disk
- If the container restarts, it can still use the saved settings
- You can optionally mount a folder to preserve these settings
Network Requirements
- The container needs internet access to reach both Edge Devices
- Both Edge Devices need to be accessible via web addresses (HTTPS)
- The container acts as a "middle-man" between your two Edge Devices
Security
- All communication uses secure HTTPS connections
- Your access tokens are kept private within the container
- No sensitive information is logged to the console
Common Scenarios
Scenario 1: Planned Maintenance
- You need to update Parent Edge Device
- Turn off Parent Edge Device
- Container automatically switches to Child Edge Device
- Do your maintenance on Parent Edge Device
- Turn Parent Edge Device back on
- Container automatically switches back
Scenario 2: Unexpected Failure
- Parent Edge Device crashes or loses network connection
- Within 30 seconds, Container detects the problem
- Container activates Child Edge Device immediately
- Your operations continue without manual intervention
- When Parent Edge Device is fixed, switching back happens automatically
Scenario 3: Network Issues
- If the container can't reach Parent Edge Device due to network problems
- It assumes Parent Edge Device is down and activates Child Edge Device
- When network is restored, it switches back to Parent Edge Device
Troubleshooting
If something isn't working:
- Check the logs - The container will tell you what's happening
- Verify addresses - Make sure both Edge Device addresses are correct and reachable
- Check tokens - Ensure access tokens are valid and have proper permissions
- Network connectivity - Confirm the container can reach both Edge Devices
Changelog
v1.3.0
- Introduce cross compatibilty of integrations across multiple versions of LE
v1.2.1
- Added general purpose documentation
- Fixed Logs being too noisy
- Fixes for more issues with devices not cleaned properly to the child device
v1.2.0
- Fixed corner case logical issues with cleanup of Devices extracted from template
- Fixes for CC template application due to discrepancy in GET template call and POST template call
v1.1.1
- Force Default PING interval to be minimum 30 seconds
v1.1.0
- Added Default directory as /data/ instead of /tmp for storing template from Parent device
- Clean up methods for extracting Parent and Child URLs
- Add skip components mechanism for any component other than integrations and DeviceHub for a faster template application
v1.0.1
- Fix issues with HTTP timeouts to Parent device when downloading template
- Added longer default timeout
v1.0.0
- Initial Application ready
- Basic functionality of fetch and store template, apply template, Logic for when to apply templates