Skip to content
Snippets Groups Projects
Commit d3b30d8c authored by Jesper Fyhr Knudsen's avatar Jesper Fyhr Knudsen
Browse files

Add Simple script to launch octopus Daemon via jsvc

parent 01a67a47
Branches
No related tags found
No related merge requests found
......@@ -43,7 +43,6 @@ public class Program {
}
}
private static void instanciateAgent(int port, String orchestratorAddress, int orchestratorport, int parallelism) {
try (Agent agent = new Agent(orchestratorAddress, orchestratorport, port, parallelism)) {
agent.addPlugin(new TestPlugin());
......
#!/bin/bash
JAVA_HOME=/usr/lib/jvm/java-8-oracle
LOCAL_PATH=/home/ubuntu/octopus
jsvc_run()
{
cd $1
/usr/bin/jsvc -home $JAVA_HOME \
-cwd $1 \
-user ubuntu \
-debug \
-outfile std.out \
-errfile std.err \
-pidfile pid \
-cp $LOCAL_PATH/lib/commons-daemon-1.0.15.jar:$LOCAL_PATH/octopus-daemon.jar \
$2 \
com.chaos.octopus.Daemon
}
case $1 in
start)
echo "Starting Octopus Orchestrator"
jsvc_run $2
;;
stop)
echo "Stopping Octopus Orchestrator"
jsvc_run $2 "-stop"
;;
*)
echo "usage: (start|stop)"
esac
......@@ -54,11 +54,14 @@ public class OrchestratorImpl implements Orchestrator {
ConcurrentJobQueue queue = new ConcurrentJobQueue();
OrchestratorImpl leader = new OrchestratorImpl(config.getListeningPort(), sync, queue);
if(config.getChaosApiUrl() != null && config.getChaosApiKey() != null)
{
Chaos chaos = new Chaos(config.getChaosApiUrl());
AuthenticatedChaosClient client = chaos.authenticate(config.getChaosApiKey());
sync.addSynchronizationTask(new UpdateJob(queue, client));
sync.addSynchronizationTask(new EnqueueJobs(leader, client));
sync.addSynchronizationTask(new Heartbeat(leader._AllocationHandler, client));
}
return leader;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment