{"componentChunkName":"component---src-templates-blog-js","path":"/ctf/aws-formation/tp3-highly-available-architecture","result":{"data":{"markdownRemark":{"html":"<h1>TP4-HA</h1>\n<h2>1. Load Balancers Theory</h2>\n<h3>Definition</h3>\n<p>A physiacl or a virtual device design to help to balance the load of net  accross different web servers</p>\n<h3>3 types</h3>\n<h4>Application Load Balancer</h4>\n<ul>\n<li>HTTP</li>\n<li>intellignet decsion</li>\n<li>advande request routing</li>\n<li>ex : change the langage</li>\n</ul>\n<h4>Network Load Balancers</h4>\n<ul>\n<li>TCP </li>\n<li>extremely performant</li>\n</ul>\n<h4>Classic Load Balancer</h4>\n<ul>\n<li>use Layer 7 specific feature</li>\n<li>a bit cheaper</li>\n</ul>\n<h3>error 504</h3>\n<ul>\n<li>the gateway has time out</li>\n<li>the application  not responding within the idle timeout period</li>\n<li>trouble shoot the application.</li>\n<li>Is it the Web Server or DataBase Server ?</li>\n</ul>\n<h3>Forwarded-For header</h3>\n<p>If you need the IPV4 address of your end user, look for the X-forwarded-For header\nFor example if you user connect fisrt to an ELB, your EC2 instance will by default know only your ELB IP ; if you use the X-Forwarded-For header, you will know the public IP address of your user</p>\n<p><img src=\"/assets/TP4-HA-XForwarded.png\" alt=\"xforwarde\" title=\"xforwarded\"></p>\n<h2>2. Load Balancers And Health Checks Lab</h2>\n<p><img src=\"/assets/TP4-HA-HealthCheck.png\" alt=\"healthcheck\" title=\"healthcheck\"></p>\n<h3> synthesis</h3>\n<ul>\n<li>Instances monitored by ELB are reported as InService, or OutofService</li>\n<li>Health Checks check the instance health by talking to it</li>\n<li>Load Balanced have their own DNS name. You are never given an IP address</li>\n<li><a href=\"https://aws.amazon.com/fr/elasticloadbalancing/faqs/\">The ELB FAQ</a></li>\n</ul>\n<h2>3. Advanced Load Balancer Theory</h2>\n<h3>sticky sessions</h3>\n<p>Sticky sessions enable your users to stick to the same EC2 instance\nIt can be usefull if you are storing information locally to that instance</p>\n<ul>\n<li>\n<p>in a classic load balancer</p>\n<ul>\n<li>with no sticky session : each request are routed to the EC2 instance with the smallest load, independtly</li>\n<li>with sticky session : the user's session is bound to a specific EC2 instances ; thus all request during a session are sent to the same instance</li>\n</ul>\n</li>\n<li>\n<p>in a Application Load Balancers</p>\n<ul>\n<li>with sticky session : the traffic will be sent at the target group level</li>\n</ul>\n</li>\n</ul>\n<h3>cross zone load balancing</h3>\n<p>Cross Zone Load Balancer enables you to load balance across multiple availability zones</p>\n<h4>with cross zone</h4>\n<p><img src=\"/assets/TP4-HA-CZ.png\" alt=\"highly-available\" title=\"hightly-available\"></p>\n<h4>without cross zone</h4>\n<p><img src=\"/assets/TP4-HA-NoCZ.png\" alt=\"nocz\" title=\"nocz\"></p>\n<h3>path patterns</h3>\n<p>Path patterns allow you to direct traffic to different EC2 instances based on the url contained in the request</p>\n<p>Eg : if you want to redirect user ta a specific EC2 instance if they want an image to the following url : url/image</p>\n<p><img src=\"/assets/TP4-HA-PathPatterns.png\" alt=\"pathpattern\" title=\"pathpattern\"></p>","frontmatter":{"date":"July 31, 2020","path":"ctf/aws-formation/tp3-highly-available-architecture","title":"TP4-HA","tags":["cloud","ec2","aws"],"categorie":"ctf","thumbnail":"/assets/alex-machado-80sv993luki-unsplash.jpg"},"fields":{"readingTime":{"text":"3 min read"}}},"file":{"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEBf/EABUBAQEAAAAAAAAAAAAAAAAAAAED/9oADAMBAAIQAxAAAAGFz11jKaIn/8QAGhAAAgMBAQAAAAAAAAAAAAAAAAECERMSMf/aAAgBAQABBQLm3gxwaJTxe1i8/8QAGBEAAgMAAAAAAAAAAAAAAAAAAAECElH/2gAIAQMBAT8BUdKn/8QAFhEBAQEAAAAAAAAAAAAAAAAAABEB/9oACAECAQE/Abqv/8QAGhAAAQUBAAAAAAAAAAAAAAAAAQACEBESIv/aAAgBAQAGPwJckOjObVBtR//EABwQAQACAgMBAAAAAAAAAAAAAAEAETFBIWFxkf/aAAgBAQABPyEVB9ih2jUSxfkFQDkWX4Ju5grU/9oADAMBAAIAAwAAABDjD//EABYRAQEBAAAAAAAAAAAAAAAAAAEAIf/aAAgBAwEBPxAA1M//xAAWEQEBAQAAAAAAAAAAAAAAAAABIRD/2gAIAQIBAT8QWYTP/8QAGhABAQEAAwEAAAAAAAAAAAAAAREAIUFxwf/aAAgBAQABPxAYkFlcFzRnCFCH3zCCggiKI5gk6hL1lpwEhs0zEABv/9k=","aspectRatio":1.4970059880239521,"src":"/static/11cdcb302d032fa2db3a46428a8f74c9/a7715/alex-machado-80sv993luki-unsplash.jpg","srcSet":"/static/11cdcb302d032fa2db3a46428a8f74c9/8f7df/alex-machado-80sv993luki-unsplash.jpg 250w,\n/static/11cdcb302d032fa2db3a46428a8f74c9/0f3a1/alex-machado-80sv993luki-unsplash.jpg 500w,\n/static/11cdcb302d032fa2db3a46428a8f74c9/a7715/alex-machado-80sv993luki-unsplash.jpg 1000w,\n/static/11cdcb302d032fa2db3a46428a8f74c9/37d86/alex-machado-80sv993luki-unsplash.jpg 1500w,\n/static/11cdcb302d032fa2db3a46428a8f74c9/a41d1/alex-machado-80sv993luki-unsplash.jpg 2000w,\n/static/11cdcb302d032fa2db3a46428a8f74c9/6a059/alex-machado-80sv993luki-unsplash.jpg 6000w","sizes":"(max-width: 1000px) 100vw, 1000px"}}}},"pageContext":{"slug":"ctf/aws-formation/tp3-highly-available-architecture","featuredImage":"alex-machado-80sv993luki-unsplash.jpg"}}}