1) Will this change affect existing data in HDFS
No, it will not. It will save the old block size in the old files. In order for it to accept a new block change, you need to rewrite the data. You can either have hadoop fs -cp or distcp in your data. The new copy will have a new block size, and you can delete your old data.
2) Do I need to propagate this change to all its nodes in the Hadoop cluster or only to NameNode?
I believe that in this case you only need to change the NameNode. However, this is a very bad idea. You need to keep all configuration files in sync for a number of good reasons. When you take your Hadoop deployment more seriously, you should probably use something like Puppet or Chef to manage your configs.
Also note that whenever you change the configuration, you need to restart NameNode and DataNodes so that they can change their behavior.
Interesting note: you can set the size of individual files as they are written to overwrite the default block size. For example, hadoop fs -D fs.local.block.size=134217728 -put ab
source share