
我按照說明進行操作這裡用於以偽分散式模式安裝hadoop。
但是,我在連接 HDFS 時遇到問題。
當我執行這個命令時:
./hadoop fs -ls /
我得到了一個目錄列表,就像我應該做的那樣。
但是,當我執行此命令時:
./hadoop fs -ls hdfs://localhost/
我明白了:
12/08/23 15:29:58 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 0 time(s).
12/08/23 15:29:59 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 1 time(s).
12/08/23 15:30:00 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 2 time(s).
12/08/23 15:30:01 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 3 time(s).
12/08/23 15:30:02 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 4 time(s).
12/08/23 15:30:03 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 5 time(s).
12/08/23 15:30:04 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 6 time(s).
12/08/23 15:30:05 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 7 time(s).
12/08/23 15:30:06 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 8 time(s).
12/08/23 15:30:07 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 9 time(s).
ls: Call to localhost/127.0.0.1:8020 failed on connection exception: java.net.ConnectException: Connection refused
如果我瀏覽這裡:
http://localhost:50070/dfshealth.jsp
我得到了 NameNode 系統運行狀況頁面,就像我應該做的那樣。但是,如果我點擊“瀏覽文件系統”鏈接,我相信該鏈接位於此處:
http://localhost:50070/nn_browsedfscontent.jsp
我從 Jetty 收到 404 頁面。
我不知道這兩件事是否相關,但這絕對阻礙了我。我正在嘗試按照概述以偽分佈式模式設定 hbase這裡,但我不能,因為 hbase 無法連接到連接埠 8020 上的 hdfs。
資訊
我在 CENTOS 6.2 上運行 hadoop .20 和 hbase .90.6。
Hadoop 和 hbase 從我寫的 init.d 腳本啟動。
Hadoop在hadoop用戶下運行,位於/opt/hadoop。在 hadoop init.d 腳本中,我使用 daemon 指令執行 start-all.sh。
HBase 在 root 下運行,位於 /opt/hbase 中。在 hbase init.d 腳本中,我執行 start-hbase.sh 腳本。目前我正在獨立模式下執行 HBase。
答案1
看起來我錯誤地將 fs.default.name 設定為 9000。感謝 mgorven 的幫助!