dbTalk Databases Forums  

Replication not working - replication newbie

comp.databases.mysql comp.databases.mysql


Discuss Replication not working - replication newbie in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bill
 
Posts: n/a

Default Replication not working - replication newbie - 07-27-2011 , 06:47 PM






I studiously followed the documentation on replication and set up
replication. The master and slave are connected by a VPN and the
transaction load is very low (50 trans/hour).

The error log contains
[ERROR] Slave I/O: error connecting to master
'repl (AT) 192 (DOT) 168.10.101:3306

where
change mast to
master_host ='192.168.10.101',
master_user ='repl',
master_password='thePassword',
master_log_file='mysql-bin.000001',
master_log_pos=106;

I do have a user on the master named repl (AT) localhost (DOT)

The vpn is provided via a Netgear firewall/router which has no
limits on outbound initiated connections.

I can ping 192.168.10.101 from the slave server.

Perchance should the log file directive contain the whole path ?
The log is in the standard place /var/log/mysql/mysql-bin.log on
the master.

bill

Reply With Quote
  #2  
Old   
J.O. Aho
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-27-2011 , 10:29 PM






bill wrote:
Quote:
I studiously followed the documentation on replication and set up
replication. The master and slave are connected by a VPN and the
transaction load is very low (50 trans/hour).

The error log contains
[ERROR] Slave I/O: error connecting to master
'repl (AT) 192 (DOT) 168.10.101:3306

where
change mast to
master_host ='192.168.10.101',
master_user ='repl',
master_password='thePassword',
master_log_file='mysql-bin.000001',
master_log_pos=106;

I do have a user on the master named repl (AT) localhost (DOT)
Tried to add a repl user which is allowed to connect from the slave too?




--

//Aho

Reply With Quote
  #3  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-28-2011 , 04:00 AM



bill <william (AT) TechServSys (DOT) com> wrote:

Quote:
The error log contains
[ERROR] Slave I/O: error connecting to master
'repl (AT) 192 (DOT) 168.10.101:3306

I do have a user on the master named repl (AT) localhost (DOT)
The user must be created on the master, the user name must be
repl@'slave-ip-address' and it needs the replication slave
privilege.

Besides that replication uses the normal MySQL protocol, so
you can use any MySQL client to test the connection. I.e.

mysql -h 192.168.10.101 -u repl -p

(to be run on the slave, of course)


XL

Reply With Quote
  #4  
Old   
bill
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-29-2011 , 03:10 PM



On Jul 28, 5:00*am, Axel Schwenke <axel.schwe... (AT) gmx (DOT) de> wrote:
Quote:
bill <will... (AT) TechServSys (DOT) com> wrote:
The error log contains
[ERROR] Slave I/O: error connecting to master
'r... (AT) 192 (DOT) 168.10.101:3306
I do have a user on the master named repl (AT) localhost (DOT)

The user must be created on the master, the user name must be
repl@'slave-ip-address' and it needs the replication slave
privilege.

Besides that replication uses the normal MySQL protocol, so
you can use any MySQL client to test the connection. I.e.

mysql -h 192.168.10.101 -u repl -p

(to be run on the slave, of course)

XL
XL, thanks, but...
I created a user on the master (which is 192.168.10.101) named
'repl (AT) 192 (DOT) 168.0.200' (the slave ip address) and verified that it in
the master's user file.

but trying (from 192.168.0.200)
mysql -h 192.168.10.101 -u repl -p
gets me:
ERROR 2003 (HY000): Can't connect to MySQL server on
'192.168.10.101' (111)

next suggestion ?

Reply With Quote
  #5  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-29-2011 , 03:48 PM



bill <william (AT) TechServSys (DOT) com> wrote:
Quote:
On Jul 28, 5:00=A0am, Axel Schwenke <axel.schwe... (AT) gmx (DOT) de> wrote:

... replication uses the normal MySQL protocol, so
you can use any MySQL client to test the connection. I.e.

mysql -h 192.168.10.101 -u repl -p

I created a user on the master (which is 192.168.10.101) named
'repl (AT) 192 (DOT) 168.0.200' (the slave ip address) and verified that it in
the master's user file.
OK

Quote:
but trying (from 192.168.0.200)
mysql -h 192.168.10.101 -u repl -p
gets me:
ERROR 2003 (HY000): Can't connect to MySQL server on
'192.168.10.101' (111)
$perror 111
OS error code 111: Connection refused

The TCP connection was refused. Firewall?
Or maybe a VPN configuration issue?
Looks not like a MySQL problem.


XL

Reply With Quote
  #6  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-29-2011 , 03:59 PM



Axel Schwenke wrote:
Quote:
bill <william (AT) TechServSys (DOT) com> wrote:
On Jul 28, 5:00=A0am, Axel Schwenke <axel.schwe... (AT) gmx (DOT) de> wrote:
... replication uses the normal MySQL protocol, so
you can use any MySQL client to test the connection. I.e.

mysql -h 192.168.10.101 -u repl -p

I created a user on the master (which is 192.168.10.101) named
'repl (AT) 192 (DOT) 168.0.200' (the slave ip address) and verified that it in
the master's user file.

OK

but trying (from 192.168.0.200)
mysql -h 192.168.10.101 -u repl -p
gets me:
ERROR 2003 (HY000): Can't connect to MySQL server on
'192.168.10.101' (111)

