Ssh
驗證 start-dfs.sh
我正在嘗試按照本指南設置一個 Hadoop 集群,其中 master 是我的筆記型電腦,slave 是 virtualbox 。所以,我做到了,從master:
gsamaras@gsamaras:/home/hadoopuser/hadoop/sbin$ sudo ./start-dfs.sh Starting namenodes on [master] root@master's password: master: namenode running as process 2911. Stop it first. root@master's password: root@slave-1's password: master: datanode running as process 3057. Stop it first. <I gave password again here> slave-1: starting datanode, logging to /home/hadoopuser/hadoop/logs/hadoop-root-datanode-gsamaras-VirtualBox.out Starting secondary namenodes [0.0.0.0] root@0.0.0.0's password: 0.0.0.0: secondarynamenode running as process 3234. Stop it first. gsamaras@gsamaras:/home/hadoopuser/hadoop/sbin$ su - hadoopuser Password: -su: /home/hduser/hadoop/sbin: No such file or directory hadoopuser@gsamaras:~$ jps 15845 Jps
指南指出:“此命令的輸出應列出主節點上的 NameNode、SecondaryNameNode、DataNode 和所有從屬節點上的 DataNode。”,這似乎不是這種情況(是嗎?)然後我檢查了奴隸的日誌:
cat hadoop-root-datanode-gsamaras-VirtualBox.log ..rver: master/192.168.1.2:54310. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS) 2016-01-24 02:42:14,160 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Problem connecting to server: master/192.168.1.2:54310 gsamaras@gsamaras-VirtualBox:/home/hadoopuser/hadoop/logs$ ssh master gsamaras@master's password: Welcome to Ubuntu 14.04.3..
主節點中的日誌似乎沒有錯誤。請注意,我可以從 master 到 slave 進行無密碼 ssh,但反之亦然,該指南沒有提到這樣的事情。請問有什麼想法嗎?
當我執行
stop-dfs.sh
時,我收到錯誤消息:slave-1: no datanode to stop
現在,我又做了一次,我進入了主人:
gsamaras@gsamaras:/home/hadoopuser/hadoop/sbin$ sudo ./stop-dfs.sh Stopping namenodes on [master] root@master's password: master: no namenode to stop root@master's password: root@slave-1's password: master: no datanode to stop slave-1: stopping datanode Stopping secondary namenodes [0.0.0.0] root@0.0.0.0's password: 0.0.0.0: stopping secondarynamenode gsamaras@gsamaras:/home/hadoopuser/hadoop/sbin$ jps 19048 Jps gsamaras@gsamaras:/home/hadoopuser/hadoop/sbin$ ps axww | grep hadoop 19277 pts/1 S+ 0:00 grep --color=auto hadoop gsamaras@gsamaras:/home/hadoopuser/hadoop/sbin$ jps 19278 Jps
ps axww | grep hadoop
在slave中,給出了 id 為 2553 的程序。
我不僅要像我想的那樣在 hadoop-data 文件夾中設置權限,而且還要在 hadoop 文件夾本身中設置權限:
sudo chown -R hadoopuser /home/hadoopuser/hadoop/
我從這裡得到了這個想法。