Apache Zeppelin 'Failed to start Ignite node' 与 Ignite 集成时出错
Apache Zeppelin 'Failed to start Ignite node' error when integrating with Ignite
我发现了 Apache Ignite 并创建了一个类似于他们的字数统计示例的简单应用程序。它将多个 .txt 文件中的单词流式传输到缓存中。我可以在 Java 应用程序中借助 SqlFieldsQuery class 查询这些词。
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);
}}}}}}}}
现在我决定使用 Apache Zeppelin 从 Ignite 缓存中检索这些单词。但出于某种原因,我尝试集成 Zeppelin 和 Ignite 失败了。我按照本教程 https://apacheignite-tools.readme.io/docs/apache-zeppelin 并按照他们的建议配置了 Ignite Interpreter。
首先,我启动 Ignite 节点和不断将单词流式传输到 "words" 缓存中的客户端节点。然后我尝试在 Zeppelin note 中执行 SQL 查询并不断收到 Failed to start Ignite node
错误。
出现这种行为的原因可能是什么?我项目中使用的 Ignite 版本是 2.1.0,Zeppelin 二进制文件是 0.7.2,是否会导致问题?或者 ignite.jdbc.url
属性 值有问题?jdbc:ignite://localhost:11211/words
您的 Zeppelin 版本 (0.7.2) 已通过 Apache Ignite 1.9.0 认证
所以,我认为你的问题的根本原因是不同版本的 Ignite。
看来Zeppelin最新的代码库支持Apache Ignite 2.1
https://github.com/apache/zeppelin/pull/2549
因此,您可以尝试从源代码构建 Zeppelin
Ignite Interpreter for Apache Zeppelin
我发现了 Apache Ignite 并创建了一个类似于他们的字数统计示例的简单应用程序。它将多个 .txt 文件中的单词流式传输到缓存中。我可以在 Java 应用程序中借助 SqlFieldsQuery class 查询这些词。
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);
}}}}}}}}
现在我决定使用 Apache Zeppelin 从 Ignite 缓存中检索这些单词。但出于某种原因,我尝试集成 Zeppelin 和 Ignite 失败了。我按照本教程 https://apacheignite-tools.readme.io/docs/apache-zeppelin 并按照他们的建议配置了 Ignite Interpreter。
Failed to start Ignite node
错误。
出现这种行为的原因可能是什么?我项目中使用的 Ignite 版本是 2.1.0,Zeppelin 二进制文件是 0.7.2,是否会导致问题?或者 ignite.jdbc.url
属性 值有问题?jdbc:ignite://localhost:11211/words
您的 Zeppelin 版本 (0.7.2) 已通过 Apache Ignite 1.9.0 认证 所以,我认为你的问题的根本原因是不同版本的 Ignite。
看来Zeppelin最新的代码库支持Apache Ignite 2.1 https://github.com/apache/zeppelin/pull/2549
因此,您可以尝试从源代码构建 Zeppelin Ignite Interpreter for Apache Zeppelin