[BlueOnyx:01456] Re: Planned in Datacenter move

Ken Marcus - Precision Web Hosting, Inc. kenmarcus at precisionweb.net
Sat Jun 20 13:58:16 -05 2009


----- Original Message ----- 
From: "Charles Bowman" <charlesbowman at wknet.co.uk>
To: <blueonyx at blueonyx.it>
Sent: Saturday, June 20, 2009 10:11 AM
Subject: [BlueOnyx:01454] Planned in Datacenter move


> Hi,
> I have 2 beautiful BO servers, happily running in production for the last
> few months.
>
> But...we plan on moving datacenters and I have the following simple, yet
> time-consuming plan:
> 1. Reduce the DNS TTL for all the Nameservers to 60 mins, 2 weeks before
> move.
> 2. On Server A & B, change *all* DNS records via GUI to point at the 
> planned
> new IP address - DO NOT UPDATE/Save yet = 2-8 hours.
> 3. On Server A & B, as root edit /etc/sysconfig/network, then update/save
> DNS change via web GUI, restart machine = 1 hour.
> 4. Move machines to new datacenter - 7 hours.
> 5. Power the puppies up - 1 hour.
>
> I have two questions:
> 1. What am I missing?
> 2. Is there an easy way to edit all the DNS, primary and secondary, as 
> each
> box only has 1 IP address?
>
> Thanks,
> Charles
>


Charles

I think if you modify the site IP via the command line, then it will update 
the dns also.

For customers that do their own dns, I have used is the script below.

#!/usr/bin/perl
##################################################################
#changes the IP addresese of the site


print "What IP address do you want to change all the sites to? ";

$theipaddress = <STDIN>;
$theipaddress  =~ s/ //g;
chomp ($theipaddress);

@locatearray=`ls -1 /home/sites`;


 foreach $sitename (@locatearray) {
     $aliases = "";
     chomp ($sitename);
     if ( ($sitename eq "index.html" ) or ($sitename eq "home" )  ) { } else
         {
          ######### #get the site number
          $ls=`ls -la /home/sites/ | grep $sitename`;
          ($prev0, $prev1, $prev2, $prev3, $prev4, $prev5) = 
split(/\//,$ls);
          chomp ($prev3);
          $sitenumber = $prev3;
          $conffile = "/etc/httpd/conf/vhosts/"."$sitenumber";
          ######### cat that file and get the aliases then change ip and set 
aliases
          @cat=`cat $conffile`;
          print "The conf file for $sitename  is $conffile\n";
          foreach $line (@cat) {
              chomp ($line);
              if ($line =~ /ServerAlias/ ) {
                 $line =~ s/ServerAlias//;
                 @aliases = split(/ /,$line);
                 $aliases = "@aliases";
                 $aliases =~ s/^ //;
                 $aliases =~ s/ /,/g;
                 $justthedomain = $sitename;
                 $justthedomain =~ s/www\.//;
                 print "It shows the aliases as $aliases\n";
              }
          }
          if ($theipaddress =~ /\d/) {
                    system 
"/usr/sbin/cmodvsite --fqdn=$sitename  --webAliases=$aliases  --ipaddr=$theipaddress");
          } else {
                    print "The IP address had no digits. It was [ 
$theipaddress ]\n\n";
                    exit;
          }

     }
  }


exit;



For secondary dns, I have the secondary server read a text file from the 
primary and automatically update from that. So, I would not know how to do 
secondary records easily  in your case.



----
Ken Marcus
Ecommerce Web Hosting by
Precision Web Hosting, Inc.
http://www.precisionweb.net






More information about the Blueonyx mailing list