Scripting the Zeus/Stingray API

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 https://help.joyent.com

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.

#!/bin/bashzxtm=localhost/opt/zeus/zxtm/bin/zcli << EOFPool.addPool ["JoyentDemo"],[["help.joyent.com:80","joyent.com:80","wiki.joyent.com:80"]]Pool.setLoadBalancingAlgorithm ["JoyentDemo"], roundrobinPool.setPassiveMonitoring ["JoyentDemo"], 0Pool.setMonitors ["JoyentDemo"], "Full HTTP"Pool.setKeepalive ["JoyentDemo"], 1VirtualServer.addVirtualServer ["JoyentDemo"],{"default_pool" : "JoyentDemo","port" : "80","protocol":"http"}VirtualServer.setCompressionEnabled ["JoyentDemo"], yesVirtualServer.setEnabled ["JoyentDemo"], 1exitEOF

Read More »



Post written by joyentlindsay