Ubuntu環境Hadoop安裝總結
阿新 • • 發佈:2019-01-01
1 ssh連線失敗
1.0 連線測試
ssh localhost
1.2 問題
ssh: connect to host localhost port 22: Connection refused
1.3 原因
未安裝ssh-server.
測試:
# 命令
ps -e | grep ssh
# 結果
1153 ? 00:00:07 ssh-agent
1.4 解決
安裝ssh-server
sudo apt-get install openssh-server
1.5 測試效果
# 命令 ps -e | grep ssh
# 結果
764 ? 00:00:00 sshd
1153 ? 00:00:07 ssh-agent
1.6 連線
# 命令
ssh localhost
# 結果 The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
2 啟動hdfs失敗
2.1 啟動
./sbin/start-dfs.sh
2.2 報錯
Starting namenodes on [localhost]
Starting datanodes
Starting secondary namenodes [xhwl]
2019-01-01 12:21:04,362 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2.3 解決
在hadoop-3.0.2/etc/hadoop/log4j.properties檔案中新增
log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
3 hdfs50070埠無法訪問
3.1 原因
- Hadoop3.x版本hdfs埠為9870;
- Hadoop2.x版本hdfs埠為50070;
3.2 解決
對應Hadoop版本,啟動後訪問對應介面;
[參考文獻]
[1]https://www.linuxidc.com/Linux/2015-01/112045.htm
[2]https://blog.csdn.net/qq_36219266/article/details/81232315