<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how to disable new datanode machine from data replication in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-disable-new-datanode-machine-from-data-replication/m-p/304143#M221904</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/59349"&gt;@mike_bronson7&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Once you connect the 10 new data nodes to the cluster Ambari automatically distributes the common hadoop config file i.e &lt;FONT color="#FF6600"&gt;hdfs-site.xml,Mapred-site.xml,yarn-site.xml&lt;/FONT&gt; etc to those new nodes so they can start receiving data blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My suggestion as a workaround would be to add these 10 new datanodes hostnames FQDN or IP (separated by a newline character) in the &lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; file on the NameNode machine, edit the &lt;FONT color="#FF6600"&gt;&amp;lt;HADOOP_CONF_DIR&amp;gt;/dfs.exclude&lt;/FONT&gt; file and where &amp;lt;HADOOP_CONF_DIR&amp;gt; is the directory for storing the Hadoop configuration files. For example, &lt;FONT color="#FF6600"&gt;/etc/hadoop/conf.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, ensure the DNS resolution is working or your /etc/hosts are updated and the passwordless connection is working with those hosts. Once the 10 new nodes are in the &lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; file the namenode will consider them as bad nodes so no data will be replicated to them as long as these hosts remain in the &lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; file once you have updated the NameNode with the new set of excluded DataNodes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the NameNode host machine, execute the following command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;su &amp;lt;HDFS_USER&amp;gt;
hdfs dfsadmin -refreshNodes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where &amp;lt;HDFS_USER&amp;gt; is the user owning the HDFS services&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That should do the trick, once these hosts are visible in Ambari turn maintenance mode on so you don't receive any alerts&lt;/P&gt;&lt;P&gt;The day you will decide to add/enable these 10 new datanodes you will simply &lt;FONT color="#FF6600"&gt;cp&lt;/FONT&gt; or &lt;FONT color="#FF6600"&gt;mv&lt;/FONT&gt; the &lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; to &lt;FONT color="#FF6600"&gt;dfs.include&lt;/FONT&gt; file located &lt;FONT color="#FF6600"&gt;&amp;lt;HADOOP_CONF_DIR&amp;gt;/dfs.include&lt;/FONT&gt; these nodes will start heartbeating and notifying the NameNode that&amp;nbsp; thes DataNodes are ready to start receiving files and participating in the data distribution in the cluster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the NameNode host machine remember to execute the following command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;su &amp;lt;HDFS_USER&amp;gt;
hdfs dfsadmin -refreshNodes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't forget to disable &lt;FONT color="#FF6600"&gt;Maintenance mode&lt;/FONT&gt;&amp;nbsp;on the new datanodes and remove them from&amp;nbsp;&amp;nbsp;&lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; file if you didn't rename or delete it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Run the HDFS Balancer a tool for balancing the data across the storage devices of an HDFS cluster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo -u hdfs hdfs balancer&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above&lt;FONT color="#FF6600"&gt; balancer&lt;/FONT&gt; command has a couple of options either &lt;FONT color="#FF6600"&gt;threshold&lt;/FONT&gt; or again the &lt;FONT color="#FF6600"&gt;dfs.include&lt;/FONT&gt; and &lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; see explanation below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Include and Exclude Lists&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the include list is non-empty, only the datanodes specified in the list are balanced by the HDFS Balancer. An empty include list means including all the datanodes in the cluster. The default value is an empty list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[-include [-f &amp;lt;hosts-file&amp;gt; | &amp;lt;comma-separated list of hosts&amp;gt;]]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The datanodes specified in the exclude list are excluded so that the HDFS Balancer does not balance those datanodes. An empty exclude list means that no datanodes are excluded. When a datanode is specified in both in the include list and the exclude list, the datanode is excluded. The default value is an empty list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[-exclude [-f &amp;lt;hosts-file&amp;gt; | &amp;lt;comma-separated list of hosts&amp;gt;]]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If no &lt;FONT color="#FF6600"&gt;df&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#FF6600"&gt;s.include&lt;/FONT&gt; file is specified, all DataNodes are considered to be included in the cluster (unless excluded explicitly in the &lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; file). The &lt;FONT color="#FF6600"&gt;dfs.hosts&lt;/FONT&gt; and &lt;FONT color="#FF6600"&gt;dfs.hosts.exclude&lt;/FONT&gt; properties in &lt;FONT color="#FF6600"&gt;hdfs-site.xml&lt;/FONT&gt; are used to specify the &lt;FONT color="#FF6600"&gt;dfs.include&lt;/FONT&gt; and &lt;FONT color="#FF6600"&gt;dfs.exclude&lt;/FONT&gt; files.&lt;BR /&gt;&lt;BR /&gt;Hope that helps&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Oct 2020 21:08:25 GMT</pubDate>
    <dc:creator>Shelton</dc:creator>
    <dc:date>2020-10-10T21:08:25Z</dc:date>
  </channel>
</rss>

