Skip to content

Instantly share code, notes, and snippets.

@arnaudsj
Created August 10, 2012 03:30
Show Gist options
  • Save arnaudsj/3310773 to your computer and use it in GitHub Desktop.
Save arnaudsj/3310773 to your computer and use it in GitHub Desktop.
starCluster R plugin for doRedis implementation
from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class doRedis(ClusterSetup):
def __init__(self):
pass
def run(self, nodes, master, user, user_shell, volumes):
redis_master_ip = master.private_ip_address
command = """su - arnaudsj -c "nohup R --slave -e 'require(multicore);require(doRedis);startLocalWorkers(n=multicore:::detectCores(),host=\\\"%s\\\",queue=\\\"jobs\\\", port=6379)' > /dev/null 2>&1 &" """ % redis_master_ip
for node in nodes:
if node.alias != "master":
log.info("Running on %s => %s" % (node.alias, command))
node.ssh.execute_async(command)
print "ssh -CL 9999:127.0.0.1:6379 root@%s -N" % master.public_dns_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment