Implementation on AWS - Real-Time Communication on AWS

Implementation on AWS

You can implement this pattern on AWS using core capabilities in Amazon Elastic Compute Cloud (Amazon EC2), Amazon EC2 API, Elastic IP addresses, and support on Amazon EC2 for secondary private IP addresses.

  1. Launch two EC2 instances to assume the roles of primary and secondary nodes, where the primary is assumed to be in active state by default.

  2. Assign an additional secondary private IP address to the primary EC2 instance.

  3. An Elastic IP address, which is similar to a virtual IP (VIP), is associated with the secondary private address. This secondary private address is the address that is used by external endpoints to access the application.

  4. Some OS configuration is required to make the secondary IP address added as an alias to the primary network interface.

  5. The application must bind to this Elastic IP address. In the case of Asterisk software, you can configure the binding through advanced Asterisk SIP settings.

  6. Run a monitoring script—custom, KeepAlive on Linux, Corosync, and so on—on each node to monitor the state of the peer node. In the event, that the current active node fails, the peer detects this failure, and invokes the Amazon EC2 API to reassign the secondary private IP address to itself.

  7. Therefore, the application that was listening on the VIP associated with the secondary private IP address becomes available to endpoints via the standby node.



Failover between stateful EC2 instances using Elastic
        IP address

Figure 4: Failover between stateful EC2 instances using Elastic IP address