Mixed based replication between two databases on the same server
Have two instances of MySQL on that one server.  Each has its own data directory, its own port (3307 is typically used for the second one), each has its own my.cnf and logs.  But, since they share the RAM, you need to cut back many tunables relating to RAM.

Why?  What do you gain?  Certainly not HA.  You may be able to better use lots of Cores.  But you are doubling the "writes" on that machine (since the 'Slave' is repeating the writes).