|
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
RemoteOperation operation = new SshZkStopper(zookeeperHostNames,
sshPrivateKey,
hostUserId,
kafkaRootDirectory,
true);
try {
operation.execute();
} catch(RemoteOperationException e) {
e.printStackTrace();
}
}
});
RemoteOperation operation = new SshZkStarter(zookeeperHostNames,
sshPrivateKey,
hostUserId,
kafkaRootDirectory,
zkConfigFile,
zkDataDir,
zkPort);
operation.execute();
}
|