I want to set up a multiple "mode" computer with four separate Centos installations on it. The objective here is to have a "spare computer" that I can boot up into any of four "modes" depending on what I'm swapping it in for a the moment. For example, I want to be able to boot it up as a webserver, or as a fileserver, or as a LTSP-enabled application server. And so on.
I have a computer here with two 300GB hard drives in it, which I plan to split into four 150GB partitions, one for each of my "modes". And I want to install Centos separately and independently into each partition, so I can just tell Grub to boot up using whatever partition I choose.
What is the best way to accomplish this? I have a bad feeling that the drive partitioning tool is going to complain about having multiple / partitions unless I take steps to avoid that.
----- Original Message ----- From: "Frank Cox" theatre@sasktel.net To: centos@centos.org Sent: Tuesday, December 18, 2007 1:20:01 PM (GMT+1000) Australia/Brisbane Subject: [CentOS] "multi-boot" drive partitioning
I want to set up a multiple "mode" computer with four separate Centos installations on it. The objective here is to have a "spare computer" that I can boot up into any of four "modes" depending on what I'm swapping it in for a the moment. For example, I want to be able to boot it up as a webserver, or as a fileserver, or as a LTSP-enabled application server. And so on.
I have a computer here with two 300GB hard drives in it, which I plan to split into four 150GB partitions, one for each of my "modes". And I want to install Centos separately and independently into each partition, so I can just tell Grub to boot up using whatever partition I choose.
What is the best way to accomplish this? I have a bad feeling that the drive partitioning tool is going to complain about having multiple / partitions unless I take steps to avoid that.
On Tue, 18 Dec 2007 13:44:38 +1000 (EST) "redhat@mckerrs.net" redhat@mckerrs.net wrote:
Have you thought about virtualization ? What hardware are you planning on running this on ?
It's a new Intel Pentium Core 2 machine.
I don't want to complicate this thing any more than I have to. I want to be able to put this machine in the corner and tell the guy who owns the place that if his webserver quits, he can put the spare online and hit "1", if the application server quits, put it online and hit "2" and so on. And 4 independent and separate Centos installations sounds like the easiest way to accomplish that, if I knew how to partition the disk.
On Mon, 17 Dec 2007 21:52:59 -0600 Frank Cox theatre@sasktel.net wrote:
I don't want to complicate this thing any more than I have to. I want to be able to put this machine in the corner and tell the guy who owns the place that if his webserver quits, he can put the spare online and hit "1", if the application server quits, put it online and hit "2" and so on. And 4 independent and separate Centos installations sounds like the easiest way to accomplish that, if I knew how to partition the disk.
I just found this, which may get me where I'm going:
http://www.hentzenwerke.com/wp/installingmultiplelinuxdistributions_onasingl...
----- Original Message ----- From: "Frank Cox" theatre@sasktel.net To: "CentOS mailing list" centos@centos.org Sent: Tuesday, December 18, 2007 2:43:08 PM (GMT+1000) Australia/Brisbane Subject: Re: [CentOS] "multi-boot" drive partitioning
On Mon, 17 Dec 2007 21:52:59 -0600 Frank Cox theatre@sasktel.net wrote:
I don't want to complicate this thing any more than I have to. I want to be able to put this machine in the corner and tell the guy who owns the place that if his webserver quits, he can put the spare online and hit "1", if the application server quits, put it online and hit "2" and so on. And 4 independent and separate Centos installations sounds like the easiest way to accomplish that, if I knew how to partition the disk.
****
I don't understand what you are trying to achieve. Some sort of (poor mans) redundancy at the hard disk level ? When would the "webserver quit" ? E.g. if your motherboard dies then it doesn't matter how many copies of an os you have spread over how many disks, the whole thing is unavailable.
Why not mirror the two 300gb drives, using software raid and install the centos virtualization and run any number of vms *all the time* ?
I think what you are looking at doing is way more complicated than setting up a few vms under xen. But that may just be because I have experience with virtualization.
On Tue, 18 Dec 2007 14:48:57 +1000 (EST) "redhat@mckerrs.net" redhat@mckerrs.net wrote:
I don't understand what you are trying to achieve. Some sort of (poor mans) redundancy at the hard disk level
A spare computer that can be swapped in to replace any of 4 other computers without requiring a lot of setup between "the main machine died" and "the spare is now online."
? When would the "webserver quit" ? E.g. if your motherboard dies then it doesn't matter how many copies of an os you have spread over how many disks, the whole thing is unavailable.
That's when you whip out the spare computer, plug it into the network, boot it up and hit "1" to load the webserver, and then take the main webserver machine apart and find out why it died at your leisure. At least, that's the idea.
Why not mirror the two 300gb drives, using software raid and install the centos virtualization and run any number of vms *all the time* ?
Because the spare machine may have to replace any of 4 different computers that live on two separate networks. There is no need to have a second webserver running, for example, until the main webserver quits. If it quits, it would be nice to have another one all set up and ready to plug in. Boot up, restore the webpage data from last night's backup, and put it online. I want to have Apache set up and everything else on the spare machine before the problem arises.
Same for the fileserver, the LTSP server, and so on. One spare machine that has 4 "personalities", as required.
----- Original Message ----- From: "Frank Cox" theatre@sasktel.net To: centos@centos.org Sent: Tuesday, December 18, 2007 2:55:49 PM (GMT+1000) Australia/Brisbane Subject: Re: [CentOS] "multi-boot" drive partitioning
On Tue, 18 Dec 2007 14:48:57 +1000 (EST) "redhat@mckerrs.net" redhat@mckerrs.net wrote:
I don't understand what you are trying to achieve. Some sort of (poor mans) redundancy at the hard disk level
A spare computer that can be swapped in to replace any of 4 other computers without requiring a lot of setup between "the main machine died" and "the spare is now online."
? When would the "webserver quit" ? E.g. if your motherboard dies then it doesn't matter how many copies of an os you have spread over how many disks, the whole thing is unavailable.
That's when you whip out the spare computer, plug it into the network, boot it up and hit "1" to load the webserver, and then take the main webserver machine apart and find out why it died at your leisure. At least, that's the idea.
Why not mirror the two 300gb drives, using software raid and install the centos virtualization and run any number of vms *all the time* ?
Because the spare machine may have to replace any of 4 different computers that live on two separate networks. There is no need to have a second webserver running, for example, until the main webserver quits. If it quits, it would be nice to have another one all set up and ready to plug in. Boot up, restore the webpage data from last night's backup, and put it online. I want to have Apache set up and everything else on the spare machine before the problem arises.
Same for the fileserver, the LTSP server, and so on. One spare machine that has 4 "personalities", as required.
On Tue, 18 Dec 2007 15:32:37 +1000 (EST) "redhat@mckerrs.net" redhat@mckerrs.net wrote:
You have another computer, which, I presume, is exactly the same as the 'live' one ?
In this application, I have five computers. Four of them are in use, running 24/7, doing four different jobs ranging from running a webserver to answering the phone to creating plates for a printing press.
The fifth one is going to spend most of its life switched off, sitting in the corner, ready to swap in for any one of the other four machines.
I'd still bet my money on the the fact that you'd spend more time rooting around with installation, backups and restores than if you setup software mirroring and used virtualization.
How does this compare to your solution with regards to complexity and system
availability ?
Unless I'm missing something (which is highly likely) I still don't see how that would get me where I'm going. I don't need to have a "second copy" of anything running, until the "main machine" quits. I'll be quite happy to have the spare machine gathering dust in the corner, as long as I know it's ready to boot up and "assume the position" if it's needed.
----- Original Message ----- From: "Frank Cox" theatre@sasktel.net To: "CentOS mailing list" centos@centos.org Cc: redhat@mckerrs.net Sent: Tuesday, December 18, 2007 3:42:56 PM (GMT+1000) Australia/Brisbane Subject: Re: [CentOS] "multi-boot" drive partitioning
On Tue, 18 Dec 2007 15:32:37 +1000 (EST) "redhat@mckerrs.net" redhat@mckerrs.net wrote:
You have another computer, which, I presume, is exactly the same as the 'live' one ?
In this application, I have five computers. Four of them are in use, running 24/7, doing four different jobs ranging from running a webserver to answering the phone to creating plates for a printing press.
The fifth one is going to spend most of its life switched off, sitting in the corner, ready to swap in for any one of the other four machines.
I'd still bet my money on the the fact that you'd spend more time rooting around with installation, backups and restores than if you setup software mirroring and used virtualization.
How does this compare to your solution with regards to complexity and system
availability ?
Unless I'm missing something (which is highly likely) I still don't see how that would get me where I'm going. I don't need to have a "second copy" of anything running, until the "main machine" quits. I'll be quite happy to have the spare machine gathering dust in the corner, as long as I know it's ready to boot up and "assume the position" if it's needed.
Frank Cox wrote on Mon, 17 Dec 2007 22:55:49 -0600:
A spare computer that can be swapped in to replace any of 4 other computers without requiring a lot of setup between "the main machine died" and "the spare is now online."
But what about the data? What is a "web sevrer" or a "file server" worth without the current data?
Kai
Kai Schaetzl wrote:
Frank Cox wrote on Mon, 17 Dec 2007 22:55:49 -0600:
A spare computer that can be swapped in to replace any of 4 other computers without requiring a lot of setup between "the main machine died" and "the spare is now online."
But what about the data? What is a "web sevrer" or a "file server" worth without the current data?
This was to be my point exactly ... what good does a machine that can boot up into a file server with last months data or a web server with last months data be if the current server just died?
If you have a backup system in place with the ability to push certain directories onto this machine, then maybe. Otherwise, this seems fairly pointless.
A live solution with Virtual Machines and something like DRBD might work ... though the machine would by fairly heavily loaded just keeping everything updated if live for 4 other machines.
Thanks, Johnny Hughes
On Tue, 18 Dec 2007 08:39:42 -0600 Johnny Hughes johnny@centos.org wrote:
This was to be my point exactly ... what good does a machine that can boot up into a file server with last months data or a web server with last months data be if the current server just died?
If you have a backup system in place with the ability to push certain directories onto this machine, then maybe. Otherwise, this seems fairly pointless.
All of the live data gets backed up every night to an offsite fileserver.
It will take a lot less time to copy the live data from the backup than it will to set up a new computer and then copy the live data from the backup.
Frank Cox wrote:
This was to be my point exactly ... what good does a machine that can boot up into a file server with last months data or a web server with last months data be if the current server just died?
If you have a backup system in place with the ability to push certain directories onto this machine, then maybe. Otherwise, this seems fairly pointless.
All of the live data gets backed up every night to an offsite fileserver.
It will take a lot less time to copy the live data from the backup than it will to set up a new computer and then copy the live data from the backup.
It probably won't help in this case, but what has worked pretty well for me has been to use swappable drives and software raid1 on critical servers, and keep a spare chassis around. If a single drive fails (the most likely failure), you just replace it and resync at a convenient time. If a motherboard or power supply fails, you move the drives to the spare server and are back with a few minutes of downtime and no data loss. You still need backups to cover some less likely modes of failure (like an admin typing 'rm -f *' in the wrong place...). This doesn't provide automatic failover or 100% uptime, but it avoids the complexity and additional failure modes that other schemes can introduce. And a nice side effect is that you can do major upgrades by building your next version on the spare box, swap the new disks into place, change the IP address (you may have to clear your router's arp table here) and be running again in the time it takes to reboot. Or, if you want to clone a server you can just pull one of the mirrored drives and resync to a new mate on both machines, changing the hostname and IP address on one of them - and both can be running while the resync proceeds.
On Tuesday 18 December 2007 14:39:42 Johnny Hughes wrote:
Kai Schaetzl wrote:
Frank Cox wrote on Mon, 17 Dec 2007 22:55:49 -0600:
A spare computer that can be swapped in to replace any of 4 other computers without requiring a lot of setup between "the main machine died" and "the spare is now online."
But what about the data? What is a "web sevrer" or a "file server" worth without the current data?
This was to be my point exactly ... what good does a machine that can boot up into a file server with last months data or a web server with last months data be if the current server just died?
If you have a backup system in place with the ability to push certain directories onto this machine, then maybe. Otherwise, this seems fairly pointless.
A live solution with Virtual Machines and something like DRBD might work ... though the machine would by fairly heavily loaded just keeping everything updated if live for 4 other machines.
Thanks, Johnny Hughes
Here is an idea. Put removable hard drive enclosures into each machine. The 4 working machines have a spare hard drive in and has a disk back up (hard drive mirror) run nightly. A working machine goes down just take out backup drive put into spare machine and go.
On Tuesday 18 December 2007 10:52:59 Frank Cox wrote:
It's a new Intel Pentium Core 2 machine.
I don't want to complicate this thing any more than I have to. I want to be able to put this machine in the corner and tell the guy who owns the place that if his webserver quits, he can put the spare online and hit "1", if the application server quits, put it online and hit "2" and so on. And 4 independent and separate Centos installations sounds like the easiest way to accomplish that, if I knew how to partition the disk.
Hello Frank, I agree with Mckerrs. Virtualization is the easier way. However if you want to do the multi-boot way. You can achieve that too.
On minimum you will need: / and swap. So, if you plan to do 4 multi-boot, you will need: (4 x /) + (1 x swap) = 5 partitions
The steps are: 1. Install the 1st Centos. Prepare the partitions, it should be: sda1 = / sda2 = swap sda3 = for / 2nd centos sda4 = extended sda5 = 3rd centos sda6 = 4th centos
2. When installing 2nd centos, install it on sda3. Important step: install the bootloader on the root partition (don't the MBR). You can use the swap from the 1st centos.
3. When done, boot, and you will see the boot loader from 1st centos. Boot into it. While in 1st centos, edit /boot/grub/menu.lst and add the entry for 2nd centos:
title CentOS no. 2 (2.6.18-8.el5) root (hd0,2) kernel /boot/vmlinuz-2.6.18-8.el5 ro root=/dev/sda3 rhgb quiet initrd /boot/initrd-2.6.18-8.el5.img
4. And so on for the rest of other centos.
HTH,
Frank Cox wrote:
On Tue, 18 Dec 2007 13:44:38 +1000 (EST) "redhat@mckerrs.net" redhat@mckerrs.net wrote:
Have you thought about virtualization ? What hardware are you planning on running this on ?
It's a new Intel Pentium Core 2 machine.
I don't want to complicate this thing any more than I have to. I want to be able to put this machine in the corner and tell the guy who owns the place that if his webserver quits, he can put the spare online and hit "1", if the application server quits, put it online and hit "2" and so on. And 4 independent and separate Centos installations sounds like the easiest way to accomplish that, if I knew how to partition the disk.
the problem with that, any configuration changes, updates, etc on the live server won't be replicated on the backups.
instead, I think I'd configure -one- OS that stays on, and can run any one of the application loads on demand (service start mywebappmess). this way any configuration changes can be replicated to the spare for each of the servers. its a simple matter for the server to enable a different IP on demand.
of course, you could put all thsi under control of heartbeat and have a real cluster :D
On Mon, 2007-12-17 at 21:20 -0600, Frank Cox wrote:
I want to set up a multiple "mode" computer with four separate Centos installations on it. The objective here is to have a "spare computer" that I can boot up into any of four "modes" depending on what I'm swapping it in for a the moment. For example, I want to be able to boot it up as a webserver, or as a fileserver, or as a LTSP-enabled application server. And so on.
I have a computer here with two 300GB hard drives in it, which I plan to split into four 150GB partitions, one for each of my "modes". And I want to install Centos separately and independently into each partition, so I can just tell Grub to boot up using whatever partition I choose.
What is the best way to accomplish this? I have a bad feeling that the drive partitioning tool is going to complain about having multiple / partitions unless I take steps to avoid that.
Fajar's post provides a simple way and seems to be what you're looking for. The key is that one boot image can have different root file systems specified using the same kernel. So, configurations can be "pre-loaded" in each FS to look like the failed node. BTW, adding one more configuration that has the sole purpose of acquiring and applying changes to the other local images would be a good idea. It's only natural that over time some configuration changes will occur and one will forget or make an error when trying to replicate those changes to the spare.
However, as mentioned by another poster, letting it set may lead to it being non-operational when needed. Cmos batteries expire, things age, dust collects, power surges get past various protections, etc.
I did something similar to this back in 199(twoish?) with a network involved on a real UNIX 5.X system, that had NFS/RFS available, to protect my client in case of HD failure (the most likely scenario then IMO).
All nodes ran continuously and user databases were distributed. Each node was sized to be able to hold both the OS and a copy of the largest 2 live data bases on any node (hoping that only one node would fail at once, but allowing for two). A cron entry did cross-copy of any changed components (excluding node-specific ones) during the wee hours of the morning and a small report was generated that let us be sure the "backups" had completed successfully. A tape backup of all that on the least loaded node was then done in background at low priority.
It was not intended for the end-user to be able to automatically bring the "spare" into the mix as a replacement for a failed unit, but it was intended that I could quickly adjust it to do so. This would require only changing shared stuff (using RFS at the time) on the replacement and activating those shares. I think I also changed the node reference on the "clients", IIRC. Anyway, with RFS, that was quick and easy. I liked RFS a lot and was sorry to see it eventually go away.
Sure enough, a drive failed eventually and I came away looking like a hero.
With todays equipment, you should be able to have the spare "sleep", awaken, receive any changes you like, and go back to sleep. A small report before re-sleeping will allow you to be sure that all is well with it.