ZooKeeper IP Finder Extension | Ignite Documentation

Ignite Summit Europe—November 2022—Call For Speakers Is Now Open!

Edit

ZooKeeper IP Finder Extension

Note
Not supported in .NET/C#.

Apache Ignite ZooKeeper Ip Finder module provides a TCP Discovery IP Finder that uses a ZooKeeper directory to locate other Ignite nodes to connect to.

Install

Depending on how you use Ignite, you can an extension using one of the following methods:

  • If you use the binary distribution, move the ignite-zookeeper-ip-finder-ext to the lib directory before starting the node.

  • Add libraries from ignite-zookeeper-ip-finder-ext to the classpath of your application.

  • Add a module as a Maven dependency to your project.

Configuration

To set up ZooKeeper IP finder use TcpDiscoveryZookeeperIpFinder:

<bean class="org.apache.ignite.configuration.IgniteConfiguration">
    <property name="discoverySpi">
        <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ipFinder">
                <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder">
                    <property name="zkConnectionString" value="127.0.0.1:2181"/>
                </bean>
            </property>
        </bean>
    </property>
</bean>
TcpDiscoverySpi spi = new TcpDiscoverySpi();

TcpDiscoveryZookeeperIpFinder ipFinder = new TcpDiscoveryZookeeperIpFinder();

// Specify ZooKeeper connection string.
ipFinder.setZkConnectionString("127.0.0.1:2181");

spi.setIpFinder(ipFinder);

IgniteConfiguration cfg = new IgniteConfiguration();

// Override default discovery SPI.
cfg.setDiscoverySpi(spi);

// Start the node.
Ignite ignite = Ignition.start(cfg);
This API is not presently available for C#/.NET. You can use XML configuration.
This API is not presently available for C++. You can use XML configuration.

The module depends on third-party libraries that use the slf4j facade for logging. You can set up an underlying logging framework yourself.