[英]Apache Ignite will not start with 6 node cluster - Failed to resolve nodes topology
[英]Apache Zeppelin 'Failed to start Ignite node' error when integrating with Ignite
我發現了Apache Ignite,並創建了一個與他們的單詞計數示例相似的簡單應用程序。 它會將多個.txt文件中的單詞流式傳輸到緩存中。 而且我能夠借助Java應用程序中的SqlFieldsQuery類查詢這些單詞。
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節點和客戶端節點,該節點將單詞連續流式傳輸到“單詞”緩存中。 然后,我試圖在Zeppelin筆記中執行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
因此,您可以嘗試從用於Apache Zeppelin的源代碼Ignite Interpreter構建Zeppelin
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.