Documente Academic
Documente Profesional
Documente Cultură
com Page 1 of 8
Free Newsletters:
DatabaseDaily
Search Database Jour
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum
Best Practices for Developing a Web Site: Checklists, Tips, Strategies & More. Download Exclusive eBook N
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011
DRBD and MySQL - Virtualbox Setup — DatabaseJournal.com Page 2 of 8
http://www.virtualbox.org/wiki/Downloads
It of course comes with a simple GUI installer, so I won't go through that in too m
detail. That is pretty straightforward. Once you have that installed, fire it up and
run through the steps to create a vm. Since we will also be installing CentOS on
virtual machines, I recommend you go find that here:
http://mirror.centos.org/centos/5/isos/
1. Create the vm using the virtualbox GUI by clicking "New". A wizard will tak
you through the process. Enter the name, specify "Linux" as the OS, and sele
Redhat 64 bit as the OS. Unfortunately it won't install that for you too, but it
wouldn't really be a true vm if it did that for you. Leave base memory, boot h
disk, create new hard disk, etc. all at their defaults. It creates an 8GB disk an
left that at default too. Then click finish and it will create the virtual
finish again and it will create the vm.
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011
DRBD and MySQL - Virtualbox Setup — DatabaseJournal.com Page 3 of 8
2. You'll need to add a second disk for your DRBD use. A small 25M disk will b
fine. Click the "Settings" for your new vm, and then select the "Storage" tab.
simplicities sake we used a new SCSI controller. Click the add disk button a fe
times until the wizard comes up. Click "Create". Use defaults, and give it a na
like adelie_data.vdi, then make it 25M in size.
4. Per our recommendation above, if you haven't already, download your Cent
ISO for 5.4.
5. We'll also need to specify the ISO media. This can be a little tricky as the
interface is a little odd in this regard. Go back to the "Storage" tab, and
the CD/DVD symbol under IDE Controller. Click the little folder icon on the rig
hand side, and a popup comes up. If you don't see your ISO image, use the "
button, and find your ISO and select it. The virtualbox will treat your
mounted CD image.
6. Start your engines. That's right, finally we can start the vm. Hopefully the
CentOS installer comes up. If you have trouble, use the disk symbol at the
bottom of the window, click for the menu, and select your DVD ISO of CentOS
7. Install CentOS 5.4. Run through the screens and click OK.
8. Verify and start your network. Hopefully this has already happened by defa
with DHCP. See also these commands:
$ /sbin/ifconfig eth0
$ /sbin/ifup eth0
You'll now need to run through these same eight steps again to create the second
we called it african.
1. Use yum to install the drbd tools, and the kernel module:
internet.commerce
$ yum install drbd83.x86_64
Be a Commerce Partner $ yum install kmod-drbd83.x86_64
VPS Hosting
Liability Insurance 2. Install the mysql server software:
Televisions
Calling Cards $ yum install mysql-server.x86_64
Virtual Server
Host your Site 3. Install emacs:
Prepaid Phone Card
Site Hosting $ yum install emacs
Desktop Computers
Promote Your Website
Web Hosting 4. Configure drbd.conf as follows (same on both boxes). Note the IP addresse
Phone Cards device and disk specification. If you created your virtualbox just like we
Business Liability
should all be the same. IP address will still depend on your DHCP server.
Website Hosting
common {
protocol C;
}
resource sean {
on adelie {
device /dev/drbd0;
disk /dev/sda1;
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011
DRBD and MySQL - Virtualbox Setup — DatabaseJournal.com Page 4 of 8
meta-disk internal;
address 192.168.0.106:7789;
Nokia CEO Warns of
}
Sinking Smartphone on african {
Business device /dev/drbd0;
disk /dev/sda1;
Google Updates meta-disk internal;
Chrome 9 Security, address 192.168.0.105:7789;
Again }
}
Is Microsoft Planning a
Management Shakeup?
Start DRBD
This part turned out to be a huge struggle. I configured it, but tried over and ove
internet.com avail to get things working. It turned out that the firewall that Linux by default in
IT blocked the ports 7789 on both machines. So DRBD couldn't reach each other on
Developer two nodes. This failed silently and repeatedly and all I knew was that it wasn't
Internet News
Small Business
connecting. So be sure to disable iptables. Since these are virtual boxes, I recom
Personal Technology just deleting the file: /etc/rc.d/rc3.d/S08iptables
Search internet.com Use fdisk to create a partition roughly 25M in size on each node.
Advertise
Corporate Info $ fdisk /dev/sda
Newsletters
Tech Jobs
E-mail Offers Use drbdadm to create the initial mirrored device as follows:
$ drbdadm create-md sean
This will synchronize all data between the two volumes for the first time. Note th
you have data you want to preserve you should (a) do a backup of it of
(b) perform this step on the node whose data you want to preserve!
$ drbdadm -- --overwrite-data-of-peer primary sean
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011
DRBD and MySQL - Virtualbox Setup — DatabaseJournal.com Page 5 of 8
$ umount /mnt/mysql
Mount it:
$ mount /dev/drbd0 /mnt/mysql
Start MySQL:
$ mysqld_safe &
Conclusion
DRBD is some sophisticated technology. Luckily, with today's VM technology such
Sun's Virtualbox, we can set up a couple of virtual machines quite easily, and test
the technology. We've tried to break that whole process down into really simple s
You should be able to follow those and get your whole DRBD setup in no time. H
the lessons we learned in the process will save you some time.
In our next installment of this series, we'll explain how to set up heartbeat to han
failover automatically and gracefully. This is the piece that we describe in "test
switching to the other node" above. Heartbeat will automatically perform all of th
steps, and determine when a node is out of commission.
Sean Hull
Tools:
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011
DRBD and MySQL - Virtualbox Setup — DatabaseJournal.com Page 6 of 8
MySQL Archives
This is a very bad idea on a few aspects. First off, ext3 file system will lead to problems. This is not
cluster file system designed to be written simultaneously by two machines corrupt inodes will stack v
quickly, You should format with either ocfs2 or gfs2 as these file systems are designed to written to
same time from many different machines. Secondly, mysql is not designed to run with
not in this type of setup and that is just asking for errors. I don't know if there is a shared disk option
but if you are running on two hosts then you are better off with replication, in the case where you wa
writes to either host, then multi master replication. If you have 3 or more then look into mysql
which case all allow writes by default.
NO, he's configuring active/passive. This is much safer than using mysql replication (which can lose
transactions).
Read about why Sun recommends and supports DRBD for MySQL clustering:
http://www.mysql.com/products/enterprise/drbd.html
What is a bad idea, though, is using virtualbox. OK for testing, but don't expect decent
Your name/nickname
Your email
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011
DRBD and MySQL - Virtualbox Setup — DatabaseJournal.com Page 7 of 8
Please type the alphanumeric characters above and click "Submit" to continue.What's this?
The Future of IT Continuity: Check out this webcast to see what it will take to get there.
Get a free identity and access management assessment by Quest Software and the Aberdeen
Microsoft Article: Enterprise Social Computing with Microsoft SharePoint 2010. Learn
How much will an IT security breach cost you? IBM and industry leaders share their
Virtual Event: The Future of IT Continuity. Register now to see what will happen to IT
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011
DRBD and MySQL - Virtualbox Setup — DatabaseJournal.com Page 8 of 8
Search:
About Internet.com
Copyright 2011 QuinStreet Inc. All Rights Reserved.
Solutions
Whitepapers and eBooks
PHP for Windows Showcase MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Resource: PHP for Windows Showcase
Webcasts
Software License Operations - Cleaning Up the Backoffice MORE WEBCASTS, PODCASTS, AND VIDEOS
http://www.databasejournal.com/features/mysql/article.php/3856061/DRBD-and-MySQL-... 2/24/2011