1

Suppose I have a website that is normally accessed at address www.mywebsite.com.

Now let's say the website is down completely (think server has melted). I want the users trying to reach www.mywebsite.com to end up on a maintenance URL on another server instead of having a 404.

Is this possible easily without having to route all the trafic through a dispatcher/load balancer?

I could imagine something like :

When the default server is UP traffic is like :

[USER]<---->[www.mywebsite.com]<---->[DISPATCHER]<---->[DEFAULT SERVER]

When the default server is DOWN traffic is like :

[USER]<---->[www.mywebsite.com]<---->[DISPATCHER]<---->[MAINTENANCE SERVER]

Where [DISPATCHER] figures out where to route the traffic. Problem is that in this scenario all the traffic goes through [DISPATCHER]. Can I make it so that the first connection goes through dispatcher, and then, if the default server is up, the traffic goes directly from the user to the default server? (with a check every 10 - 15 minutes for example)

[USER]<---->[www.mywebsite.com]<-------->[DEFAULT SERVER] after the first successful connection

Thanks in advance!

4

1 に答える 1

0

残念ながら、おそらく最も実用的な解決策はあきらめることです。ブラウザが最終的にSRVレコードのサポートを追加するまで...

ダイナミックDNSで目的を達成できます。「メンテナンスサーバー」に監視スクリプトを設定して、Webサイトがダウンしているかどうかを確認し、ダウンしている場合は、サイトのDNSを更新して、メンテナンスサーバーを指定します。このアプローチには独自の問題があります。最大の問題は、監視によって誤検知が発生する可能性があるため、サイトが実際に稼働しているときにユーザーにメンテナンスページが表示されることです。

別の可能なアプローチ(さらに悪いことに)-たとえば、www.example.comがディスパッチャーサーバーを指し、www2.example.comがメインサーバーを指すようにします。次に、ディスパッチャはすべての着信要求をwww2.example.comにHTTPリダイレクトします。

しかし、コーディネーターが溶けたらどうします?-ある障害点を処理しようとしているときに、別の障害点を追加しました。

たぶん、サーバーが最初に起動しているかどうかをチェックし、次にリンクをたどるJavaScriptですべてのページリンクを処理するのが実用的です。このアプローチにはスクリプトが必要ですが、少なくとも、ユーザーが既にサイトにアクセスしているときにサーバーがダウンしている場合に最良の結果が得られます。しかし、初めてサイトにアクセスしようとする人にとっては何の役にも立ちません。

ブラウザだけがSRVレコードをサポートするのであれば...

于 2012-07-10T14:09:19.143 に答える