How to create a file in Linux named 'timestamp_epoch time' & uploading this file to hdfs and saving the latest fsimage to Linux filesystem in such a way that it should contain the file with epoch time created earlier.
how to create file with epoch timestamp in linux , take fsi image into it ?. I hope it makes more clearer.
Sorry, but it is still hard to understand what you want to do and why.
So you create a file on linux with a filename that is an epoch timestamp:
Then you use hdfs dfs -put 1535175604 /some/dir
Then you want to know when that new file written to hdfs will be on disk in the fsimage file?
If so, then on the standby or secondary namenode that update file metadata would be merged from edit to fsimage during the next checkpoint.
This blog entry is older, but it still explains the checkpointing pretty well:
Please follow the below steps :
1. Create the file with timestamp :
> touch timestamp_`date +"%s"`
2. upload the file in hdfs location.
> hdfs dfs -put timestamp_1615114389 /data
3. To save the latest fsimage add the namenode in safemode
> hdfs dfsadmin -safemode enter
4. save the latest fsimage
> hdfs dfsadmin -saveNamespace
5. After saving the latest fsimage safemode disable
>hdfs dfsadmin -safemode leave
6. download the latest fsimage to local system directory
>hdfs dfsadmin –fetchImage /data
7. Read the fsimage file to check timestamp_file by converting into xml file
> hdfs oiv -p XML -i fsimage_0000000000000055633 -o fsimage.xml