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
  #11  
Old   
Kees Nuyt
 
Posts: n/a

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






On Sat, 30 Jul 2011 11:21:21 +0100, The Natural
Philosopher <tnp (AT) invalid (DOT) invalid> wrote:

Quote:
Kees Nuyt wrote:
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
Indeed.
Best regards,
--
( Kees Nuyt
)
c[_]

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

Default Re: Replication not working - replication newbie - 07-30-2011 , 08:23 AM






On 7/30/2011 6:19 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,
Yes I am. Check the documentation. 0.0.0.0 is the default.

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

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

Default Re: Replication not working - replication newbie - 07-30-2011 , 09:28 AM



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
Resolved: in the default my.cnf supplied with Ubuntu is an entry
"bind-address = 127.0.0.1"
which prevents the mysql daemon from accepting connections other than
locally.

Commenting out this entry fixed the problem and replication is working
well.
This brings up 2 questions:
1) how does phpmyadmin connect from a remote computer (and it did) ?
2) rather than leaving it wide open, what can I put for bind-address
to allow both local access and replication from a remote IP address ?

bill

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

Default Re: Replication not working - replication newbie - 07-30-2011 , 09:54 AM



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

Resolved: in the default my.cnf supplied with Ubuntu is an entry
"bind-address = 127.0.0.1"
which prevents the mysql daemon from accepting connections other than
locally.

Commenting out this entry fixed the problem and replication is working
well.
This brings up 2 questions:
1) how does phpmyadmin connect from a remote computer (and it did) ?
you must have told it where to look? Or was it running on the remote
mnchine ?


Quote:
2) rather than leaving it wide open, what can I put for bind-address
to allow both local access and replication from a remote IP address ?

I answered that already. The answer is nothing at the mysqld level.
You need to install and configure iptables.

Oh. Its on the system by default in Ubuntu.

This may help

https://help.ubuntu.com/10.04/server.../firewall.html


But that takes us off the scope of this NG, so try comp.os.linux.misc or
one of the ubuntu fora.

> bill

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

Default Re: Replication not working - replication newbie - 07-30-2011 , 09:58 AM



On 7/30/2011 10:28 AM, 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

Resolved: in the default my.cnf supplied with Ubuntu is an entry
"bind-address = 127.0.0.1"
which prevents the mysql daemon from accepting connections other than
locally.

Commenting out this entry fixed the problem and replication is working
well.
This brings up 2 questions:
1) how does phpmyadmin connect from a remote computer (and it did) ?
2) rather than leaving it wide open, what can I put for bind-address
to allow both local access and replication from a remote IP address ?

bill
1) PHPMyAdmin was running on the server, so the connection was local
2) Set up your server's firewall properly. MySQL can't handle two
different ip addresses.

However, accessing MySQL through "localhost" (vs. 127.0.0.1) will use a
Unix socket, not the TCP/IP port. It's another way MySQL is screwed up
- it doesn't honor the standard for "localhost".

Now someone will hop in here and say you can do it by specifying your
user id as coming from the slave, i.e. slaveuser'@'192.168.1.105. But
that just limits this user to be connect from this address; it doesn't
stop other connections (and other MySQL users which may have been
created with a generic address).

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

Reply With Quote
  #16  
Old   
Gordon Burditt
 
Posts: n/a

Default Re: Replication not working - replication newbie - 07-30-2011 , 06:18 PM



Quote:
Resolved: in the default my.cnf supplied with Ubuntu is an entry
"bind-address = 127.0.0.1"
which prevents the mysql daemon from accepting connections other than
locally.

Commenting out this entry fixed the problem and replication is working
well.
This brings up 2 questions:
1) how does phpmyadmin connect from a remote computer (and it did) ?
phpmyadmin involves a connection from PHP on the web server to the
MySQL server. If both are on the local host, that explains why it
works. It's irrelevant where the web browser is.

Quote:
2) rather than leaving it wide open, what can I put for bind-address
to allow both local access and replication from a remote IP address ?
bind-address is not a firewall. It's supposed to specify a local
IP address on the server machine. 0.0.0.0 represents 'all of them'.
You get the choice: local only, or let the world in.


If you want a firewall, install and use one. You can use user@IP_address
logins to restrict a particular login to come from a particular IP
address. That doesn't prevent some other IP address from repeatedly
trying to connect and loading down your server. And if there's a
bug in the server (regardless of whether it's MySQL, Oracle, Postgres,
or whatever) they might manage to get in or crash your server. You
probably want to firewall off the Internet at large from any database
server.

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

Default Re: Replication not working - replication newbie - 07-31-2011 , 08:39 AM



The Natural Philosopher <tnp (AT) invalid (DOT) invalid> wrote:
Quote:
The Natural Philosopher wrote:

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
This is not the default. Some distributors might put such a line
in the my.cnf. But this is a poor decision unless they ask for
confirmation that this MySQL server is only to be used locally.


XL

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

Default Re: Replication not working - replication newbie - 07-31-2011 , 11:40 AM



Axel Schwenke wrote:
Quote:
The Natural Philosopher <tnp (AT) invalid (DOT) invalid> wrote:
The Natural Philosopher wrote:

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

This is not the default. Some distributors might put such a line
in the my.cnf. But this is a poor decision unless they ask for
confirmation that this MySQL server is only to be used locally.

well that is as may be.

It is certainly the default in Debian.

Anyway, the main thing is the OP's question was answered.

Very few people do run mysql remotely, in the 'newbie' class, and those
who don't are usually able to work through the config file changes
successfully.

So I think its a decent enough default.
Quote:
XL

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.