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 on 10-04-2015 10:14 AM - edited 09-16-2022 02:42 AM
Hi
Exercise 3 requires that I run the following command
sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/original_access_logs
but this retuns an error: mkdir: `/user/hive/warehouse/original_access_logs': Is not a directory
however it does create the directory if I femove the underscores. So...
sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/originalaccesslogs
I can complete the exercise if i maodify the remaining steps according to the new directory name.
Any ideas why the unserscores don't work?
I'm using the cloudera quickstart vm 5.4.2-0 and running the red hat virtual OS
Created 10-05-2015 06:56 AM
I tested your command in the Cloudera Quickstart VM running the same version as you are (CDH 5.4.2).
I am using the VMWare version of the VM. Your command worked just fine (underscores are not a problem).
Here are the commands I issued, try them and see if they work:
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verfiy dir does not exist
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/original_access_logs -- create dir
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verify dir exists
Found 1 items
drwxr-xr-x - hdfs hive 0 2015-10-05 06:46 /user/hive/warehouse/original_access_logs
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/original_access_logs -- create dir fails
mkdir: `/user/hive/warehouse/original_access_logs': File exists
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -rmdir /user/hive/warehouse/original_access_logs -- delete dir
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verify dir does not exist
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/original_access_logs -- try creating dir again
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verify dir was created
Found 1 items
drwxr-xr-x - hdfs hive 0 2015-10-05 06:47 /user/hive/warehouse/original_access_logs
(Note: It is best to switch from using 'hadoop fs ... ' commands to 'hdfs dfs ... ' commands as only the latter will be supported in the future.)
Created 10-05-2015 12:56 AM
Hi TrevorG,
I think underscore should not be a probelm . check the output given below.
hdfs dfs -mkdir -p /user/hive/warehouse/original_access_logs
hdfs dfs -ls /user/hive/warehouse
Found 1 items
drwxr-xr-x - eip hive 0 2015-10-05 13:23 /user/hive/warehouse/original_access_logs
-Khirod
Created 10-05-2015 06:56 AM
I tested your command in the Cloudera Quickstart VM running the same version as you are (CDH 5.4.2).
I am using the VMWare version of the VM. Your command worked just fine (underscores are not a problem).
Here are the commands I issued, try them and see if they work:
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verfiy dir does not exist
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/original_access_logs -- create dir
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verify dir exists
Found 1 items
drwxr-xr-x - hdfs hive 0 2015-10-05 06:46 /user/hive/warehouse/original_access_logs
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/original_access_logs -- create dir fails
mkdir: `/user/hive/warehouse/original_access_logs': File exists
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -rmdir /user/hive/warehouse/original_access_logs -- delete dir
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verify dir does not exist
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -mkdir /user/hive/warehouse/original_access_logs -- try creating dir again
[cloudera@quickstart hive]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse -- verify dir was created
Found 1 items
drwxr-xr-x - hdfs hive 0 2015-10-05 06:47 /user/hive/warehouse/original_access_logs
(Note: It is best to switch from using 'hadoop fs ... ' commands to 'hdfs dfs ... ' commands as only the latter will be supported in the future.)
Created 10-05-2015 09:00 AM
Somehow didn't create the directory correctly. so after I ran the listing, I got...
[cloudera@quickstart ~]$ sudo -u hdfs hadoop fs -ls /user/hive/warehouse
Found 11 items
...
-rw-r--r-- 1 hdfs hive 39593868 2015-10-03 07:01 /user/hive/warehouse/original_access_logs
So did a -rm rather than -rmdir and started again.
So All good. Thanks
Created 10-05-2015 09:02 AM
Terrific! Glad it's working.