2

I want to user Corosync and Pacemaker to sync between two servers, the servers are, two (or more) EC2 instances, with Ubuntu 16.04 installed on them. I was doing that following this article, but I'm stuck at the step of private_binding_IP_address I search over the internet but no luck, what I want to know is the following:

  • Does Corosync and Pacemaker work with Ubuntu 16.04?
  • Does Corosync and Pacemaker work with Amazon EC2 (Ubuntu) instances?
  • How to do that (sync two or more Amazon EC2s together)?

Thanks

UPDATE: the main goal of creating HA cluster of EC2's is that I want to install two or more of NextCloud servers on EC2 instances for storage and database, I can configure the NextCloud to use, S3 bucket for as a primary storage, and RDS for database, for all EC2 instances. the NextCloud instances are already installed and configured to an S3 bucket and an RDS, now to sync the two EC2s I followed the article but I'm stuck at the step Configure Corosync cluster I can't get the bindnetaddr which is a binding IP address, I ran the command ifconfig -a at both servers but the two IP that specified in the article were not the same

UPDATE2 I saw AWS article the thing is that this article describes how to make HA between EC2s, meaning one instance is active, and the other one is standby, what I need to do is to make all instances active at the sane time not one active and the others are standby, you can say sync at application level, assume if I have three NextCloud servers a user can send requests to the three NextCloud servers, and requests are processed by the three servers. I tired the AWS ELB (Elastic Load Balancer) but it was behaving same as scenario that is described in the above AWS article, so that's why I shifted to the Corosync and Pacemaker, yet I couldn't figure how to use Corosync for EC2s

  • 1
    You're going to need an EC2-specific tutorial, as you'll have to use an Elastic IP address. aws.amazon.com/articles/… – ceejayoz Feb 1 '18 at 14:35
  • 1
    You're much more likely to get a useful answer if you modify your question to be more precise, and don't assume AWS experts know about Corosync and Pacemaker, which personally I've never heard of. Do you want to setup high availbility so you have two instances running some software, the second as a hot standby that can take the IP address if the first server goes down? Or is your problem syncing data between applications on the server? Once you tell us what you really need we can probably suggest ways to achieve it in AWS. Do you need a static IP, or is a CAME ok? That would make ELB an option – Tim Feb 1 '18 at 16:23
  • Hi, can you please look at the question again? I have updated the question with the full case Scenario, Thanks – ibr Feb 4 '18 at 10:20
3

Does Corosync and Pacemaker work with Ubuntu 16.04?

Yes. Ubuntu packages Corosync and Pacemaker for Xenial (16.04), which can be installed with a simple command: # apt install corosync pacemaker

Does Corosync and Pacemaker work with Amazon EC2 (Ubuntu) instances?

Technically yes, but there are a lot of corner cases to be aware of. The largest concern I have is the performance/reliability of the network between standard EC2 instances.

Corosync handles communication between the nodes, and detects when nodes go missing from the cluster (node failures, network failures, etc). Since AWS's network is kind of a black box (from the admin's perspective), it's hard to gauge the reliability of said network. In "on-prem" clusters this network is generally a pair of direct connections between nodes, or a stacked-switch, so something highly reliable and performant. I'm not saying AWS's network isn't reliable or performant, but it's very shared, and surely more complex than a set of crossover cables. When Corosync's network is interrupted, even for just 1000ms (1s), it will declare a node dead (in a two node cluster, with default timeouts). I would expect this to happen from time to time, and know how to recover from it.

That said, it looks like you can get "Cluster Instances" in AWS, which tout a low-latency/high-performance network between nodes. This is likely what you want to use, as it seems to address the main concern I have.

Regardless of which instances you choose, Pacemaker should be configured with STONITH enabled, to ensure that when a node does go offline, or has it's network interrupted, that it gets fenced off from the rest of the cluster. STONITH is a form of Fencing that takes a cluster node in an unknown state and puts it in a know state: powered off. STONITH gets ignored in most tutorials you'll find online because it's very dependent on your environment/hardware/hypervisor, but it's one of the most important parts of a properly configured HA cluster.

There looks to be a new fence agent for AWS in ClusterLab's git: https://github.com/ClusterLabs/fence-agents/blob/master/fence/agents/aws/fence_aws.py

How to do that (sync two or more Amazon EC2s together)?

That part is a bit too ambiguous to answer precisely. Are you talking about syncing directories, databases, volumes, or what? If you update your question to be more specific, I will update my answer ;)

  • hi, I have updated the question to give the my full story, hope its much clear now...thanks – ibr Feb 4 '18 at 7:18
  • 1
    bindnetaddr is the network address for your interfaces' IP address. For example, the correct bindnetaddr for 192.168.7.150/25, is going to be 192.168.7.128. You can use online calculators to calculate the network address if you're not fluent in subnetting: subnet-calculator.com – Matt Kereczman Feb 5 '18 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.