Scripting the Zeus/Stingray API

August 07, 2012 - by joyentlindsay

Joyent's Senior Solutions Architect Peter Yorke released an image yesterday to automate Zeus/Stingray load balancer set up.  Here's the shell script, but you have to see how the script works broken down by line, plus variations and tips.  

For frequent updates and new images be sure to visit

So you are digging the Joyent API, you have your provisioning working with your Chef or Puppet Scripts.

Here is a shell script you can use to add that new box to your Stingray load balancer.



/opt/zeus/zxtm/bin/zcli << EOF

Pool.addPool ["JoyentDemo"],[["","",""]]

Pool.setLoadBalancingAlgorithm ["JoyentDemo"], roundrobin

Pool.setPassiveMonitoring ["JoyentDemo"], 0

Pool.setMonitors ["JoyentDemo"], "Full HTTP"

Pool.setKeepalive ["JoyentDemo"], 1

VirtualServer.addVirtualServer ["JoyentDemo"],{"default_pool" : "JoyentDemo","port" : "80","protocol":"http"}

VirtualServer.setCompressionEnabled ["JoyentDemo"], yes

VirtualServer.setEnabled ["JoyentDemo"], 1



Read More »