我試圖運行hadoop jar /usr/lib/hadoop/hadoop-examples.jar aggregatewordcount /data/gutenberg/huckfinn.txt output/guten4
,但得到一個錯誤「huckfinn.txt不是SequenceFile」。Hadoop字數計數示例失敗,'not a SequentialFile'。如何設置文件格式?
我在other sites上閱讀,並在source of this example file中看到有一個自變量textinputformat
,我猜測修復了這個問題。我無法弄清楚要指定什麼。
如果我跑hadoop jar /usr/lib/hadoop/hadoop-examples.jar aggregatewordcount /data/gutenberg/huckfinn.txt output/guten5 2 textinputformat
,我得到一個不同的錯誤,「了java.lang.RuntimeException:在配置對象錯誤」
沒有必要添加'-libjars',使用'jar'選項指定的jar文件將被Hadoop框架自動複製到所有節點。如果需要複製任何額外的第三方罐子,那麼必須使用'-libjars'選項。 –
原因喬希是正確的關於我得到的錯誤。添加-libjars可以解決使用Cloudera 3的問題。謝謝Josh! –