Memcached is not working with AWS Classic Load Balancer - amazon-ec2

My application is running on two EC2 instances and I installed memcached on both the server. When i have checked with IP, memcached is working fine as per the requirement. But when I attached classic load balancer and attached 2 instance in that load balancer, the Memcached related functionality stop working.
But If I attached single server in load balancer then Its works fine.
The problem comes only when I attached 2 EC2 instances in Load balancer.

Make sure your memcached memory is shared between both EC2 instances. If you don't want to share memory then make sure that Stickiness is enabled in the load balancer. refer below image.

Related

Load balancer not working with http2 - AWS

I have a network load balancer setup on EC2 and everything works fine, though I'd like to enable http2 to get better performance and scores from auditing tools (eg. lighthouse).
My setup is Nginx on Ubuntu, the load balancer only has 2 instances to point to.
When I setup the listener to use http2, it doesn't work even though nginx and everything on the instances is setup properly. Is it because I'm using certificate manager and that there's no way for the balancer to use the certificate if it's installed through there?
Thanks a lot!
If someone comes across this, I ended up being able to solve the issue recently.
My problem was that I needed to install a self-issued certificate on both of my EC2 instances. That enables the back-and-forth between the load balancer to be secured and, in turn, it allows the load balancer to reply with the http2 headers signaling that it's available. For some reason, I thought that this was already configured, but it wasn't.
Now everything works fine!

EC2 Load Balancer - Security Access

On a AWS EC2 ELB security profile - i need a couple of IP Address to be able to access only certain pages of my website. Is it possible? The other IP Address will have access to the full website. Is this achievable
This is not possible as a configuration in the Load Balancer because the Load Balancer simply distributes requests to your application servers.
Your application will need to enforce such functionality.

Do I need to have HAProxy TCP/HTTP Load Balancer when I already have AWS ELB?

Let's say I have 20 servers at Amazon AWS and I also have AWS ELB setup for these servers. I heard that HAProxy is reliable and fast TCP/HTTP Load Balancer, so question is:
do I need to have HAProxy installed in each EC2 instances while I have AWS ELB?
What is the benefit of having both ELB and Haproxy at the same time?
Thanks
There are a few scenarios where people chose their own load balancing solution like HAProxy than ELB:
Financial transactions: ELB is an opaque service. Logs are not provided. So if you are missing transactions, you won't know if ELB dropped them or not.
Doesn't work well with traffic spikes: ELBs scaling takes at least 5 minutes. If your application traffic is doubling every 5-10 minutes, it will do well. But if it is at a constant rate and you will get a spike all of a sudden, then you will have problems with ELB.
ELBs can be slower than running your own Loadbalancing: In my environment, I got 15% performance boost by using HAProxy/Nginx (for SSL termination) instead. It was roughly 30ms per call, but keep in mind I was using SSL so I use CPU power.
ELBs only do round-robin load balancing and HAProxy has a lot more.
HAProxy also has ton more configurations that ELB does not support. It depends if one needs them for their application.
In one suite of applications, I have both running. ELB->haproxy->A suite of apps. In my case the following occurs:
ELB translates HTTPS to http
HAproxy targets to the app servers based on path
The app servers run in plain old http
The upside to this is that I can move around the apps without changing their URLs
The downside is that ELB isn't a fixed IP address so if you need to point to it from an IP adress instead of a cname you can't do it.
Short answer: No you don't need HAProxy. Go with an ELB.
tldr;
Yes HAProxy is powerful and tested.
First of all, you would need to have a separate EC2 HAProxy instance (as opposed to having HAProxy installed on every EC2 instance you need to balance). In essence an ELB is equivalent to an EC2 instance loaded with some kind of load balancing software.
Second, having both ELBs and HAProxy balancing instances in your environment is a rare use case. You might come to a point that you need more fine grained access and the ability to configure more on your load balancers. It purely depends on what you're doing and what problems an ELB might be giving you. Google to read through possible use cases.
I'm using an ELB and Haproxy behind.
When a customer uses my webservices from a unique IP, ELB redirects all his requests to the same hosts. It doesn't scale. (I supposed it's a hash from the src ip or something like that).
The haproxy has another balancer algorithm.
I keep the ELB for HA (1 haproxy / availability zone). And each haproxy instance redispatchs to region zone backend servers

Amazon Load balancer not working?

I have an aws Elastic Load Balancer. Sometimes Elastic Load Balancer works sometimse not. Soemetimes I am able to hit the app sometimes it gives me the blank page .
Why its happening so
You should check ping path and ping port on ELB, whether you get response. It seems that ELB brings the instances down as failed healthcheck.
AWS Application Load Balancers are notoriously susceptible to DDoS attacks, a simple SYN flood will bring down a load balancer, and what's worse is that you won't know that it's down, because the AWS Dashboard doesn't expose anything about the load balancer other than some basic HTTP level metrics.

503 error in tomcat deployed in ec2

I have deployed tomcat 6.0.28 on two amazon ec2 instances and they share a common mysql 5.5 database. I have also made use of the elastic load balancer. When I run the program using the tomcat in my local machine, everything is fine.
But when i use the ones in EC2, i get the following error,
java.io.IOException: Server returned HTTP response code: 503 for URL:.
Can somebody help me? Thank you in advance.
Well the problem was with sessions. I did not enable stickiness. Hence the next time the load balancer routed to a different instance. I enabled stickiness in elastic load balancer and everything is fine now.

Resources