1

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.

Vanddel
  • 125
  • 1
  • 4
  • 1
    Just enable logging into your iptables and check what logs says, when you get any connectivity issues, usually there is no special port for replication, if you have opened 3306,thats enough. – Farhan Nov 07 '12 at 15:30

1 Answers1

0

I just needed to open the outgoing connections :

iptables -A OUTPUT  -p tcp -d $ip_Of_Other_Server  --dport  3306 -j ACCEPT
iptables -A INPUT   -p tcp -s $ip_Of_Other_Server  --sport  3306 -j ACCEPT
Vanddel
  • 125
  • 1
  • 4