473,657 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL two way replication won't shutdown

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=<passw ord>
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
1 2186
ad****@gmail.co m 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=<passw ord>
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1720
by: thomas-lists | last post by:
Hey folks, before posting to the bugs-list I would like to try it here to get some help :). Every now and then MySQL-4.0.13 crashes on my Dual-Athlon-MP-machine. Its not reproducible nor I know a query which does it. (The log shows that at the end, so no query :-( : Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0x5e13a478 is invalid pointer thd->thread_id=2223573
0
3259
by: I.P. | last post by:
Hi, it's my story. I have two 4.0.14 mysql server on one machine with win XP Professional polish version. First acts as master: on port 3300 Second acts as slave: on port 3301 below my configuration:
0
2136
by: I.P. | last post by:
No one has replied to my post. ----- Original Message ----- From: "I.P." <jancio_wodnik@wp.pl> To: <mysql@lists.mysql.com> Sent: Monday, August 18, 2003 1:01 PM Subject: mysql 4.0.14 + replication + windows XP PROF Hi, it's my story.
5
12668
by: news | last post by:
I just installed Slackware 10.1 Still need to install some missing needed libraries, but I think that's unrelated. Every time it boots up, or I try "/etc/rc.d/rc.mysqld start" I get this: Starting mysqld daemon with databases from /var/lib/mysql STOPPING server from pid file /var/run/mysql/mysql.pid mysqld ended
39
8392
by: Mairhtin O'Feannag | last post by:
Hello, I have a client (customer) who asked the question : "Why would I buy and use UDB, when MySql is free?" I had to say I was stunned. I have no experience with MySql, so I was left sort of stammering and sputtering, and managed to pull out something I heard a couple of years back - that there was no real transaction safety in MySql. In flight transactions could be lost.
7
1999
by: Andy K | last post by:
Hi , I have an existing database (on a Linux Red Hat ES3) where the replication function exists but does not work because the target database has been shutdown months ago . My question is what will happens if i start the target database ? Will there be problems with the source database or the target database (decreasing performance or other kinds of problem )?
67
12499
by: Bob Powell | last post by:
To whom it may concern: I find the recent articles in various trade publications a little disturbing due to the lack of PostgrSQL mention. I continue to see articles about how IBM may be considering MYSQL for development an open_source web database. Why isn't PostgreSQL being considered or talked about by major industry giants? As a DBA I know that Postgres is far superior to MYSQL but if the industry directs it's energies towards...
13
2301
by: Jim Hubbard | last post by:
I have a client that desires a new application for use at several stores in different cities. He wants "real time" access to all store data and the ability to continue to run locally even if the internet connection goes down. It occurs to me that a local MySQL instance should definitely be in each store to continue work if the net is down for any reason. But, what is the best way to synchronize/share data among all of the stores? ...
0
12885
Coldfire
by: Coldfire | last post by:
Since i cannot show the differences in a two-column like table. I am first putting MS SQL Server 2005 and then MySQL 5.x. MS SQL Server 2005 Brief Overview - SQL Server is a full-fledged database system developed specifically for large enterprise databases. All advanced features of a relational database are fully implemented. - Once you purchase the product, you are only limited to the Sybase-derived engine.
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7316
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.