Dear All,
I do have a centos 5 srver running the following. the server is a dell pc with standard config
1 gb ram 120 gb ide hdd 3.2 ghz cpu NIC
Mail server Dns Server webmail Mailscanner
now i would like to have another server like mirroring this server .. so incase there is any problem with this server the other server is always online and the problem server could be fixed without our users gettin affected
apprecite if anybody can help giving some clues or is there any software avaliable. also is the hardware in both servers have to be identical or it can be different
thnks n regards
simon
On Fri, Mar 28, 2008 at 9:22 AM, Mail Administrator mailadmin@baladia.gov.kw wrote: <snip>
now i would like to have another server like mirroring this server .. so incase there is any problem with this server the other server is always online and the problem server could be fixed without our users gettin affected
apprecite if anybody can help giving some clues or is there any software avaliable. also is the hardware in both servers have to be identical or it can be different
That is indeed, the holy grail of server administration and is not easily achieved.
For DNS, you can define a master/slave server setup and have both online at the same time. I'm not sure what MailScanner needs as far as real-time data storage. Perhaps it can just be set up in parallel and either machine could filter messages.
Mail message storage is your primary problem, as the data constantly changes.
The simplest way might be to house your mail store on a third server and mount it with NFS. Then if your primary goes down, simply boot up the secondary, mount the live data files and away you go with only a momentary service interruption. One problem with this setup is that whenever some configuration detail changes, you must change it on another machine. And you need to be concerned with the redundancy of the file server. There is also the issue of user accounts for mail. Are they local to the mail server or do they reference an external directory server?
You could rsync the mail files between servers to have a near-real-time copy, but any resulting inconsistencies could be a problem for your mail software. The only safe way to rsync a mail server is to do it while the mail services are stopped. You could stop the mail server, take a file system snapshot, then restart the mail server which would only take a few seconds. Then rsync from the snapshot to the backup and delete the snapshot when done.
More advanced options are clustering and drbd but those are toys I've never played with. However, as search terms on Google, they will get you started in the right direction. But they are probably overkill.
Judging by your machine specs, I'm guessing this is a pretty small scale operation. Your best bet might simply be to do nightly backups and have spare hardware at the ready. The most likely point of failure is the hard disk, so get another one and set up raid 1. Other than that, your hardware will probably run for years without issue. We all want 100% uptime, but you have to weigh the cost against the actual need.
-- Jeff
Mail Administrator wrote:
Dear All,
I do have a centos 5 srver running the following. the server is a dell pc with standard config
1 gb ram 120 gb ide hdd 3.2 ghz cpu NIC
Mail server Dns Server webmail Mailscanner
now i would like to have another server like mirroring this server .. so incase there is any problem with this server the other server is always online and the problem server could be fixed without our users gettin affected
apprecite if anybody can help giving some clues or is there any software avaliable. also is the hardware in both servers have to be identical or it can be different
The easiest way to make that happen is to use a product called DRBD
I say easy, but the initial setup will be fairly hard as you will need to link all the things you want to fail over into a partition that you can then MIRROR to another machine (if you use drbd).
Here is drbd info:
http://www.drbd.org/users-guide/index.html
Thanks, Johnny Hughes
Johnny Hughes wrote:
The easiest way to make that happen is to use a product called DRBD
do be aware, drbd replicas are not 'safe' for things like transactional databases, unless they are configured to be synchronous (such that a fsync doesn't return until its written on both the local disk AND the replica), which slows everything way down.
John R Pierce wrote:
Johnny Hughes wrote:
The easiest way to make that happen is to use a product called DRBD
do be aware, drbd replicas are not 'safe' for things like transactional databases, unless they are configured to be synchronous (such that a fsync doesn't return until its written on both the local disk AND the replica), which slows everything way down.
If you can tolerate a small amount of downtime, a more simple-minded approach is to get servers with swappable drive carriers, set up your production servers with all partitions on raid1, and keep a spare similar chassis around. Then if a single drive dies (the most likely failure), you just swap in a new one and resync the mirrors. If the motherboard or power supply dies, you swap the drives into the spare and come up in the time it takes to reboot (you'll probably have to fix the NIC setup for the different hardware addresses, though.).
Thnaks john,
u gave me a grt idea .. the second one seems quite interestin
but i do have to get additional HDD and mirror my existing server which has jus one disk
thnks and regards
simon
John R Pierce wrote:
Johnny Hughes wrote:
The easiest way to make that happen is to use a product called DRBD
do be aware, drbd replicas are not 'safe' for things like transactional databases, unless they are configured to be synchronous (such that a fsync doesn't return until its written on both the local disk AND the replica), which slows everything way down.
If you can tolerate a small amount of downtime, a more simple-minded approach is to get servers with swappable drive carriers, set up your production servers with all partitions on raid1, and keep a spare similar chassis around. Then if a single drive dies (the most likely failure), you just swap in a new one and resync the mirrors. If the motherboard or power supply dies, you swap the drives into the spare and come up in the time it takes to reboot (you'll probably have to fix the NIC setup for the different hardware addresses, though.).
-- Les Mikesell lesmikesell@gmail.com
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Mail Administrator wrote:
Thnaks john,
u gave me a grt idea .. the second one seems quite interestin
but i do have to get additional HDD and mirror my existing server which has jus one disk
This was my procedure to mirror an existing single IDE disk RH4 system.
YMMV. No guarantees. Not tested on Centos5. May eat all your data and drink all your beer.
Make a total backup before doing anything.
IIRC the grub setup is what gave me the most problem.
Hopefully, someone will chime in to point out any flaws here.
------------ Current System/OS on single 10GB IDE disk /dev/hda2 = swap @ 1GB /dev/hda1 = / @ 9GB Current system/OS is not in an LVM volume.
1. Install a 2nd identical disk as hdb 2. fdisk: /dev/hdb1 = 9000M ; /dev/hdb2 = 1000M ( rest of disk ) part1 = type FD (raid) part2 = type FD (raid) 3. Create mirror device /dev/md10 for / with 2nd disk missing: mdadm --create --level=1 --force --raid-devices=1 /dev/md10 /dev/hdb1 4. mke2fs -j /dev/md10 5. Create mirror device /dev/md11 for swap with 2nd disk missing: mdadm --create --level=1 --force --raid-devices=1 /dev/md11 /dev/hdb2 6. mkswap /dev/md11
It may be safer to start step 7 from a rescue disk.
7. mkdir /z 8. mount /dev/md10 /z 9. cd / 10. dump -a0f - . | ( cd /z ; restore -xvf - ) 11. Update pertinent lines in
/z/etc/grub.conf: splashimage=(hd0,0)/boot/grub/splash.xpm.gz root (hd0,0) kernel /boot/vmlinuz-2.6.9-11.EL ro root=/dev/md10 rhgb
/z/etc/fstab: /dev/md10 / ext3 defaults 1 1 /dev/md11 swap swap defaults 0 0
12. Shutdown 13. swap hdb & hda around 14. Boot RHEL4 linux rescue ; let system find/mount RHEL Installations 15. fdisk hdb to be identical to hda 16. chroot /mnt/sysimage 17. grub-install /dev/hda 18. grub-install /dev/hdb 19. Setup grub: grub root (hd0,0) setup (hd0) quit 20. Create new initrd(s) to include modules raid, scsi, lvm, etc needed at boot time: mkinitrd --with=raid0 --with=raid1 --with=raid5 --with=aic79xx /boot/initrd-2.6.9-22.EL.img.new mv /boot/initrd-2.6.9-22.EL.img /boot/initrd-2.6.9-22.EL.img.old cp /boot/initrd-2.6.9-22.EL.img.new /boot/initrd-2.6.9-22.EL.img 21. Reboot to normal startup on the new mirrored / & swap.
Step 21 needs to boot cleanly. Step 22 will remove your last chance to revert to the old setup by installing the original boot disk as hda. If something goes bad here, may need to restore from backup.
22. Add in 2nd disk to md10 mirror set: mdadm --grow /dev/md10 --raid-devices=2 mdadm --add /dev/md10 /dev/hdb1
23. Add in 2nd disk to md11 mirror set: mdadm --grow /dev/md11 --raid-devices=2 mdadm --add /dev/md11 /dev/hdb2
You can monitor the sync process:
cat /proc/mdstat: md10 : active raid1 hdb1[2] hda1[0] 8789632 blocks [2/1] [U_] [>....................] recovery = 0.8% (77952/8789632) finish=5.5min speed=25984K/sec unused devices: <none>
24. System will be at normal state when mirror sync is finished
on 3-31-2008 6:30 AM Toby Bluhm spake the following:
Mail Administrator wrote:
Thnaks john,
u gave me a grt idea .. the second one seems quite interestin
but i do have to get additional HDD and mirror my existing server which has jus one disk
This was my procedure to mirror an existing single IDE disk RH4 system.
YMMV. No guarantees. Not tested on Centos5. May eat all your data and drink all your beer.
Make a total backup before doing anything.
IIRC the grub setup is what gave me the most problem.
Hopefully, someone will chime in to point out any flaws here.
Current System/OS on single 10GB IDE disk /dev/hda2 = swap @ 1GB /dev/hda1 = / @ 9GB Current system/OS is not in an LVM volume.
- Install a 2nd identical disk as hdb
- fdisk:
/dev/hdb1 = 9000M ; /dev/hdb2 = 1000M ( rest of disk ) part1 = type FD (raid) part2 = type FD (raid) 3. Create mirror device /dev/md10 for / with 2nd disk missing: mdadm --create --level=1 --force --raid-devices=1 /dev/md10 /dev/hdb1 4. mke2fs -j /dev/md10 5. Create mirror device /dev/md11 for swap with 2nd disk missing: mdadm --create --level=1 --force --raid-devices=1 /dev/md11 /dev/hdb2 6. mkswap /dev/md11
It may be safer to start step 7 from a rescue disk.
- mkdir /z
- mount /dev/md10 /z
- cd /
- dump -a0f - . | ( cd /z ; restore -xvf - )
- Update pertinent lines in
/z/etc/grub.conf: splashimage=(hd0,0)/boot/grub/splash.xpm.gz root (hd0,0) kernel /boot/vmlinuz-2.6.9-11.EL ro root=/dev/md10 rhgb
/z/etc/fstab: /dev/md10 / ext3 defaults 1 1 /dev/md11 swap swap defaults 0 0
- Shutdown
- swap hdb & hda around
- Boot RHEL4 linux rescue ; let system find/mount RHEL Installations
- fdisk hdb to be identical to hda
- chroot /mnt/sysimage
- grub-install /dev/hda
- grub-install /dev/hdb
- Setup grub:
grub root (hd0,0) setup (hd0) quit 20. Create new initrd(s) to include modules raid, scsi, lvm, etc needed at boot time: mkinitrd --with=raid0 --with=raid1 --with=raid5 --with=aic79xx /boot/initrd-2.6.9-22.EL.img.new mv /boot/initrd-2.6.9-22.EL.img /boot/initrd-2.6.9-22.EL.img.old cp /boot/initrd-2.6.9-22.EL.img.new /boot/initrd-2.6.9-22.EL.img 21. Reboot to normal startup on the new mirrored / & swap.
Step 21 needs to boot cleanly. Step 22 will remove your last chance to revert to the old setup by installing the original boot disk as hda. If something goes bad here, may need to restore from backup.
- Add in 2nd disk to md10 mirror set:
mdadm --grow /dev/md10 --raid-devices=2 mdadm --add /dev/md10 /dev/hdb1
- Add in 2nd disk to md11 mirror set:
mdadm --grow /dev/md11 --raid-devices=2 mdadm --add /dev/md11 /dev/hdb2
You can monitor the sync process:
cat /proc/mdstat: md10 : active raid1 hdb1[2] hda1[0] 8789632 blocks [2/1] [U_] [>....................] recovery = 0.8% (77952/8789632) finish=5.5min speed=25984K/sec unused devices: <none>
- System will be at normal state when mirror sync is finished
One thing to add. Don't put the second drive as a slave to the first. Most times when a PATA drive goes down it will lock the entire channel until a reboot. The whole point of having the mirrors is to keep running on a drive fail. It is better to have it on the secondary master as hdc. Of course this doesn't apply to SATA or SCSI or their variants