The Little Guy Posted September 14, 2007 Share Posted September 14, 2007 If I want to run a website from more than one server, so if I have one web host, and someone else has another host, can I add that to the name servers? Say his are: ns57.1and1.com ns58.1and1.com and mine are: NS1.DREAMHOST.COM NS2.DREAMHOST.COM NS3.DREAMHOST.COM Will that work, so we can split the traffic? Or, how can we spit traffic what will be the best way to do that? Quote Link to comment Share on other sites More sharing options...
steelmanronald06 Posted September 14, 2007 Share Posted September 14, 2007 you mean have one site spaced across more than one server? Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 14, 2007 Share Posted September 14, 2007 I think he's trying to make some sort of load balancing? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted September 14, 2007 Author Share Posted September 14, 2007 I think he's trying to make some sort of load balancing? Correct. I would like the user to be directed to one of two servers, randomly, and if one of the servers is down, then have them all go to the other server. The user shouldn't know this is happening. Quote Link to comment Share on other sites More sharing options...
tomfmason Posted September 14, 2007 Share Posted September 14, 2007 To be honest I don't think you are going to be able to do that with a shared hosting account. This can be done via apache but not dns. About the only thing you can do with dns is have a nameserver located in a different location but it wouldn't split traffic as the master would only update the slave with the A records and cnames. You may want to look into mod_proxy and mod_proxy_balancer for load balancing. Here is a simple example. vhost <VirtualHost *:80> ServerAdmin you@yourdomain.com ServerName www.domain.com ServerAlias domain.com ProxyPass / balancer://domaincluster/ ProxyPassReverse / balancer://domaincluster/ ErrorLog /path/to/apache_error_log CustomLog /path/to/apache_access_log combined <Location /balancer-manager> SetHandler balancer-manager #make sure to protect this </Location> </VirtualHost> simple cluster <Proxy balancer://domaincluster> BalancerMember http://member1.domain.com BalancerMember http://member2.domain.com BalancerMember http://member3.domain.com </Proxy> Now in your zone file you would want A records for memeber1,2 and 3 with them pointing to different machines. Also you could tell the load balancer to double the load on one or more by adding loadfactor=2 after the BalancerMemeber domain. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted September 14, 2007 Share Posted September 14, 2007 The Proxy balancer which tom suggested is the easiest way - however the proxy will have to handle ALL the traffic. Little Guy: As you initially suggested, you can use nameservers to give you a "round robin" effect when serving a website. Typically you will see: www.website.com can have 2 A addresses. I.e.: www.website.com A ip.address.of.server1 www.website.com A ip.address.of.server2 This record will have to be added to all of the nameservers where www.website.com is currently held. -steve Quote Link to comment Share on other sites More sharing options...
tomfmason Posted September 14, 2007 Share Posted September 14, 2007 Sorry, I was wrong. It can be done via dns and may be a better solution then what I posted. I use the example that I posted for mongrel clusters and honestly have not had the need to explore round robin. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.