title: Verifying checksum for files in HDFS
body: <p>I'm using webhdfs to ingest data from Local file system to HDFS. Now I want to ensure integrity of files ingested into HDFS.</p>
  
  <p>How can I make sure transferred files are not corrrupted/altered etc? </p>
  
  <p>I used below webhdfs command to get the checksum of file</p>
  
  <pre><code>curl -i -L --negotiate -u: -X GET "http://$hostname:$port/webhdfs/v1/user/path?op=GETFILECHECKSUM"
  </code></pre>
  
  <p>How should I use above checksum to ensure the integrity of Ingested files? please suggest</p>
  
  <p>Below is the steps I'm following</p>
  
  <pre><code>&gt;md5sum locale_file
  740c461879b484f4f5960aa4f67a145b
  
   &gt;hadoop fs -checksum locale_file
  locale_file     MD5-of-0MD5-of-512CRC32C        000002000000000000000000f4ec0c298cd6196ffdd8148ae536c9fe
  </code></pre>
  
  <p>Checksum of file on local system is different than same file on HDFS I need to compare checksum how can I do that?</p>