By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,291 Members | 3,096 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,291 IT Pros & Developers. It's quick & easy.

MySQL two way replication won't shutdown

P: n/a
Hi,
I have read up on MySQL failover/replication and decided that weren't
many cons to setting up two way replication where two servers are both
master and slave to eachother. Here's the my.cnf:
[mysqld]
log-bin
log-slave-updates
server-id=2
master-host=10.0.0.2
master-user=repl
master-password=<password>
The my.cnf on the other server is same except for server-id and
master-host.
This works fine when in use, updates to either server are immediately
shown on the other one. However, I'm not distributing the load, this
was done only for a failover situation when one server goes down, the
other one is available. I'm only doing db queries, selects and inserts
on one server.
The problem is that when I try to shutdown either one, the mysqld stop
hangs:
# /etc/rc.d/mysqld stop

Stopping mysqld.
Waiting for PIDS: 7021, 7021, 7021, 7021, 7021, 7021, 7021, 7021, 7021,
7021, 7021, 7021, etc etc etc

This happens on both servers. They're MySQL 4.0.22(tried 4.1.7 with
same problem) on NetBSD 2.0. When I do a STOP SLAVE; on either one, it
takes about 1 min. Then I'm able to shutdown.

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ad****@gmail.com wrote:
Hi,
I have read up on MySQL failover/replication and decided that weren't
many cons to setting up two way replication where two servers are both
master and slave to eachother. Here's the my.cnf:
[mysqld]
log-bin
log-slave-updates
server-id=2
master-host=10.0.0.2
master-user=repl
master-password=<password>
The my.cnf on the other server is same except for server-id and
master-host.
This works fine when in use, updates to either server are immediately
shown on the other one. However, I'm not distributing the load, this
was done only for a failover situation when one server goes down, the
other one is available. I'm only doing db queries, selects and inserts
on one server.
The problem is that when I try to shutdown either one, the mysqld stop
hangs:
# /etc/rc.d/mysqld stop

Stopping mysqld.
Waiting for PIDS: 7021, 7021, 7021, 7021, 7021, 7021, 7021, 7021, 7021,
7021, 7021, 7021, etc etc etc

This happens on both servers. They're MySQL 4.0.22(tried 4.1.7 with
same problem) on NetBSD 2.0. When I do a STOP SLAVE; on either one, it
takes about 1 min. Then I'm able to shutdown.

Did you try to determine which process has been given the PID you named?
Is this a mysql process? Are their more details about this process
because I think this might be the replication/slave process.

I don't know for sure because I've never set up two way replication
between two servers. The slave always catches up with the master but if
the slave is also a master of it's own slave you are likely to create
some sort of loop.
If you are inserting records on both servers this is a very bad setup
because duplicate records are easily created this way! Therefore I use
to replicate only one way!

The delay in the shut down is that the servers are waiting on each other
when you try to shut them down I guess!

When you first enter the command stop slave they stop syncing their last
data now updates on one server are not replicated on the other and
have... you are not creating a loop-like stucture here. For both servers
to exit it might take some time then while they have to write log
positions, flush tables etc.

Another piece of advice: don't put passwords and user accounts in your
conf file(s). You just need to start the master once and also need to
start the slave once from within the mysql client with some simple MySQL.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.