AWS ELB WS problems

HI All,
I’m using 0.49 version and I would like to setup it behind AWS ELB and RDS MySQL, but I’m getting following error:

time=“2015-12-08T23:16:59Z” level=fatal msg=“Unable to start event router” error=“websocket: bad handshake”

I’ve configured also Proxy Protocol to enable WSS traffic but nothing change… any idea?

Proxy Procol ref:

Thanks
Jo

Hi @miticojo,

The UI also uses websockets to dynamically update. Can you check whether the UI is successfully making websocket connections?

To do so:

  1. Open up rancher in your browser
  2. Open up the developer tools for your browser and go to the network tab,
  3. Refresh the browser.
    You should see a request to /v1/subscribe. Was it made successfully and is the response code to that request 101 “Switch Protocols”?

Also, can you give a little more information about your setup:

  1. Are you running rancher in HA mode or in single server mode? If in HA mode, is the websocket proxy container up and running successfully?
  2. Do you have any other proxies between rancher-server and your ELB?

Hi @cjellick, thanks for your response!

from external connections it seems to work well: I’ve got a 200 for wss://rancher.************.com/v1/subscribe?eventNames=resource.change&include=hosts&include=instances&include=instance&include=loadBalancerConfig&include=loadBalancerTargets&include=loadBalancerListeners&include=instanceLinks&include=ipAddresses&projectId=1a5 in my browser

but from server container I still have wss errors:

time=“2015-12-09T16:03:04Z” level=info msg=“Initializing event router” workerCount=10
time=“2015-12-09T16:03:04Z” level=error msg=“Failed to subscribe to events.” error=“websocket: bad handshake” responseBody=“{"type":"collection","resourceType":"subscribe","links":{"self":"https://rancher..com/v1/subscribe"},"createTypes":{},"actions":{},"data":[],"sortLinks":{"eventNames":"https://rancher..com/v1/subscribe?eventNames=physicalhost.create%3Bhandler%3DgoMachineService&eventNames=physicalhost.bootstrap%3Bhandler%3DgoMachineService&eventNames=physicalhost.remove%3Bhandler%3DgoMachineService&eventNames=ping%3Bhandler%3DgoMachineService&sort=eventNames"},"pagination":null,"sort":null,"filters":{"eventNames":[{"modifier":"eq","value":"physicalhost.create;handler=goMachineService"},{"modifier":"eq","value":"physicalhost.bootstrap;handler=goMachineService"},{"modifier":"eq","value":"physicalhost.remove;handler=goMachineService"},{"modifier":"eq","value":"ping;handler=goMachineService"}]},"createDefaults":{}}" responseHeaders=map[Server:[Jetty(9.2.11.v20150529)] X-Api-Account-Id:[1a6] X-Api-Client-Ip:[52.16.23.108] X-Api-Schemas:[https://rancher..com/v1/schemas] Content-Length:[825] Content-Type:[application/json; charset=utf-8] Date:[Wed, 09 Dec 2015 16:03:04 GMT] Vary:[Accept-Encoding, User-Agent] Connection:[keep-alive]] status=“200 OK” statusCode=200 subscribeUrl="wss://rancher.****.com/v1/subscribe?eventNames=physicalhost.create%3Bhandler%3DgoMachineService&eventNames=physicalhost.bootstrap%3Bhandler%3DgoMachineService&eventNames=physicalhost.remove%3Bhandler%3DgoMachineService&eventNames=ping%3Bhandler%3DgoMachineService”
time=“2015-12-09T16:03:04Z” level=error msg=“Unable to start EventRouter” Err=“websocket: bad handshake”
time=“2015-12-09T16:03:04Z” level=info msg=“Exiting go-machine-service…”

I’m using an ubuntu ec2 instance with docker 1.9 connected in a VPC network without any proxy, only ELB.

Thanks
Jo

@miticojo It should say 101 Switching Protocols, not 200. Besides Proxy Protocol, you need the listener and target in ELB to be TCP/TLS, not HTTP/HTTPS because they don’t support WebSockets in HTTP mode.

Ah sorry guys…
I’ve changed ELB to TCP/TLS and now it works as expected! :smiley:

Thanks for your precious help!

My next step is try to test HA conf… I will keep you updated! :wink:

Jo

@miticojo check out https://github.com/SungardAS/particles-rancher.

Even if you don’t use condensation the CloudFormation scripts can be used by clicking the ‘Launch Stack’ buttons.

It will give you HA multi-node rancher with Zookeeper, RDS MySQL, Elasticache Redis autoscaling groups and load balancers.

-Kevin

Thanks but I’d like to setup all with 3 AWS instances + RDS… and I’ve almost finished but HA documentation need to be changed and explained using some beautiful schema.