0

I have a java server that serve many clients using Sockets In case of a failure of the main server I wanted a back server to take over automaticaly. What I did is, I put the ip address and the port of the back up server in the client side and when a timeout occure I just connect to the back up server. Is it the right decision or I should put the backup server coordinates on the server side and transfer it to the client when it connect ?

Thanks

4

2 に答える 2

1

I suppose it would be more robust to store the backup server info on the server -- that way it could be much more easily changed. And if the client switched to the backup, the backup could announce where it's backup was.

It is possible to handle this with a hardware load-balancer, as well, although this works much more easily with connectionless protocols. It is certainly simpler, though, just to use hardware that lets the backup machine step in automatically when the main server goes down.

于 2011-05-14T20:02:07.323 に答える
1

サーバーがバックアップ アドレスをクライアントに送信するのは良い考えです。このデータを一元的に管理する方が簡単です。

ただし、バックアップ サーバーのアドレスは、クライアントのプロパティ ファイル (またはクライアントとサーバーによって読み取られる中央構成データベース) にある必要があります。そうしないと、プライマリがダウンしているときに起動したときにバックアップを見つけることができません。

于 2011-05-14T20:10:04.613 に答える