How can I replicate master master and master master MySQL databse replication and HA?

I have an application desigend in PHP and MySQl running on apache web server that I is running on a Amazon EC2 server Centos. I want to implement the master-master and master slave replication and high availability disaster recovery on this application database.

For this I have created two servers and have installed the same application and database on both the servers.

I want to achieve something like this:

  1. If the user updates (insert,delete,modify) any record on any server then the same should be replicated on the other server.

  2. If one of the server goes down the other should be able to serve the request.

Kindly help me to achieve the same.