Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For deployment across several hot instances that are behind a load balancer like <a href="http://wiki.nginx.org/LoadBalanceExample" rel="nofollow">nginx</a> I like to do rolling deployments with a tool like <a href="http://docs.fabfile.org/en/1.4.2/index.html" rel="nofollow">Fabric</a>.</p> <ol> <li>Fabric connects you to Server 1</li> <li>Shut down the web-server</li> <li>Deploy changes, either by using your VCS or transferring tarball with the new application</li> <li>Start up the web-server</li> <li>GOTO1 and connect to the next server.</li> </ol> <p>That way you're never offline, and it's seamless as nginx knows when a webserver is taken down when it tries to round-robin to it and will move onto the next one instead, and as soon as the node/instance is back up it will be back into production usage.</p> <p>EDIT:</p> <p>You can use the <a href="http://wiki.nginx.org/HttpUpstreamModule" rel="nofollow">ip_hash</a> module in nginx to ensure all requests from one IP Address goes to the same server for the length of the session</p> <blockquote> <p>This directive causes requests to be distributed between upstreams based on the IP-address of the client. The key for the hash is the class-C network address of the client. This method guarantees that the client request will always be transferred to the same server. But if this server is considered inoperative, then the request of this client will be transferred to another server. This gives a high probability clients will always connect to the same server. </p> </blockquote> <p>What this means to you, is that once your web-server is updated and a client has connected to the new instance, all connections for that session will continue to be forwarded to the same server.</p> <p>This does leave you in the situation of</p> <ol> <li>Client connects to site, gets served from Server 1</li> <li>Server 1 is updated before client finishes whatever they're doing</li> <li>Client potentially left in a state of limbo?</li> </ol> <p>This scenario begs the question, are you removing things from your API/Site which could potentially leave the client in a state of limbo ? If all you're doing is for example updating UI elements or adding pages etc but not changing any back-end APIs you should not have any problems. If you are removing API functions, you might end up with issues.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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