Web Hosting Talk







View Full Version : Back Up with "Round Robin" method


web123
11-07-2002, 04:36 AM
I am running Linux 7.2 with plesk 5. I am having problem right now that my server is down and I cant do anything. How to implement a backup so that if my one mechine is down the other will work inplace of the first one. Some one suggested me that you upgrade to plesk 5 and can implement "Round Robin method". Through this way I will have 4 name servers ns1 2 3 4. If the request goes to ns1&2.mydomain.com and it is not available it will go to ns3&4.mydomain1.com. How can I implement this method cauz I need to do it urgently. Moreover if one of my clients update his site how it will be updated to 2nd mechine. Anyone plz help me.

clockwork
11-07-2002, 06:10 AM
google.com

web123
11-07-2002, 07:31 AM
I think I havent ask about the google.com I have asked about the round robin method. Plz any technical person help me.

Aussie Bob
11-07-2002, 07:38 AM
I think clockwork is suggesting you start searching for solutions at Google.com. :)

dynamicnet
11-07-2002, 10:19 AM
Greetings:

http://www.viaverio.com/support/virtual/admin/multi_home/index.cfm talks about DNS round robin.

If you search google.com or use other reputable engines, you may also find other articles.

Please note DNS robin robin DOES NOT have any methodology for the following:

1. Keeping ecommerce customers on the same server where they started an ecommerce transaction.

2. Does nothing in and of itself to handle mail services where you are relying on one of the servers to provide mail, and that particular server is down.

3. Provides no preference or ability to determine which servers are utilized in what way.

4. Provides no inherit means of data replication.

The list goes on.

Thank you.

protecweb
11-07-2002, 11:14 AM
Round Robin will simply split your traffic between 2 IPs. Therefore half of your traffic will still hit the downed server.
In order to accomplish what you want you should look into Zone Edits failover service. This will continualy monitor a server and if it goes down redirect traffic to a different IP.

It is possible that there are software solutions for this already available, you could check tucows or cnet.

Hope that helps.

RackMy.com
11-07-2002, 11:30 AM
Keeping ecommerce customers on the same server where they started an ecommerce transaction. I think, by nature of how DNS works, it will. If I make a request for a site that is using RRDNS and I get the IP to server1, my computer will use server1 the entire duration of my visit (and longer depending on the TTL of the domain).

Is my thinking correct?

protecweb
11-07-2002, 11:52 AM
Yes that should be true of http1.1 as it keeps a persistent connection.

zerphyte
11-07-2002, 11:58 AM
If you have a plesk box mirrored to another one you must have two plesk licenses. Or you need to block all of plesks ip blocks so that it can't communicate with their licensing server as it is a bit up surd to pay another $800 for a unlimited license if your just mirroring your server.

dynamicnet
11-07-2002, 12:06 PM
Greetings:

"I think, by nature of how DNS works, it will. If I make a request for a site that is using RRDNS and I get the IP to server1, my computer will use server1 the entire duration of my visit (and longer depending on the TTL of the domain).

Is my thinking correct?"

I believe that question can be answered when you think about the following:

==> Are all transactions via TCP/IP and UDP stateless?

==> When you have an established conneciton, what ways can the connection be disconnected?

==> When you shift protocols (http to https to http), what happens to state?

==> If you using http or https, and your application communications with a 3rd party gateway, what happens when they try to communicate back in terms of state and persistance?

Thank you.

RackMy.com
11-07-2002, 12:16 PM
I visit site domain.com and it has an IP address of 1.2.3.4, the DNS server that I use will keep that IP in it's cache for as long as the TTL states.

If you go in and change the IP to 1.2.3.5, for the length of time set in the TTL I will still visit 1.2.3.4.

Also, I think W2K keeps it's own cache for a specified length of time.

So I would say that I would stay on the same server for the duration of the transaction.

ServerCorps
11-07-2002, 12:50 PM
Round Robin DNS is primarily used to evenly distribute requests across mirrored servers, and as such works as a crude load balancer. I say crude because DNS has no clue how busy the server is before handing back an IP address to the requestor. A load balancing proxy is what you really need, but can get quite expensive in hardware costs, as you are using open source everything else.

A hot standby server would do well in this situation. It sits there as an exact duplicate of your main server. If the main server fails you just change the ip address (or modify the vlan in some provider's case) of the server the server would immediately start serving content. The challenge there is to keep the boxen mirrorred at short intervals.

web123
11-07-2002, 01:03 PM
"A hot standby server would do well in this situation. It sits there as an exact duplicate of your main server. If the main server fails you just change the ip address (or modify the vlan in some provider's case) of the server the server would immediately start serving content. The challenge there is to keep the boxen mirrorred at short intervals."

But the question remains there. If my client updates the site in server1 how it will update in server2. What method should I use.

web123
11-07-2002, 01:15 PM
dynamicnet says :

"If I make a request for a site that is using RRDNS and I get the IP to server1, my computer will use server1 the entire duration of my visit (and longer depending on the TTL of the domain)."

RackMy.com says:

"I visit site domain.com and it has an IP address of 1.2.3.4, the DNS server that I use will keep that IP in it's cache for as long as the TTL states.

If you go in and change the IP to 1.2.3.5, for the length of time set in the TTL I will still visit 1.2.3.4.

Also, I think W2K keeps it's own cache for a specified length of time.

So I would say that I would stay on the same server for the duration of the transaction."


I think thats going to create problems for me. If I am running RRDNS. Suppose a visitor connected to a site on my server1 whose IP is 1.2.3.4 and it gets down how it will acutmatically recognize the server2 whose IP is 5.6.7.8?
:o

RackMy.com
11-07-2002, 01:16 PM
Can you use rsync?

Quadgie
11-07-2002, 01:20 PM
Originally posted by RackMy.com
I visit site domain.com and it has an IP address of 1.2.3.4, the DNS server that I use will keep that IP in it's cache for as long as the TTL states.

If you go in and change the IP to 1.2.3.5, for the length of time set in the TTL I will still visit 1.2.3.4.

Also, I think W2K keeps it's own cache for a specified length of time.

So I would say that I would stay on the same server for the duration of the transaction.

Yes, it may cache the IP... but it will also cache a list of IPs, as is often used for round-robin DNS setups. In this case, it'll randomly grab one of those several IPs, so it's not guaranteed to be the same. That's why most big sites have redirects that take you from a 'www.blah.com' style name to the specific server, like 'www39.blah.com', etc.

ServerCorps
11-07-2002, 01:20 PM
Originally posted by web123
But the question remains there. If my client updates the site in server1 how it will update in server2. What method should I use.

Sorry, I'm not a *nix guy. W2k has a method of configuring file system replication that will keep two directory trees in sync. A crude way would to do a copy of newer and updated file on a schedule (I think you *nix guys call it a chron job) and schedulr it a 5 minute intervals. That plan probably has many holes in it, such as if the job takes longer than the interval, etc. I'm sure your OS supports some type of file system replication; maybe some of the *nix admins can suggest a way.

RackMy.com
11-07-2002, 01:40 PM
Yes, it may cache the IP... but it will also cache a list of IPs, as is often used for round-robin DNS setups. In this case, it'll randomly grab one of those several IPs, so it's not guaranteed to be the same. Really, it just does not grab one?

Goni
11-07-2002, 03:15 PM
You guys forgot about a very important thing and that is TTL. Plesk 5.x (I've heard) gives you the facility to change the default TTL which is 86400 Secs. Infact using RRDNS, you are just sharing the load from 1 server to 2 servers. When the clients tries to get the IP of a domain, the DNS server gives the client the A record of the domain. Now, RRDNS is nothing but just more than 1 A records in the zone file. Client gets both of the IPs and randomly uses 1 IP to connect.

Question: How the client will come to know which server to connect or which server is the primary server?

Ok, this RRDNS works perfect if you are using a Cluster server within the same network. 1 server will act as a primary node and the other will act as a secondary node. Now I don't need to explain thing here in detail. 1 node goes down, the other takes over. Its also called fail over service.

web123 If you talk about ns1.yourdomain.com with a different IP other than ns2.youdomain.com You are partially correct as far as you are able to control the default TTL of the zones. You have to set it very low but it will be an extra load on the DNS server.

Now comes the data replication issue. How you gona handle that? You mentioned you are using plesk 5.x. You knew that plesk updates many files when something change is done with the control panel. If you somehow get control on that, and successfully transfer all the server config files to the other backup server. What about the user's data? Would you keep all of your servers busy in just moving data here and there ? :eek:

The best solution is to get a reputable service from a reputable company. Rackspace claims to give you 100% uptime. But more money and less bandwidth is involved. I am not discouraging you but the solution you are tying to have is not an easy one and won't be easy to implement :)

Good Luck !

dynamicnet
11-07-2002, 04:08 PM
Greetings Mike:

Thank you for educating me <smile>. You corrected me on several issues; thank you.

I found http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/31/pid/333/fid/1754 to be of interest specifically at the "Round-robin DNS" section.

It did point out the following:

=== START CLIP ===

"First, load balancing is only performed once for each client at the beginning of a session.

Second, it's possible for the load balancing scheme to get a little skewed.

For instance, all the users that have been sent to MyServer1 may go to lunch while all the users who have been sent to MyServer2 continue to send requests. In this case, one server could become overloaded while another server is sitting by idly.

Third, A more significant problem with session-based load balancing is that it exposes the IP addresses of the servers in the farm to the client-side browser.

What happens when a server crashes or is taken offline? Your balancing algorithm needs to account for this as soon as possible, but doing so can be problematic. If you're passing out bad IP addresses, your users will start to receive "server not available" errors.

In a round-robin DNS system, it still can take as long as 48 hours to fix the problem once you've discovered that one of your servers has crashed.

This is due to the fact that the changes to your IP address mappings need to be propagated to DNS servers throughout the Internet."

=== END CLIP ===

http://www.vergenet.net/linux/has/html/node10.html also does a good job at reporting the problems of DNS-based methods of load balancing:

=== START CLIP ===

1. The time to live (TTL) on the zone files needs to be turned down severely to to reduce the time for which results are cached.

The longer the TTL, the less control there is over which IP addresses that end-users are accessing. The shorter that TTL, the greater the potential for congestion on the DNS server.

2. Users may access servers using an IP address rather than a host name.

3. Users may use non-DNS methods such as an /etc/hosts file to map server host names to IP addresses.

4. An additional problem with round-robin DNS is that the DNS daemon cannot differentiate between a request for a one-off hit, and a request that will result in many hits. That is, it is hard to control the granularity of scheduling.

5. When using round-robin DNS there is no way to assign weights to servers, all servers will theoretically receive the same number of requests, regardless of their resources and current load.

=== END CLIP ===

BTW, http://www.mydomain.com/help/mydomainplus/tut-robin is an ok article on this subject.

Thank you.

Goni
11-07-2002, 04:19 PM
Round Robin can be usefull for servers on the same network or the server with STATIC contents. Dynamic content server, like in this situation can't be handled with RRDNS.

RackMy.com
11-07-2002, 04:32 PM
dynamicnet, Thanks for the awesome info!!!

Goni, you can use RRDNS for dynamic content. I still think you will stay on one server once you have made the inital contact (depending on the TTL).

Also, even if you set the TTL down really low some ISP will change them to 15 mins if they are set to below that to help cut down on traffic.

Goni
11-07-2002, 04:39 PM
Originally posted by RackMy.com
dynamicnet, Thanks for the awesome info!!!

Goni, you can use RRDNS for dynamic content. I still think you will stay on one server once you have made the inital contact (depending on the TTL).

Also, even if you set the TTL down really low some ISP will change them to 15 mins if they are set to below that to help cut down on traffic.

Fine, I know I can do RRDNS with dynamic content sites. But it won't be easy to manage. What when your server1 goes down, you are shifted to server2 .. You update your stuff at server 2 .. then after some time, you server1 come online back again .. two things here:

1: How your clients come to know your server1 is back online.
2: How you gona manage your updated stuff at server2 back to server1?

RackMy.com
11-07-2002, 04:44 PM
Depends on what you mean by dynamic content. If server1 and server2 create dynamic pages from and SQL database, it does not matter which server you go to it will have the same content.

I think you may mean sites that require session.

Goni
11-07-2002, 04:47 PM
Originally posted by RackMy.com
Depends on what you mean by dynamic content. If server1 and server2 create dynamic pages from and SQL database, it does not matter which server you go to it will have the same content.

I think you may mean sites that require session.

Dynamic contents like extensive updates. Like shopping carts. Web Hosting Company server. It is in collective a dynamic content server. You have say 300+ account on the server and after every short interval of time a user FTPs in and the data.

RackMy.com
11-07-2002, 04:49 PM
Dynamic contents like extensive updates. Like shopping carts. Web Hosting Company server. It is in collective a dynamic content server. You have say 300+ account on the server and after every short interval of time a user FTPs in and the data.So you are talking about sessions? Replication of FTPed files is easy.

Goni
11-07-2002, 04:55 PM
Originally posted by RackMy.com
So you are talking about sessions? Replication of FTPed files is easy.

Yes sessions are also involved. But won't it be waste of BW for just moving data from one network to the other? I know it can be done with rsync or any tool which may update only changed files. Like done with tar -u .. It updates the archeive.

There I think could be another solution for this and that would be the use of NFS. The primary server will use NFS running on the secondary server. If the Primary goes down, the secondary takes over and the data is already updated. But switching from secondary to primary would be done manually. In case of plesk, mounting /usr/local/psa to remote:/mount_point might work.

RackMy.com
11-07-2002, 05:25 PM
But won't it be waste of BW for just moving data from one network to the other? Not if they are local machines, you can just use a crossover cable on a spare NIC.

rusko
11-07-2002, 05:39 PM
wouldnt it be cheaper/easier to just hire someone to sit at the box and replug a couple wires when feces hit the fan? =]

web123
11-07-2002, 09:06 PM
I agree with goni for two of his valid points.

1- What when your server1 goes down, you are shifted to server2 .. You update your stuff at server 2 .. then after some time, you server1 come online back again .. two things here:

1: How your clients come to know your server1 is back online.
2: How you gona manage your updated stuff at server2 back to server1?

2-waste of BW for just moving data from one network to the other?

Obviously I dont want the servers to busy in just replication of data from one server to another. But name the company that provides 100% uptime. The machine goes down 7 times in a month. No matter for how much time but many clients are fedup. There should be a way out. Somebody mentioned reckspace. Isnt it better to get one machine expensive to get two. How much they cost for sever like 1.2 Ghz, 512 RAM, 60 or 40 GB Hard, atleast 200 GB single homed data transfer. Are they having good enough repute that a person like me with problems go to them and get a satisfaction?

papepo55
11-08-2002, 12:25 AM
I make use of Round Robin DNS on my web.

In my experience,
When my server1 was down and I tried to see my web.
After 45 seconds I could see my server2 page (no error page).
Unless I use the RRDNS, I could see an error page after 45 seconds.

Goni
11-08-2002, 05:43 AM
Originally posted by RackMy.com
Not if they are local machines, you can just use a crossover cable on a spare NIC.

I assume we are talking about two different networks which are also seperated geographically. Systems on the local network is not a big deal.