This is a cluster manager implementation for Vert.x that uses Apache Ignite.
Vert.x cluster manager is pluggable component. So you can replace default Vert.x cluster manager by this implementation.
If the jar is on your classpath then Vert.x will automatically detect this and use it as the cluster manager. Please make sure you don’t have any other cluster managers on your classpath or Vert.x might choose the wrong one.
vertx-ignite-${version}.jar
should be in the lib
directory of the Vert.x installation.
Add a dependency to the artifact.
Maven:
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-ignite</artifactId>
<version>${version}</version>
</dependency>
Gradle:
io.vertx:vertx-ignite:${version}:jar
You can also specify the cluster manager programmatically. In order to do this just specify it on the options when you are creating your Vert.x instance, for example:
ClusterManager clusterManager = new IgniteClusterManager();
VertxOptions options = new VertxOptions().setClusterManager(clusterManager);
Vertx.clusteredVertx(options, res -> {
if (res.succeeded()) {
Vertx vertx = res.result();
} else {
// failed!
}
});
In order to build this cluster manager from sources just use the following command:
mvn clean package -DskipTests
If you want to build this cluster manager with specific Apache Ignite version (1.5.0 or later):
mvn clean package -Dignite.version=${version} -DskipTests
The cluster manager is configured by a file default-ignite.xml
which is packaged inside the jar.
If you want to override this configuration you can provide ignite.xml
file on your classpath and this will be used instead.
The xml file is a Ignite configuration file and is described in details in Apache Ignite documentation.
You can also specify configuration programmatically:
IgniteConfiguration cfg = new IgniteConfiguration();
// Configuration code (omitted)
ClusterManager clusterManager = new IgniteClusterManager(cfg);
VertxOptions options = new VertxOptions().setClusterManager(clusterManager);
Vertx.clusteredVertx(options, res -> {
if (res.succeeded()) {
Vertx vertx = res.result();
} else {
// failed!
}
});
The default configuration uses TcpDiscoveryMulticastIpFinder
so you must have multicast enabled on your network.
For cases when multicast is disabled TcpDiscoveryVmIpFinder
should be used with pre-configured list of IP addresses.
Please see Cluster Configuration section
at Apache Ignite documentation for details.