SHOUTcast Distribution for Openshift Cloud Apps
Streaming service with (not yet functional) scaling capabilities, simple one line installation:
rhc app-create app-name manifest.yml
Each gear or node hosts a distribution of SHOUTcast each with a modifiable configuration. The first gear or node hosts SHOUTcast and acts as the primary relay point for other nodes. The configuration is generated by environment variables which will always properly connect SHOUTcast.
RelayPort=80
RelayServer=IP/URL
portbase=${OPENSHIFT_SCS_PORT}
destip=${OPENSHIFT_SCS_IP}
publicip=${OPENSHIFT_APP_DNS}
The gears are address based on the least amount of connections as determined by the standard haproxy which can be added by using the --scaling option to the command lines above. SHOUTcast is then up and running listening to the destip:portbase which is externally addressable. The publicip option lets SHOUTcast know the proper address to use for .pls .m3u ect... when the server is marked public.
- Creating a url endpoint to the first node which bypasses the haproxy cartridge.
- Changing haproxy's configuration to avoid initial conflict between haproxy's health check at the backend /
The issue here is get requests on / requests the primary stream before there's a stream available. Then SHOUTcast responds with an http error... Then haproxy closes outside connections from reaching the backend... From here there's no public way of providing a source to SHOUTcast...
Although not a problem if you just want to port forward into the app
rhc port-forward app-name
The problem remains that haproxy's health checks still connect to the stream, acting as a real client to the SHOUTcast server taking up space for other users.
-
Credit to this guy, who inspired me to make a diy:
-
http://blog.piratelufi.com/2013/11/use-openshift-as-a-free-shoutcast-server/
-
Then whoever put together this:
-
http://openshift.github.io/documentation/oo_cartridge_developers_guide.html
-
Plus a thank you to the over-contributor DrO: