vendredi 26 juin 2015

how to use aws application generated session stickiness in ELB

I have been struggling on this.

I implemented a very simple HTTP server on two EC2 instances behind an ELB. The HTTP server only reads the cookie from the header, and send back response with the same cookie in the response header.

At the client, I use

curl --cookie "mychannelid=mytest; Expires=Sat, 27-Jun-2017 02:48:17 GMT" --header "Accept-Language: en" "http://ift.tt/1GPTZLh"

Also, on the elb, I enabled application stickiness with cookie name mychannelid. But when I ran this system, I still got 50/50 server assignment. How can I implement this?

Another information is that, if generate the cookie at the HTTP server, and send back to the client, also, I need to access the HTTP server with firefox, then I can get what I want. If I access the HTTP server with curl, I can't. I don't know why, I checked the packets, the cookies are in the header.




Aucun commentaire:

Enregistrer un commentaire