$perror 111
OS error code 111: Connection refused

That merely means the SYN packet got to the socket, and there was
nothing registered to listen for it.

Whilst that behaviour CAN be a firewall, its more likely that mysqld
simply isnt listening at the far end.

Firewalls are more likely to simply send nothing back at all. In which
case you get a timeout, not a connection refused.




Quote:
The TCP connection was refused. Firewall?
Or maybe a VPN configuration issue?
Looks not like a MySQL problem.

It could be. mysqld - at least in my setups - is not configured to
listen on ip ports other that 127.0.0.1 or to remote requests.
Quote:
XL

Reply With Quote
  #7  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-29-2011 , 04:04 PM



On 7/29/2011 4:10 PM, bill wrote:
Quote:
On Jul 28, 5:00 am, Axel Schwenke<axel.schwe... (AT) gmx (DOT) de> wrote:
bill<will... (AT) TechServSys (DOT) com> wrote:
The error log contains
[ERROR] Slave I/O: error connecting to master
'r... (AT) 192 (DOT) 168.10.101:3306
I do have a user on the master named repl (AT) localhost (DOT)

The user must be created on the master, the user name must be
repl@'slave-ip-address' and it needs the replication slave
privilege.

Besides that replication uses the normal MySQL protocol, so
you can use any MySQL client to test the connection. I.e.

mysql -h 192.168.10.101 -u repl -p

(to be run on the slave, of course)

XL

XL, thanks, but...
I created a user on the master (which is 192.168.10.101) named
'repl (AT) 192 (DOT) 168.0.200' (the slave ip address) and verified that it in
the master's user file.

but trying (from 192.168.0.200)
mysql -h 192.168.10.101 -u repl -p
gets me:
ERROR 2003 (HY000): Can't connect to MySQL server on
'192.168.10.101' (111)

next suggestion ?
Assuming the master is running, is the port (default port 3306) open and
not firewalled? Try telnetting to that port from the remote to see if
you can get a connection. You won't be able to do anything - but
whether you get a connection or not is the critical part.

If not, check your MySQL configuration file to ensure networking is
enabled and the port is set properly. In the [mysqld] section look for:

port = (default 3306)
skip-networking = (should NOT be set or set to NO)
bind-address (should NOT be set or should be set to the remote's
ip address).

If these are set properly, try to telnet to port 3306 from the master
itself. If you can do it there, check your firewall - it's probably
blocking connections to the port from outside.

This should cover the most common problems with getting MySQL networking
going. Let us know if it works.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #8  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-29-2011 , 04:08 PM



The Natural Philosopher wrote:
Quote:
Axel Schwenke wrote:
bill <william (AT) TechServSys (DOT) com> wrote:
On Jul 28, 5:00=A0am, Axel Schwenke <axel.schwe... (AT) gmx (DOT) de> wrote:
... replication uses the normal MySQL protocol, so
you can use any MySQL client to test the connection. I.e.

mysql -h 192.168.10.101 -u repl -p

I created a user on the master (which is 192.168.10.101) named
'repl (AT) 192 (DOT) 168.0.200' (the slave ip address) and verified that it in
the master's user file.

OK

but trying (from 192.168.0.200)
mysql -h 192.168.10.101 -u repl -p
gets me:
ERROR 2003 (HY000): Can't connect to MySQL server on
'192.168.10.101' (111)

$perror 111
OS error code 111: Connection refused


That merely means the SYN packet got to the socket, and there was
nothing registered to listen for it.

Whilst that behaviour CAN be a firewall, its more likely that mysqld
simply isnt listening at the far end.

Firewalls are more likely to simply send nothing back at all. In which
case you get a timeout, not a connection refused.




The TCP connection was refused. Firewall?
Or maybe a VPN configuration issue?
Looks not like a MySQL problem.


It could be. mysqld - at least in my setups - is not configured to
listen on ip ports other that 127.0.0.1 or to remote requests.
Further research:
=================

e.g. in my my.cnf is:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#


That should be changed to 0.0.0.0

That will bind the daemon to any and all interfaces

If that presents a security issue, then use a firewall like IP tables to
reduce access to the desired remote clients.


Quote:
XL

Reply With Quote
  #9  
Old   
Kees Nuyt
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-30-2011 , 05:19 AM



On Fri, 29 Jul 2011 17:04:12 -0400, Jerry Stuckle
<jstucklex (AT) attglobal (DOT) net> wrote:

Quote:
bind-address (should NOT be set or should be set to the remote's
ip address).
Are you sure? I would expect it should be set (in this
use case) to either

0.0.0.0 (=listen on all interfaces)

or

192.168.10.101 (=listen on the interface
the partner tries to connect to).

Best regards,
--
( Kees Nuyt
)
c[_]

Reply With Quote
  #10  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-30-2011 , 05:21 AM



Kees Nuyt wrote:
Quote:
On Fri, 29 Jul 2011 17:04:12 -0400, Jerry Stuckle
jstucklex (AT) attglobal (DOT) net> wrote:

bind-address (should NOT be set or should be set to the remote's
ip address).

Are you sure? I would expect it should be set (in this
use case) to either

0.0.0.0 (=listen on all interfaces)

or

192.168.10.101 (=listen on the interface
the partner tries to connect to).

Best regards,
unsetting it has the same effect as setting it to 0.0.0.0

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.