jelastic traffic distribution for blue-green deployment and failover protection
TRANSCRIPT
Possible Solutions and Bottlenecks
Additional Software • Integration is complicated• Requires extra human resources• Valuable time spent for configuring tools
Multiple Environment Copies• Proper traffic distribution between the copies• Data synchronization
Traffic Routing Benefits
• Blue-green deployment or zero-downtime update by redirecting portion or all traffic to a new version of an application
• Ongoing A/B testing by routing part of the traffic to a newer application version to compare performance and UX rates
• Advanced failover protection and high availability through sharing the load between two fully functional application copies in different cloud regions
Step 1: NGINX Modules
NGINX should be compiled with the following modules:
• nginx_upstream_check_module - checks health of upstream servers
• nginx-sticky-module-ng - adds a sticky cookie to be always forwarded to the same upstream server
Step 2: NGINX Configuration
Access the server under your NGINX user:su nginx
Edit nginx.conf by adding the required strings due to the routing method (provided on the next slides)
Round Robin
http {upstream cluster {
server {host1} weight={host1_weight};server {host2} weight={host2_weight};check interval=30000 rise=2 fall=5 timeout=10000 default_down=false type=http;
}
server {listen 80;
location / {proxy_pass http://cluster;
}}
}
Placeholders
{host1} - the domain or IP address of the first endpoint
{host1_weight} - the weight of the first server, default: 1
{host2} - the domain or IP address of the second endpoint
{host2_weight} - the weight of the second server, default: 1
{cookie} - the name of the cookie used to track the persistent upstream server, default: route
Step 3: Reload
Reload the server to apply the changes:nginx -s reload
Reload the server each time you need to tune the settings within nginx.conf
Sticky Sessions
http {upstream cluster {
server {host1} weight={host1_weight};server {host2} weight={host2_weight};check interval=30000 rise=2 fall=5 timeout=10000 default_down=false type=http;sticky name={cookie} path=/;
}
server {listen 80;
location / {proxy_pass http://cluster;
}}
}
Failover Routing
http {upstream cluster {
server {host1};server {host2} backup;check interval=30000 rise=2 fall=5 timeout=10000 default_down=false type=http;
}
server {listen 80;
location / {proxy_pass http://cluster;
}}
}
During the load spikes, Jelastic allocates more resources for app and takes them back, when they are no longer needed
Automatic Vertical Scaling
Software Defined Storage
Integrated SDS technology for automatic failover solution on containers level
Containers’ data are being replicated across several Hardware Nodes.
If one Node goes down, its containers will be immediately restored on another.
Live Migration of Containers
Migrate containers with application from one physical server to the other with zero downtime
• Increases operational efficiency• Provides better load balancing and data center utilization• Scale within a server without downtime• Allows moving customers to more powerful nodes without service interruption