The simple answer is No.
In Mysql replication, Master copies the bin log files to slaves, and after that, it's work is over. Now the Slave will run the bin files and execute them, but there won't be any performance on Master.
There might be scenario where you are using full synchronous replication, in which master will wait for the slave to execute the query, but again it won't impact the performance in terms of memory or CPU, but the master will wait for the query to be executed.
Also, for your second question, Phil already answered it, that ssh sends data through encryption which uses a lot of CPU, hence if you want other ways, use the other methods which are described by Phil.
Problem
When a Master is also a Slave, you need to have log-slave-updates.
From what you described, each Master does not have log-slave-updates configured.
Solution
STEP 01) STOP SLAVE;
on Slave1
STEP 02) STOP SLAVE;
on Slave2
STEP 03) STOP SLAVE;
on Master1
STEP 04) STOP SLAVE;
on Master2
STEP 05) On Master1, add this to /etc/my.cnf
[mysqld]
log-slave-updates
STEP 06) On Master2, add this to /etc/my.cnf
[mysqld]
log-slave-updates
STEP 07) On Master1, Run service mysql restart --skip-slave-start
STEP 08) On Master2, Run service mysql restart --skip-slave-start
STEP 09) START SLAVE;
on Slave1
STEP 10) START SLAVE;
on Slave2
STEP 11) START SLAVE;
on Master1
STEP 12) START SLAVE;
on Master2
That's it. Everything should replicate properly from here.
Give it a Try !!!
I have discussed this before
Best Answer
If we assume you have the following databases:
The only way for a 'slave' (e.g DB1) to update the 'master' (DB0) is if the 'slave1' (DB1) is also acting as a master to the 'master' (DB0). (commonly known as
Master to Master
Replication)You can check if this is the case by connecting to your 'master' (DB0) database and running
SHOW SLAVE STATUS;
The result 'should' be blank, most likely it isn't.
Look for the fields:
Master_Host
andMaster_Port
- this is the database from which it is receiving data. It will probably relate to one of your 'slaves' (DB1).Slave_IO_running
andSlave_sQL_running
- if these are both 'Yes' then replication is up and running, and any changes made to the database above will appear on your 'master'The quickest way to stop it is to then issue
STOP SLAVE;
on your 'master' (DB0).Depending on what version of MySQL you are running there are then some things you can do to erase the settings. https://dev.mysql.com/doc/refman/5.6/en/reset-slave.html (I recomend making a note of the settings in
SHOW SLAVE STATUS
before issuing any kind of RESET, just in case)Also you may want to add:
skip-slave-start
to your my.cnf file on your master, which will prevent the database starting replication again if the server is restarted.As @ypercube mentions above, you should avoid writing to a 'slave' database, unless you have specifically configured it as part of a master to master setup.