use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class AgentsFileTest method testLoad_onlyPublicAddress.
@Test
public void testLoad_onlyPublicAddress() {
writeText("192.168.1.1", agentsFile);
registry = load(agentsFile);
assertEquals(1, registry.agentCount());
AgentData agentData = registry.getFirstAgent();
assertEquals("192.168.1.1", agentData.getPublicAddress());
assertEquals("192.168.1.1", agentData.getPrivateAddress());
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class Wizard method createSshCopyIdScript.
void createSshCopyIdScript(SimulatorProperties simulatorProperties) {
Registry registry = loadComponentRegister(agentFile, true);
String userName = simulatorProperties.getUser();
ensureExistingFile(SSH_COPY_ID_FILE);
writeText("#!/bin/bash" + NEW_LINE + NEW_LINE, SSH_COPY_ID_FILE);
for (AgentData agent : registry.getAgents()) {
String publicAddress = agent.getPublicAddress();
appendText(format("ssh-copy-id -i ~/.ssh/id_rsa.pub %s@%s%n", userName, publicAddress), SSH_COPY_ID_FILE);
}
execute(format("chmod u+x %s", SSH_COPY_ID_FILE.getAbsoluteFile()));
echo("Please execute './%s' to copy your public RSA key to all remote machines.", SSH_COPY_ID_FILE.getName());
}
Aggregations