what port should I open for mysql master-master replication?
Posted
by
Vanddel
on Server Fault
See other posts from Server Fault
or by Vanddel
Published on 2012-11-06T10:08:34Z
Indexed on
2012/11/11
5:04 UTC
Read the original article
Hit count: 472
I have two servers running php5-fpm and a load balancer running nginx, the three servers share /var/www/drupal using nfs. nfs is working correctly. I replicated the two servers' database using mysql master master replication. everything was working fine till I added my iptables rules. In my iptables script, I first drop all chains then I accept the ones I want, other than that there are no other drop statements. I opened port 3306 for mysql replication like this : (the rule is on both servers )
iptables -A INPUT -p tcp -s $ip_Of_Other_Server --dport 3306 -j ACCEPT
iptables -A OUTPUT -p tcp -d $ip_Of_Other_Server --sport 3306 -j ACCEPT
The problem is, when I run both servers and I try to log in using my account on drupal it doesn't log in although I find a successful log in attempt in drupal logs. When I run only one server of them I can log in normally. when I allow everything in my iptables rules it works normally. I believe there's some port I need to open using iptables for the replication to work correctly but I can't find which one to open.
© Server Fault or respective owner