How to set up MySQL replication. And for debugging purpose, it will be great if I can run multiple MySQL instances on a single host.
To set up MySQL replication, check these tutorials:
MySQL Replication
MySQL replication setup
You can Setup multiple MySQL instances on single server.