hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : How to fix mysql backup issue
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

How to fix mysql backup issue

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 05-25-2009, 02:26 AM
schooglepets schooglepets is offline
Web Hosting Guru
 
Join Date: Oct 2002
Posts: 290

How to fix mysql backup issue


I have some NAS storage to do backups to with my dedicated hosting provider. I setup automatic daily backups with WHM to backup the databases and accounts. The server is hosting one site. When it does the backup, it does a mysql dump, and essentially takes the site down for the whole time it is doing the backup because nobody can connect to the database while the dump is happening. Is there a better way to do the backup so that this won't happen, whether it be a different method of backing up to NAS, or just not using NAS at all and using some other method.

__________________
GoldFire Studios
Online Game Advertising


Reply With Quote


Sponsored Links
  #2  
Old 05-25-2009, 07:50 AM
Lightwave Lightwave is offline
Web Hosting Master
 
Join Date: Apr 2003
Location: San Jose, CA.
Posts: 1,616
One good way is using MySQL replication. Setup a master and slave server, then do database dumps against the slave.

__________________
Daved @ Lightwave Networking, LLC.
AS1426 https:/www.lightwave.net
Primary Bandwidth: EGIHosting (NLayer, Hurricane Electric, Global Crossing, Bandcon)
Xen PV VPS Hosting

Reply With Quote
  #3  
Old 05-25-2009, 11:50 AM
schooglepets schooglepets is offline
Web Hosting Guru
 
Join Date: Oct 2002
Posts: 290
Could you tell me again in english please?

__________________
GoldFire Studios
Online Game Advertising


Reply With Quote
Sponsored Links
  #4  
Old 05-25-2009, 12:26 PM
UNIXy UNIXy is offline
Warp Speed!
 
Join Date: Feb 2008
Location: Houston, Texas, USA
Posts: 2,740
The reason no one can connect to the database while the dump is in progress has to do with mysqldump taking large locks on your tables. So any transaction trying to take place sleeps until the lock is released. You could tell mysqldump to not acquire locks using the following flags / switches:

Quote:
mysqldump -u root --skip-add-locks --skip-lock-tables dbname
The above will not cause new connections to stall but it will not generate consistent backups due to concurrency issues. The clean way to take backups without messing with locking is to do what Lightwave suggested. Replicate your current database (master) to another mysql instance (slave). Then point your backup scripts at the slave database instead of the master. The slave database can be locked and it won't affect the availability of your current websites / database.

Here's an intro on replication: http://dev.mysql.com/doc/refman/5.0/en/replication.html

Best

__________________
|- UNIXY :: Fully Managed Servers and Clusters Since 2006
|- DC POP :: Houston, Los Angeles, Atlanta, & Rotterdam NL
|- Managed Magento Varnish Servers w/ ESI. < 250ms Page Load / TTFB
L- We LOVE helping our clients!

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
BackupAgent Integrates Cloud Backup Platform with Citrix CloudPortal Web Hosting News 2012-09-18 16:14:43
New BackupAgent Version Simplifies Channel Delivery of Cloud Backup Solution Web Hosting News 2012-06-26 16:57:11
WHD 2012 - Data Backup Firm R1Soft to Launch Japanese, Spanish Support Web Hosting News 2012-03-22 10:30:09
Scaling a Profitable Backup Service with IASO's Johan Jongsma Web Hosting News 2012-02-15 18:10:40
Web Host Qube Offers R1Soft Continuous Data Protection Web Hosting News 2011-12-09 17:09:58


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?