Yes it is possible to do Master-Master replication in RDS MySql Engine. But it need some manipulation with instances.
Pre-requisite:
1) Create Read replica of both instances for enabling binary logging.
2) Delete Read replica for both of them if not required.
3) Follow the instructions for master slave setup mentioned below.
On Master1
create replication user
grant replication slave on *.* to 'admin'@'%' identified by 'admin';
Query OK, 0 rows affected (0.00 sec)
note output of below command
show master status;
+----------------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB |
Binlog_Ignore_DB | Executed_Gtid_Set |
+----------------------------+----------+--------------+------------------+-------------------+ | mysql-bin-changelog.000007 | 120 | |
| |
+----------------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec)
On Master2
mysql> call mysql.rds_set_external_master('master1.endpoint.amazonaws.com',3306,'admin','admin','**mysql-bin-changelog.000007**',**120**,0);
Query OK, 0 rows affected (0.05 sec)
mysql> call mysql.rds_start_replication;
+-------------------------+
| Message |
+-------------------------+
| Slave running normally. |
+-------------------------+
1 row in set (1.01 sec)
mysql -u admin123 -padmin123 -h master2.endpoint.amazonaws.com -e "show slave status\G;" | grep Running
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
======================================================================
On Master2
grant replication slave on *.* to 'admin'@'%' identified by 'admin';
Query OK, 0 rows affected (0.00 sec)
show master status;
+----------------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+----------------------------+----------+--------------+------------------+-------------------+
| **mysql-bin-changelog.000007** | **120** | | | |
+----------------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
On Master1
mysql> call mysql.rds_set_external_master('master2.endpoint.amazonaws.com',3306,'admin','admin','**mysql-bin-changelog.000007**',**120**,0);
Query OK, 0 rows affected (0.05 sec)
mysql> call mysql.rds_start_replication;
+-------------------------+
| Message |
+-------------------------+
| Slave running normally. |
+-------------------------+
1 row in set (1.01 sec)
mysql -u admin123 -padmin123 -h master1.endpoint.amazonaws.com -e "show slave status\G;" | grep Running
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it