Excessive availability patterns for AWS IoT Greengrass utilizing Pacemaker


Edge computing downtime in industrial IoT environments will be each inconvenient and expensive. Methods on the edge require steady operation to take care of enterprise continuity. Whereas AWS IoT Greengrass delivers highly effective edge computing capabilities, reaching true enterprise-grade excessive availability requires extra orchestration. This publish reveals how one can use Pacemaker, a cluster useful resource supervisor, to construct resilient edge infrastructure with automated failover.

On this walkthrough, you’ll be taught to implement energetic/passive and energetic/energetic excessive availability patterns utilizing Pacemaker with AWS IoT Greengrass, full with automated failover, state replication, and monitoring integration.

The excessive availability problem for edge computing

Conventional cloud functions profit from built-in redundancy and auto-scaling, nevertheless, functions on the sting face distinctive challenges:

  • Bodily isolation: Edge gadgets function in distant places with restricted connectivity
  • Useful resource constraints: Not like cloud environments, edge sources are finite and treasured
  • Service criticality: Edge failures can halt bodily operations instantly
  • Restoration complexity: Handbook intervention at distant websites is pricey and sluggish

AWS IoT Greengrass addresses many edge computing challenges, however excessive availability requires considerate structure past a single system deployment.

How Pacemaker enhances AWS IoT Greengrass

Pacemaker helps you construct extremely out there AWS IoT Greengrass deployments by cluster administration capabilities:

Confirmed reliability

  • Utilized in mission-critical environments for over a decade
  • Handles complicated failure situations with subtle fencing mechanisms
  • Works in each energetic/passive and energetic/energetic configurations

AWS IoT Greengrass-aware useful resource administration

  • Screens Greengrass service well being and part states
  • Manages shared storage for seamless state switch
  • Coordinates failover of dependent providers and community sources

Enterprise-ready integration

  • Integrates with present Linux infrastructure administration
  • Helps complicated dependency chains and useful resource constraints
  • Gives detailed logging and monitoring for compliance necessities

Collectively, these instruments hold your edge workloads operating throughout {hardware} failures or community disruptions.

Structure overview: Excessive availability patterns

AWS IoT Greengrass excessive availability will be carried out utilizing two major patterns, every optimized for various use circumstances.

Energetic/Passive configuration: Maximizing information consistency

This mode maximizes information consistency and automatic failover—preferrred for mission-critical functions the place information integrity and repair continuity are paramount. One node runs Greengrass actively whereas the opposite stands prepared in standby mode. A software-based, block-level information replication service like Distributed Replicated Block Gadget (DRBD) ensures immediate state synchronization between nodes, enabling failover with zero information loss and sustaining system id.

Greengrass HA Active Passive

Key advantages:

This configuration ensures full state preservation throughout failover with sub-minute downtime, zero information loss for in-flight transactions and important operations, whereas sustaining system id, certificates, and Stream Supervisor persistence seamlessly.

Actual-world use circumstances:

Energetic/Passive configurations are important in situations requiring zero or minimal information loss, akin to in-flight leisure techniques that deal with offline cost processing and battery manufacturing amenities the place manufacturing strains rely upon steady information move from vital manufacturing sensors and ML mannequin outputs to take care of operational integrity and high quality management.

Energetic/Energetic: Most throughput and scalability

This mode maximizes throughput and offers horizontal scaling for high-volume workloads. A number of unbiased Greengrass cases run concurrently throughout cluster nodes, with clever load balancing distributing work primarily based on node well being and capability. Every node operates with its personal distinctive system credentials and configurations.

Greengrass HA Active Active

Key advantages:

These configurations allow horizontal scaling for high-throughput situations, enhance useful resource utilization throughout nodes, and supply swish degradation beneath partial failures.

Actual-world use circumstances:

Energetic/Energetic configurations are perfect for high-volume situations akin to automotive elements manufacturing amenities and large-scale manufacturing operations with a number of manufacturing strains, the place every node handles totally different line segments to supply each redundancy and elevated processing capability for real-time analytics and anomaly detection.

Configuration choice information

