Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two servers which are load balanced. When I do the deployment I want to make sure the production users are not affected. Here is what I'm planning:

  1. Remove the webservers 2 (www2) from the load balancer.
  2. Deploy to the www2.
  3. do some quick testing (just over 100 mini sites all under one domain)
  4. Bring www2 back in to the load balancer
  5. then repeat for www1

Is there any way I can avoid manually adding the DNS entries for all my sub domains? Or, does anyone have a better idea of approaching this problem?

share|improve this question
    
Why do these nodes have different hostnames when you say they are behind a load-balancer ? The whole point of using a loadbalancer is to be able to use the same hostname - and, indeed, the same IP - to connect to multiple nodes. What exactly are you using to provide this functionality ? –  adaptr Oct 1 '12 at 11:09
    
Hey Thanks for the response. I want to use second webserver (www2) as also a QAT box (QA + UAT) to check my bulk deployment has worked and then bring the second box back to the load balancer to receive normal traffic. One option I have thought about is editing my PC's hosts file to say www2.subdomain.sitename.com to point this to this second server. So whenever I do a deployment I can just test that that way. It isn't neat but that does solve the problem. –  johnster Oct 1 '12 at 15:44
add comment

migrated from stackoverflow.com Oct 1 '12 at 10:55

This question came from our site for professional and enthusiast programmers.

1 Answer

I'm not sure that from your problem statement I understand all of your constraints, so I'm not sure I can suggest a general answer to your question, but I wish to point out that changing any externally-facing DNS for your test is probably a bad idea -- remember that even after you change it back any other entity on the network that did a query on that DNS record when you had it temporarily redirected is allowed (encouraged, actually) by the DNS protocol to cache the temporary answer for a period of time up to the number of seconds specified in the resource record's TTL (time to live) value.

As you suggest, making changes to the hosts file on your own machine is a minimally-intrusive way to allow your resolver to get the temporary answer you want, while not causing unintended side-effects for other users who are not part of your testing.

If you require something more than you can accomplish by editing the hosts file, you can set up (and direct your resolver to use) a local DNS server with its own custom authoritative copy of the zone -- or set up a special view with a different copy of the zone for testing purposes if your DNS server supports views. By adding your client machine to the address match list for the view you can get one set of answers for your testing while continuing to provide the canonical answers to everyone else.

If you go about it right you can set the view up once and leave it set up for repeated use (avoiding repeated editing), simply adding or removing your test machine from the address match list for the view (or changing the IP of your test machine to match/not match) to change what answers you get..

However, I have the feeling there may be other "gotchas" that aren't evident from your problem statement..

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.