How to configuration keepalived on Amazon EC2?

If you're not intimately familiar with keepalived/haproxy, why not just use the AWS ELB?

As for running haproxy on your own (if you're deadset on doing that), I presume you're trying to bounce connections from XMPP server to Casandra 1-4. Why not just install haproxy on the XMPP box? You can configure haproxy like you normally would and then simply point XMPP at 127.0.0.1 - Then you've got 5 boxes in your setup instead of 7.