cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1293
Views
3
Helpful
3
Replies
Highlighted
Beginner

Configuring HAProxy/Nginx for non-HTTP

Hi all,

I've tried to find the answer to this in the documentation, but keep coming up empty.

HAProxy and Nginx, when used as tier apps within the App Builder, work great at configuring themselves for the HTTP backends they balance.  However, I'd like to balance non-HTTP ports (in this example, TCP 3306 for back end slave MySQL databases).

How can this be done programmatically?

Thank you!

Alex

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Alex,

From my perspective you could stage an haproxy.cfg file in an app package and, in a script - say, node initialization script for example - copy that file from the /opt/remoteFiles/appPackage directory to the /etc/haproxy directory (assuming a Linux OS). Alternatively, you could use sed or echo to replace/add text to your haproxy.cfg file. As for the actual structure of the cfg file I think this would vary greatly. PLease let me know if this answers your question.

View solution in original post

3 REPLIES 3
Highlighted
Cisco Employee

Alex,

From my perspective you could stage an haproxy.cfg file in an app package and, in a script - say, node initialization script for example - copy that file from the /opt/remoteFiles/appPackage directory to the /etc/haproxy directory (assuming a Linux OS). Alternatively, you could use sed or echo to replace/add text to your haproxy.cfg file. As for the actual structure of the cfg file I think this would vary greatly. PLease let me know if this answers your question.

View solution in original post

Highlighted

Thanks, Tuan.  It sounds like this might work for initial deployment. 

How would we handle auto scaling with this approach?  Are there phases or stages for scaling up/down that I can hook a script into?

Highlighted

Alex,

Our out-of-box Nginx service should handle this automatically so if you wanted to use that for your base LB or take the lifecycle functions in the script to crate your own you could do that (the script is named service and it resides in /usr/local/osmosix/service/nginx). If you wanted to create an External Service to leverage an ecosystem partner like f5, you could write a function for the "Update" lifecycle stage and handle the logic upon a CloudCenter originated scaling event. The scaling event, from a platform perspective, will initiate the "Update" stage of the lifecycle actions.

Tuan

Content for Community-Ad

This widget could not be displayed.