Hello everyone,
Although we use CentOS primarily on our servers, this query is actually more of a general networking question than something specific to CentOS.
In the next week or so, we shall be migrating our in-house servers to a data center. While we're doing that, we'd like to show a "Site down for maintenance" message while the servers that hosts our websites (we have around 15 sites hosted btw), are down.
So, how is this accomplished? While I can probably hack something on our name servers, I'm sure there are people on this list that have been doing this and could give some recommendations as to the best practices for this type of task.
Thanks in advance, Matt
Matt Arnilo S. Baluyos (Mailing Lists) wrote:
Hello everyone,
Although we use CentOS primarily on our servers, this query is actually more of a general networking question than something specific to CentOS.
In the next week or so, we shall be migrating our in-house servers to a data center. While we're doing that, we'd like to show a "Site down for maintenance" message while the servers that hosts our websites (we have around 15 sites hosted btw), are down.
So, how is this accomplished? While I can probably hack something on our name servers, I'm sure there are people on this list that have been doing this and could give some recommendations as to the best practices for this type of task.
Keep or setup a box inhouse to show the message, when the servers are online in the data center, switch ips for the names over and then change the setup on the box to either redirect or proxy the requests to the real servers to handle incoming http requests due to cached dns entries.
On Aug 23, 2007, at 10:30 PM, Feizhou wrote:
Keep or setup a box inhouse to show the message, when the servers are online in the data center, switch ips for the names over and then change the setup on the box to either redirect or proxy the requests to the real servers to handle incoming http requests due to cached dns entries.
Also, lower the cache time in your nameserver's zone files so that people will see the new IP addresses faster. 3600 seconds works pretty well, but I've used as little as 120 seconds for sites that are more popular.
--Chris
On 8/24/07, Chris Boyd cboyd@gizmopartners.com wrote:
On Aug 23, 2007, at 10:30 PM, Feizhou wrote:
Keep or setup a box inhouse to show the message, when the servers are online in the data center, switch ips for the names over and then change the setup on the box to either redirect or proxy the requests to the real servers to handle incoming http requests due to cached dns entries.
Also, lower the cache time in your nameserver's zone files so that people will see the new IP addresses faster. 3600 seconds works pretty well, but I've used as little as 120 seconds for sites that are more popular.
--Chris
Messing with DNS is really the wrong way to go on this. You'd be forcing all of the DNS servers involved to start messing with their caches, update more frequently, etc.., pushing the problem out onto "everyone else", and you have no control over any of it really. Cache time is only a suggestion, and not all DNS servers follow it.
The way to go is to assign that same IP address to another box during maintenance, and have that box show the page. Then you have full control over when the switch happens. The only potential issue there is ARP caching on your local network.
On Fri August 24 2007 15:12, Brian Mathis wrote:
On 8/24/07, Chris Boyd cboyd@gizmopartners.com wrote:
On Aug 23, 2007, at 10:30 PM, Feizhou wrote:
Keep or setup a box inhouse to show the message, when the servers are online in the data center, switch ips for the names over and then change the setup on the box to either redirect or proxy the requests to the real servers to handle incoming http requests due to cached dns entries.
Also, lower the cache time in your nameserver's zone files so that people will see the new IP addresses faster. 3600 seconds works pretty well, but I've used as little as 120 seconds for sites that are more popular.
--Chris
I would add that you change the TTL's about a day before the move or at a minimum the amount of time the TTL is set for. Then when you change DNS for the move this information will be updated quicker for the client and the correct record will get out sooner.
Here is another thing you might think about. If the sites content doesn't change often maybe you could leave the site up until the new hosting site is setup and then just change DNS to point to the new site. Make sure you change your DNS TTL's to a low number the day before. Then after the switch is made update DNS to the new IP Addresses and TTL. Then you just have to wait till the short TTL's have expired and then you could turn off the server on your site Since I don't know your setup I cannot tell you what would be best. Of all the choices this I find to be the best. No down time for the client.
Messing with DNS is really the wrong way to go on this. You'd be forcing all of the DNS servers involved to start messing with their caches, update more frequently, etc.., pushing the problem out onto "everyone else", and you have no control over any of it really. Cache time is only a suggestion, and not all DNS servers follow it.
DNS is the proper way to go with this. That is the job of DNS. DNS Cache is being updated all the time including your desktop. While TTL's of 120 are short it does nothing more then tell the Cache when to expire the record. This ensure that the most up-to-date record is in it's cache. You would be surprised to know that there are site with TTL's of 0. This just tells the cache to drop the record as soon as it gets it.
The way to go is to assign that same IP address to another box during maintenance, and have that box show the page. Then you have full control over when the switch happens. The only potential issue there is ARP caching on your local network.
Please explain how they will lose any control over when the switch happens? They are in control of their DNS. They make the changes. They are moving the boxes off site so they have to update DNS anyway.
Brian Mathis wrote:
Messing with DNS is really the wrong way to go on this. You'd be forcing all of the DNS servers involved to start messing with their caches, update more frequently, etc.., pushing the problem out onto "everyone else", and you have no control over any of it really. Cache time is only a suggestion, and not all DNS servers follow it.
The only moral of this story is that you can't control everything. That doesn't mean you shouldn't do what you can to speed the changeover.
Temporarily lowering the DNS cache time for a server during a time of change is well established practice. The only problem is that it'll increase the load on the primary name servers for that domain. That's the best argument for it being temporary.
The way to go is to assign that same IP address to another box during maintenance, and have that box show the page.
The original poster did not explicitly say so, but the impression I got is that this "data center" is off-site, and possibly managed by a third party. Letting multiple machines handle a single IP only works within a single physical site. When multiple sites are involved, the only way to move an IP is to change global routing rules, which is more fraught with problems than the DNS change-over, which you already don't like.
I guess theoretically you can have a single IP at multiple sites, with both routes being advertised as viable, but this will cause chaos as half the packets go one direction and half go the other. "Don't cross the streams" indeed.
Thanks for the interesting insights everyone. I'll definitely look at your suggestions.
And yes, the data center is off-site so that means the servers will be on a different network.
On 8/25/07, Warren Young warren@etr-usa.com wrote:
Brian Mathis wrote:
Messing with DNS is really the wrong way to go on this. You'd be forcing all of the DNS servers involved to start messing with their caches, update more frequently, etc.., pushing the problem out onto "everyone else", and you have no control over any of it really. Cache time is only a suggestion, and not all DNS servers follow it.
The only moral of this story is that you can't control everything. That doesn't mean you shouldn't do what you can to speed the changeover.
Temporarily lowering the DNS cache time for a server during a time of change is well established practice. The only problem is that it'll increase the load on the primary name servers for that domain. That's the best argument for it being temporary.
The way to go is to assign that same IP address to another box during maintenance, and have that box show the page.
The original poster did not explicitly say so, but the impression I got is that this "data center" is off-site, and possibly managed by a third party. Letting multiple machines handle a single IP only works within a single physical site. When multiple sites are involved, the only way to move an IP is to change global routing rules, which is more fraught with problems than the DNS change-over, which you already don't like.
I guess theoretically you can have a single IP at multiple sites, with both routes being advertised as viable, but this will cause chaos as half the packets go one direction and half go the other. "Don't cross the streams" indeed.
Matt Arnilo S. Baluyos (Mailing Lists) spake the following on 8/26/2007 11:57 PM:
Thanks for the interesting insights everyone. I'll definitely look at your suggestions.
And yes, the data center is off-site so that means the servers will be on a different network.
One last thought. Maybe the datacenter can provide a temporary banner page for the migration period.
On Fri, 24 Aug 2007, Matt Arnilo S. Baluyos (Mailing Lists) wrote:
Hello everyone,
Although we use CentOS primarily on our servers, this query is actually more of a general networking question than something specific to CentOS.
In the next week or so, we shall be migrating our in-house servers to a data center. While we're doing that, we'd like to show a "Site down for maintenance" message while the servers that hosts our websites (we have around 15 sites hosted btw), are down.
So, how is this accomplished? While I can probably hack something on our name servers, I'm sure there are people on this list that have been doing this and could give some recommendations as to the best practices for this type of task.
I would have DNS for all domains point to a web server that has the following php page: ========================================================================= <html> <head> <title>Maintenance</title> </head> <body bgcolor=white> <font size=5><center>Maintenance</center> <br> <center>The server that hosts <? $_SERVER['HTTP_HOST'] ?> is currently undergoing maintenance. <? $_SERVER['HTTP_HOST'] ?> will return to full service as soon as possible. </center> </body> </html> ========================================================================= I would also add to your httpd.conf file: ========================================================================= RewriteEngine on RewriteRule !^/index.php$ /index.php [NC,L] RewriteRule !^/index.php$ - [F] ========================================================================= This makes it so that anyone who connects to any URL on any of your websites will be told that the server they are connecting to is under maintenance.
When you have the new server up and running, change DNS. Alternately you could place this on a server in the new location, but change the routing/NATing to temporarily deliver the addresses to the server hosting this page. If you are using SSL certificates, you will need to have them as well and create different virtualhosts, although they can all have the same DocumentRoot and web page.
Hope this helps.
Barry
Depending on the traffic level and the amount of hardware, I would recommend against what you just said. Especially if your current environment is multiple servers that are load balanced. You don't want to have to replicate the environment just to have a construction page.
Instead of setting up Apache with PHP, just setup a really basic server with lighttpd and a single static page with really minimum graphics. It will serve pages and the one or two graphics a lot faster and a single server can usually handle the load.
-matt
On 8/24/07, Barry Brimer lists@brimer.org wrote:
On Fri, 24 Aug 2007, Matt Arnilo S. Baluyos (Mailing Lists) wrote:
Hello everyone,
Although we use CentOS primarily on our servers, this query is actually more of a general networking question than something specific to CentOS.
In the next week or so, we shall be migrating our in-house servers to a data center. While we're doing that, we'd like to show a "Site down for maintenance" message while the servers that hosts our websites (we have around 15 sites hosted btw), are down.
So, how is this accomplished? While I can probably hack something on our name servers, I'm sure there are people on this list that have been doing this and could give some recommendations as to the best practices for this type of task.
I would have DNS for all domains point to a web server that has the following php page: =========================================================================
<html> <head> <title>Maintenance</title> </head> <body bgcolor=white> <font size=5><center>Maintenance</center> <br> <center>The server that hosts <? $_SERVER['HTTP_HOST'] ?> is currently undergoing maintenance. <? $_SERVER['HTTP_HOST'] ?> will return to full service as soon as possible. </center> </body> </html> ========================================================================= I would also add to your httpd.conf file: ========================================================================= RewriteEngine on RewriteRule !^/index\.php$ /index.php [NC,L] RewriteRule !^/index\.php$ - [F] ========================================================================= This makes it so that anyone who connects to any URL on any of your websites will be told that the server they are connecting to is under maintenance.
When you have the new server up and running, change DNS. Alternately you could place this on a server in the new location, but change the routing/NATing to temporarily deliver the addresses to the server hosting this page. If you are using SSL certificates, you will need to have them as well and create different virtualhosts, although they can all have the same DocumentRoot and web page.
Hope this helps.
Barry _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Fri, 24 Aug 2007, Matt Shields wrote:
Depending on the traffic level and the amount of hardware, I would recommend against what you just said. Especially if your current environment is multiple servers that are load balanced. You don't want to have to replicate the environment just to have a construction page.
Instead of setting up Apache with PHP, just setup a really basic server with lighttpd and a single static page with really minimum graphics. It will serve pages and the one or two graphics a lot faster and a single server can usually handle the load.
-matt
On 8/24/07, Barry Brimer lists@brimer.org wrote:
On Fri, 24 Aug 2007, Matt Arnilo S. Baluyos (Mailing Lists) wrote:
Hello everyone,
Although we use CentOS primarily on our servers, this query is actually more of a general networking question than something specific to CentOS.
In the next week or so, we shall be migrating our in-house servers to a data center. While we're doing that, we'd like to show a "Site down for maintenance" message while the servers that hosts our websites (we have around 15 sites hosted btw), are down.
So, how is this accomplished? While I can probably hack something on our name servers, I'm sure there are people on this list that have been doing this and could give some recommendations as to the best practices for this type of task.
I would have DNS for all domains point to a web server that has the following php page: =========================================================================
<html> <head> <title>Maintenance</title> </head> <body bgcolor=white> <font size=5><center>Maintenance</center> <br> <center>The server that hosts <? $_SERVER['HTTP_HOST'] ?> is currently undergoing maintenance. <? $_SERVER['HTTP_HOST'] ?> will return to full service as soon as possible. </center> </body> </html> ========================================================================= I would also add to your httpd.conf file: ========================================================================= RewriteEngine on RewriteRule !^/index\.php$ /index.php [NC,L] RewriteRule !^/index\.php$ - [F] ========================================================================= This makes it so that anyone who connects to any URL on any of your websites will be told that the server they are connecting to is under maintenance.
When you have the new server up and running, change DNS. Alternately you could place this on a server in the new location, but change the routing/NATing to temporarily deliver the addresses to the server hosting this page. If you are using SSL certificates, you will need to have them as well and create different virtualhosts, although they can all have the same DocumentRoot and web page.
Hope this helps.
Barry
My page does not use any graphics. The reason I used PHP and not a static page was that I wanted the user to know that the site and url they had connected to was valid, and that they had not reached the page by mistake, or mis-typed the address. If you are that worried about loading a page faster, and you think lighttpd is the way to go, I am all for it, but I don't think it is necessary. For added performance, you could put the page on a ram disk, but I really think the return will be minimal.
Barry
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Matt Arnilo S. Baluyos (Mailing Lists) Sent: Thursday, August 23, 2007 11:15 PM To: CentOS Mailing List Subject: [CentOS] "Site down for maintenance" - How is this accomplished?
Hello everyone,
Although we use CentOS primarily on our servers, this query is actually more of a general networking question than something specific to CentOS.
In the next week or so, we shall be migrating our in-house servers to a data center. While we're doing that, we'd like to show a "Site down for maintenance" message while the servers that hosts our websites (we have around 15 sites hosted btw), are down.
So, how is this accomplished? While I can probably hack something on our name servers, I'm sure there are people on this list that have been doing this and could give some recommendations as to the best practices for this type of task.
Some Domain Registrars can also present that for you as part of the name registration. In which case, if the registrar's setup is good, they can present this to public traffic without you needing to setup a redirect on your own network.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.