Search code examples
javaigniteapache-zeppelin

Apache Zeppelin 'Failed to start Ignite node' error when integrating with Ignite


I'm discovering Apache Ignite and created a simple app similar to their word count example. It is streaming words from multiple .txt files into cache. And I am able to query these words with the help of SqlFieldsQuery class in the Java application.

public class NodeStartup {

    public static void main(String[] args) throws IgniteException {
        // Start Server Node
        Ignition.start("config/example-ignite.xml");
    }
}

public class StreamWordsToCache {
        public static void main(String[] args) throws Exception {
            // Mark the cluster member as a Client
        Ignition.setClientMode(true);

        // Start a Client Node
        try (Ignite ignite = Ignition.start("config/example-ignite.xml")) {
            // Checks if Server nodes not found
            if (!ExamplesUtils.hasServerNodes(ignite))
                return;

            // If cache doesn't exist, create it within the cluster, otherwise use the existing one
            IgniteCache<AffinityUuid, String> theCache = ignite.getOrCreateCache(CacheConfig.wordsCache());

            // Create Streamers for the cache
            try (IgniteDataStreamer<AffinityUuid, String> theStreamer = ignite.dataStreamer(theCache.getName())) {

                //Stream words from articles
                while (true) {
                    File directory = new File("src/main/resources/");
                    if (directory.listFiles() != null) {
                        List<File> filesInDir = new ArrayList<>(Arrays.asList(directory.listFiles()));
                        for (File file : filesInDir) {
                            System.out.println("Start reading file : " + file.getName());
                            try (LineNumberReader lineNumberReader = new LineNumberReader(new FileReader(file))) {
                                for (String line = lineNumberReader.readLine(); line != null; line = lineNumberReader.readLine()) {
                                    for (String word : line.split(" "))
                                        if (!word.isEmpty() && word.matches("(?!(?:that|with|from))\\b(?<!\\b[-.])[^\\d\\W]{4,}+\\b(?![-.]\\b)"))
                                            // Stream words into Ignite
                                            // Unique key (AffinityUuid) is created for each word
                                            // AffinityUuid ensures that identical words are processed on the same cluster node
                                            // in order to process them faster
                                            theStreamer.addData(new AffinityUuid(word), word);
                                }}}}}}}}

Now I decided to use Apache Zeppelin to retrieve these words from Ignite cache. But for some reason my attempts to integrate Zeppelin and Ignite fail. I'm following this tutorial https://apacheignite-tools.readme.io/docs/apache-zeppelin and configured Ignite Interpreter similar to their recommendations.

enter image description here First I start the Ignite node and the client node that continuously streams words into "words" cache. Then I'm trying to execute SQL query in a Zeppelin note and keep getting Failed to start Ignite node error. enter image description here enter image description here

What may be the reason for such behaviour? The version of Ignite used in my project is 2.1.0 and Zeppelin binaries are 0.7.2, could it cause the problem? Or maybe something is wrong with ignite.jdbc.url property value?jdbc:ignite://localhost:11211/words


Solution

  • Your version of Zeppelin (0.7.2) is certified with Apache Ignite 1.9.0 So, I think the root cause of your issue is a different version of Ignite.

    It looks like that the latest code base of Zeppelin supports Apache Ignite 2.1 https://github.com/apache/zeppelin/pull/2549

    So, you can try to build Zeppelin from source Ignite Interpreter for Apache Zeppelin