in software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java [106:139]
public void install() {
OsDetails osDetails = getMachine().getMachineDetails().getOsDetails();
List<String> commands = Lists.newLinkedList();
if (osDetails.isLinux()) {
if (getEntity().isPackageDownloadUrlProvided()) {
commands.addAll(installLinuxFromPackageUrl());
} else {
commands.addAll(installFromPackageCloud());
}
} else if (osDetails.isMac()) {
commands.addAll(installMac());
} else if (osDetails.isWindows()) {
throw new UnsupportedOperationException("RiakNode not supported on Windows instances");
} else {
throw new IllegalStateException("Machine was not detected as linux, mac or windows! Installation does not know how to proceed with " +
getMachine() + ". Details: " + getMachine().getMachineDetails().getOsDetails());
}
LOG.debug("Installing to "+this+" using commands:\n"+Strings.join(commands, "\n"));
int result = newScript(INSTALLING)
.body.append(commands)
.failIfBodyEmpty()
.execute();
if (result != 0 && osDetails.isLinux()) {
result = newScript(INSTALLING_FALLBACK)
.body.append(installLinuxFromPackageUrl())
.execute();
}
if (result != 0) {
throw new IllegalStateException(String.format("Install failed with result %d", result));
}
}