use of org.neo4j.kernel.impl.ha.ClusterManager in project neo4j by neo4j.
the class ClusterTest method testClusterWithHostnames.
@Test
public void testClusterWithHostnames() throws Throwable {
ClusterManager clusterManager = new ClusterManager.Builder(testDirectory.directory("testCluster")).withCluster(clusterOfSize("localhost", 3)).withSharedConfig(stringMap(HaSettings.ha_server.name(), "localhost:6001-9999", HaSettings.tx_push_factor.name(), "2")).build();
createClusterWithNode(clusterManager);
}
use of org.neo4j.kernel.impl.ha.ClusterManager in project neo4j by neo4j.
the class ClusterTest method lastTxCommitTimestampShouldBeUnknownAfterStartIfNoFiledOrLogsPresent.
@Test
public void lastTxCommitTimestampShouldBeUnknownAfterStartIfNoFiledOrLogsPresent() throws Throwable {
ClusterManager clusterManager = new ClusterManager.Builder(testDirectory.directory("lastTxTimestamp")).withCluster(ClusterManager.clusterOfSize(3)).build();
try {
clusterManager.start();
ClusterManager.ManagedCluster cluster = clusterManager.getCluster();
cluster.await(allSeesAllAsAvailable());
runSomeTransactions(cluster.getMaster());
cluster.sync();
HighlyAvailableGraphDatabase slave = cluster.getAnySlave();
File storeDir = new File(slave.getStoreDir());
ClusterManager.RepairKit slaveRepairKit = cluster.shutdown(slave);
clearLastTransactionCommitTimestampField(storeDir);
deleteLogs(storeDir);
HighlyAvailableGraphDatabase repairedSlave = slaveRepairKit.repair();
cluster.await(allSeesAllAsAvailable());
assertEquals(TransactionIdStore.UNKNOWN_TX_COMMIT_TIMESTAMP, lastCommittedTxTimestamp(repairedSlave));
} finally {
clusterManager.stop();
}
}
Aggregations