use of org.neo4j.causalclustering.discovery.SharedDiscoveryService in project neo4j by neo4j.
the class ClusterSeedingIT method shouldSeedNewMemberFromEmptyIdleCluster.
@Test
public void shouldSeedNewMemberFromEmptyIdleCluster() throws Throwable {
// given
cluster = new Cluster(testDir.directory("cluster-b"), 3, 0, new SharedDiscoveryService(), emptyMap(), backupParams(), emptyMap(), emptyMap(), Standard.LATEST_NAME);
cluster.start();
// when: creating a backup
File backupDir = createBackup(cluster.getCoreMemberById(0).database(), "the-backup");
// and: seeding new member with said backup
CoreClusterMember newMember = cluster.addCoreMemberWithId(3);
fsa.copyRecursively(backupDir, newMember.storeDir());
newMember.start();
// then
dataMatchesEventually(DbRepresentation.of(newMember.database()), cluster.coreMembers());
}
use of org.neo4j.causalclustering.discovery.SharedDiscoveryService in project neo4j by neo4j.
the class ClusterSeedingIT method setup.
@Before
public void setup() throws Exception {
fsa = fileSystemRule.get();
backupCluster = new Cluster(testDir.directory("cluster-for-backup"), 3, 0, new SharedDiscoveryService(), emptyMap(), backupParams(), emptyMap(), emptyMap(), Standard.LATEST_NAME);
cluster = new Cluster(testDir.directory("cluster-b"), 3, 0, new SharedDiscoveryService(), emptyMap(), emptyMap(), emptyMap(), emptyMap(), Standard.LATEST_NAME);
baseBackupDir = testDir.directory("backups");
}
use of org.neo4j.causalclustering.discovery.SharedDiscoveryService in project neo4j by neo4j.
the class ClusterSeedingIT method shouldSeedNewMemberFromNonEmptyIdleCluster.
@Test
public void shouldSeedNewMemberFromNonEmptyIdleCluster() throws Throwable {
// given
cluster = new Cluster(testDir.directory("cluster-b"), 3, 0, new SharedDiscoveryService(), emptyMap(), backupParams(), emptyMap(), emptyMap(), Standard.LATEST_NAME);
cluster.start();
createEmptyNodes(cluster, 100);
// when: creating a backup
File backupDir = createBackup(cluster.getCoreMemberById(0).database(), "the-backup");
// and: seeding new member with said backup
CoreClusterMember newMember = cluster.addCoreMemberWithId(3);
fsa.copyRecursively(backupDir, newMember.storeDir());
newMember.start();
// then
dataMatchesEventually(DbRepresentation.of(newMember.database()), cluster.coreMembers());
}
Aggregations