鼓搗了好幾天hadoop2.2集羣(關於節點刪除+ssh免密碼登錄)

1.節點刪除
html

1)修改conf/hdfs-site.xml文件,excludes文件的目錄。以下:node

<property>
    <name>dfs.hosts.exclude</name>  
   <value>/home/hadoop/hadoop-2.2.0/etc/hadoop/excludes</value> 
    <description>Names a file that contains a list of hosts that are   
      not permitted to connect to the namenode.  The full pathname of the   
      file must be specified.  If the value is empty, no hosts are   
       excluded.
    </description>
</property>

2)在excludes文件中指定要下架的機器,如:瀏覽器

    slave1安全

3)刷新配置,執行以下命令:ssh

bin/hadoop dfsadmin  -refreshNodes

4)查看狀態jsp

在命令行使用命令 : bin/hadoop dfsadmin -report
或者在瀏覽器查看:http://XXXXX:50070/dfshealth.jsp
出現以下狀態,同時Blocks的數量也在減小。
Live Nodes     :    10 (Decommissioned: 0)    
Dead Nodes     :    0 (Decommissioned: 0)    
Decommissioning Nodes     :    2    
Number of Under-Replicated Blocks    :    106106

5)再次編輯excludes文件 
    一旦完成了機器下架,它們就能夠從excludes文件移除了 
   登陸要下架的機器,會發現DataNode進程沒有了,可是TaskTracker依然存在,須要手工處理一下
oop

6). 遇到的問題:
        (1)剛開始刷新配置,block數目不動。可能緣由:安全模式
            bin/hadoop dfsadmin -safemode leave
       (2) block 數量不斷減小,但後來數量就不動了。 可能緣由:集羣的免密碼登錄可能有問題,檢查一下。

3.附加:免密碼登錄

http://www.cnblogs.com/jdksummer/articles/2521550.html
同時注意權限問題。
ssh配置成功後,啓動hadoop節點出現Are you sure you want to continue connecting (yes/no)?

輸入yes
spa

相關文章
相關標籤/搜索