Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 10-16-2017 04:43 AM
I am specifically looking for what commands on terminal I should run to create file in hdfs and get files in hdfs.
Created 10-16-2017 05:04 AM
You can use the basic hdfs commands to achieve this.
hdfs dfs -copyFromLocal <local file system path> <hdfs path> - to copy files from local to hdfs
hdfs dfs -copyToLocal <hdfs path> <local fs path> - copy from hdfs to local
hdfs dfs -put <local file system path> <hdfs path> - to copy files from local to hdfs
hdfs dfs -get <hdfs path> <local fs path> - copy from hdfs to local
hdfs dfs -ls <path> - list the files.
Check this link for more commands.
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/FileSystemShell.html
Make sure to run kinit with hdfs keytab before running the above commands as it is a secure enviroment
( kinit -kt /etc/security/keytabs/hdfs.headless.keytab <principal>)
If you don't know the value of principal , you can run the below command and get it
[root@xxxxx ~]# klist -kte /etc/security/keytabs/hdfs.headless.keytab Keytab name: FILE:/etc/security/keytabs/hdfs.headless.keytab KVNO Timestamp Principal ---- ----------------- -------------------------------------------------------- 1 09/10/17 14:06:14 [email protected] (aes128-cts-hmac-sha1-96) 1 09/10/17 14:06:14 [email protected] (arcfour-hmac) 1 09/10/17 14:06:14 [email protected] (des-cbc-md5) 1 09/10/17 14:06:14 [email protected] (des3-cbc-sha1) 1 09/10/17 14:06:14 [email protected] (aes256-cts-hmac-sha1-96)
In the above output [email protected] is the principal, so your kinit command would be
kinit -kt /etc/security/keytabs/hdfs.headless.keytab [email protected]
Note : You can also use ambari files view to do these operations. GUI would be easy.
Thanks,
Aditya
Created 10-16-2017 05:04 AM
You can use the basic hdfs commands to achieve this.
hdfs dfs -copyFromLocal <local file system path> <hdfs path> - to copy files from local to hdfs
hdfs dfs -copyToLocal <hdfs path> <local fs path> - copy from hdfs to local
hdfs dfs -put <local file system path> <hdfs path> - to copy files from local to hdfs
hdfs dfs -get <hdfs path> <local fs path> - copy from hdfs to local
hdfs dfs -ls <path> - list the files.
Check this link for more commands.
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/FileSystemShell.html
Make sure to run kinit with hdfs keytab before running the above commands as it is a secure enviroment
( kinit -kt /etc/security/keytabs/hdfs.headless.keytab <principal>)
If you don't know the value of principal , you can run the below command and get it
[root@xxxxx ~]# klist -kte /etc/security/keytabs/hdfs.headless.keytab Keytab name: FILE:/etc/security/keytabs/hdfs.headless.keytab KVNO Timestamp Principal ---- ----------------- -------------------------------------------------------- 1 09/10/17 14:06:14 [email protected] (aes128-cts-hmac-sha1-96) 1 09/10/17 14:06:14 [email protected] (arcfour-hmac) 1 09/10/17 14:06:14 [email protected] (des-cbc-md5) 1 09/10/17 14:06:14 [email protected] (des3-cbc-sha1) 1 09/10/17 14:06:14 [email protected] (aes256-cts-hmac-sha1-96)
In the above output [email protected] is the principal, so your kinit command would be
kinit -kt /etc/security/keytabs/hdfs.headless.keytab [email protected]
Note : You can also use ambari files view to do these operations. GUI would be easy.
Thanks,
Aditya