Use Energetic/Passive for functions that require zero information loss, shared state, and system id preservation. This sample works properly once you want a single level of management and may settle for failover occasions beneath one minute.Use Energetic/Energetic once you want excessive throughput and horizontal scaling. This sample fits functions that may function independently with out shared state, the place load distribution offers operational advantages, and swish degradation is preferable to finish failover.

Tips on how to implement the answer

The entire playbook, together with detailed configuration examples and testing procedures, is on the market within the GitHub respository. This offers an Energetic/Passive implementation automation utilizing Ansible you can customise in your particular necessities. Energetic/Energetic setup steps are additionally out there in MANUAL-SETUP-GUIDE throughout the similar repository.

Setup steps

1. Setting setup

Clone the repository and arrange the event atmosphere

git clone https://github.com/aws-samples/sample-greengrass-ha-pacemaker.git
cd sample-greengrass-ha-pacemaker
./scripts/setup-dev-env.sh && supply .venv/bin/activate

2. Configure cluster secrets and techniques

Generate and encrypt cluster credentials utilizing Ansible Vault

# Create vault password file
echo "your_secure_password" > .vault_pass
chmod 600 .vault_pass
# Auto-generate encrypted secrets and techniques
./scripts/setup-vault.sh

This creates `vars/cluster-vault.yml` with encrypted credentials for cluster authentication and DRBD replication.

3. Put together Greengrass credentials

Word: This method is designed for testing and demonstration functions solely.

Obtain Greengrass set up information from AWS IoT Console.

  1. Navigate to AWS IoT Core console → Greengrass → Core gadgets
  2. Click on ‘Arrange one core system’ → ‘Arrange a tool with installer obtain’
  3. Title your system (e.g., ‘greengrass-ha-device’)
  4. Choose or create a Factor Group
  5. Obtain each information and rename them:
    1. Rename hash-setup.sh to greengrass-setup.sh
    2. Rename hash.zip to greengrass-certs.zip
  6. Place information in `information/greengrass/` listing

4. Deploy and configure

This can deploy AWS EC2 and essential sources to check on AWS.

# Deploy infrastructure
make cdk-deploy && make cdk-inventory
# Retrieve SSH personal key
./scripts/get-ssh-key.sh
# Configure HA cluster
ansible-playbook playbooks/setup/system-prerequisites.yml -i stock/cdk-dev-hosts
ansible-playbook playbooks/setup/configure-ha.yml -i stock/cdk-dev-hosts --vault-password-file .vault_pass

5. Validate and take a look at

Verify cluster standing and optionally, run an automatic failover take a look at.

# Verify cluster standing
ansible node-1 -i stock/cdk-dev-hosts -m shell -a "sudo pcs standing" --become
# Check failover (non-obligatory)
ansible-playbook playbooks/testing/test-failover-simulation.yml -i stock/cdk-dev-hosts --vault-password-file .vault_pass

The automated assessments validate useful resource migration, DRBD promotion, and information consistency throughout failover.

Cleanup

This can destroy the sources created by CDK.

# Destroy infrastructure
make cdk-destroy

Conclusion: Enterprise-ready edge computing

AWS IoT Greengrass and Pacemaker collectively present the excessive availability wanted for mission-critical edge deployments. By utilizing Pacemaker’s cluster administration capabilities, organizations can confidently deploy Greengrass the place reliability is crucial.Whether or not you’re managing industrial management techniques, processing real-time analytics, or orchestrating edge AI workloads, this architectural sample offers the muse for resilient, scalable edge computing that your small business can rely upon.

Subsequent steps

Able to implement enterprise-grade excessive availability in your AWS IoT Greengrass deployments? Right here’s your path ahead:

Repository: sample-greengrass-ha-pacemaker


In regards to the authors

Yong Ji Yong Ji is a Senior Options Architect at Amazon Internet Companies (AWS), serving to enterprises construct progressive cloud-based options. With over 25 years of expertise in cloud structure, analytics and information engineering, Yong brings deep technical experience and a ardour for fixing complicated enterprise challenges. Outdoors of labor, Yong is a passionate desk tennis participant.

Siddhant Srivastava Siddhant Srivastava is a Software program Growth Engineer with AWS IoT Greengrass. He has 3+ years of expertise in edge computing with deal with constructing resilient, scalable distributed techniques. Outdoors work, Siddhant participates in soccer leagues and billiards tournaments.