Please read this article with step by step guide. Also read the details in this doc.a) how to configure load balancer? Determine in flow request by port 8443?
You can apply the same license key to all the instances. If you're using AWS Marketplace AMI, it will be billed by Amazon itself for their own price. If you're using custom base image with your own license key, it will be billed according to running instances count as described here.b) How to apply license on scaled instances?
Yes, you can apply your current license. But in this case you should use custom image, not Marketplace AMI.Currently I hv a license that its renewly on monthly basis, can I apply that to all scalable instances?
Yes.I just need to replace it with LB hostname right?
Yes, as described in the article. In the doc (p 2.3) just HTTP ports are shown. If you plan to use HTTPS, you should provide SSL certificates for load balancer domain name.Also to use port 8443 in the LB protocol setting?
You can add 1935/TCP port forwarding to load balancer too.I hv configured LB in AWS to forward http/https (port 80, 8443 and 8888) to webcallserver sitting in a auto scaling group, but how about RTMP traffic? How would it figure which server (if more than 1 in auto scaling group) to forward the RTMP traffic to?
This is a bad approach to renew license every month. You should buy a monthly subscription which covers all your server instances and don't need to be renewed.but what about the next month when i renew the license? Its impractical to update the snapshot and template on monthly basis.
/connect
and /publishStream
to detect on which server a stream is published. Then, you should send server IP address to client, and client should connect to the server by IP address (not to LB entry point) to play the stream.If you're republishing WebRTC stream as RTMP to the same server, use RTMP URL like thisFrom browser, I used the modified 'webrtc-as-rtmp-republishing.js' to connect to WebRTC server in instances behind the load balancer, then stream RTMP traffic to it; so with 2 and above instances behind LB, I notice the session would fail (presume the RTMP stream was send to wrong WebRTC server).
rtmp://localhost:1935/live/streamName
. In this case, RTMP stream will always be published to the same WCS.So, you publish WebRTC and play it as RTMP from server, right?For example, when a stream is started from web browser, and the websocket connection is to instance 1, but when I used ffmpeg to try to grep the stream from instance, it says the stream is not valid; thus I suspect the stream was actually sent to instance 2, causing the error.
/connect
and /publishStream
REST hooks on your backend (as we recommenede above), get direct server instance ip from sessionId
field, form RTMP link like rtmp://direct_instance_ip:1935/live/streamName
and pass this link to ffmpeg by any possible way.