Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This idea uses the ELB's capability to detect an unhealthy node and remove it from the pool BUT it relies upon the ELB behaving as expected in the assumptions below. This is something I've been meaning to test for myself but haven't had the time yet. I'll update the answer when I do.</p> <p><strong>Process Overview</strong></p> <p>The following logic could be wrapped and run at the time the node needs to be shut down.</p> <ol> <li>Block new HTTP connections to nodeX but continue to allow existing connections</li> <li>Wait for existing connections to drain, either by monitoring existing connections to your application or by allowing a "safe" amount of time.</li> <li>Initiate a shutdown on the nodeX EC2 instance using the EC2 API directly or Abstracted scripts.</li> </ol> <p>"safe" according to your application, which may not be possible to determine for some applications.</p> <p><strong>Assumptions that need to be tested</strong></p> <p>We know that ELB <a href="http://aws.amazon.com/elasticloadbalancing/" rel="noreferrer">removes unhealthy instances from it's pool</a> I would expect this to be graceful, so that:</p> <ol> <li>A new connection to a recently closed port will be gracefully redirected to the next node in the pool</li> <li>When a node is marked Bad, the already established connections to that node are unaffected.</li> </ol> <p><strong>possible test cases:</strong> </p> <ul> <li>Fire HTTP connections at ELB (E.g. from a curl script) logging the results during scripted opening an closing of one of the nodes HTTP ports. You would need to experiment to find an acceptable amount of time that allows ELB to always determine a state change.</li> <li>Maintain a long HTTP session, (E.g. file download) while blocking new HTTP connections, the long session should hopefully continue.</li> </ul> <p><strong>1. How to block HTTP Connections</strong></p> <p>Use a local firewall on nodeX to block new sessions but continue to allow established sessions.</p> <p>For example IP tables:</p> <pre><code>iptables -A INPUT -j DROP -p tcp --syn --destination-port &lt;web service port&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload