use of org.neo4j.cluster.protocol.election.NotElectableElectionCredentialsProvider in project neo4j by neo4j.
the class ClusterTopologyChangesIT method newClusterClient.
private ClusterClientModule newClusterClient(LifeSupport life, InstanceId id) {
Config config = Config.embeddedDefaults(MapUtil.stringMap(ClusterSettings.initial_hosts.name(), cluster.getInitialHostsConfigString(), ClusterSettings.server_id.name(), String.valueOf(id.toIntegerIndex()), ClusterSettings.cluster_server.name(), "0.0.0.0:8888"));
FormattedLogProvider logProvider = FormattedLogProvider.toOutputStream(System.out);
SimpleLogService logService = new SimpleLogService(logProvider, logProvider);
return new ClusterClientModule(life, new Dependencies(), new Monitors(), config, logService, new NotElectableElectionCredentialsProvider());
}
use of org.neo4j.cluster.protocol.election.NotElectableElectionCredentialsProvider in project neo4j by neo4j.
the class ArbiterBootstrapper method start.
@SafeVarargs
@Override
public final int start(File homeDir, Optional<File> configFile, Pair<String, String>... configOverrides) {
Config config = getConfig(configFile, configOverrides);
try {
DefaultFileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction();
life.add(new FileSystemLifecycleAdapter(fileSystem));
life.add(new Neo4jJobScheduler());
new ClusterClientModule(life, new Dependencies(), new Monitors(), config, logService(fileSystem, config), new NotElectableElectionCredentialsProvider());
} catch (LifecycleException e) {
@SuppressWarnings({ "ThrowableResultOfMethodCallIgnored", "unchecked" }) Throwable cause = peel(e, Predicates.<Throwable>instanceOf(LifecycleException.class));
if (cause instanceof ChannelException) {
System.err.println("ERROR: " + cause.getMessage() + (cause.getCause() != null ? ", caused by:" + cause.getCause().getMessage() : ""));
} else {
System.err.println("ERROR: Unknown error");
throw e;
}
}
addShutdownHook();
life.start();
return 0;
}
Aggregations