Cloudera terminal window prompt.



0
When I start-up Hadoop, then open a terminal window, my prompt is [cloudera@localhost ~]$. The prompt for Omair Aasim's cloudera instance in his wordcount video is cloudera@cloudera-vm:~$. Do I need to get out of localhost (and how), and is this the issue I am having when trying to mkdir and I get an error message saying I do not have permission?

3 Answer(s)


0

Hi Tim

Like you mentioned this is a permission issue.

In the WordCount example video - CDH3 is being used. In CDH3 when you login as cloudera - you see the prompt cloudera@cloudera-vm

In CDH4 - it is cloudera@localhost

You are logging in as user cloudera - so you will have permissions only to create or write files in the folder /user/cloudera

So if you run the command
hadoop fs -mkdir /wordcount

It will give you a permissions error

Try doing the same in the /user/cloudera folder
hadoop fs -mkdir /user/cloudera/wordcount

Hope this helps

0

I do not see a user/cloudera folder.

[cloudera@localhost ~]$ hadoop fs -mkdir /user/cloudera/wordcount
[cloudera@localhost ~]$ ls
datasets eclipse pig_1402912246007.log Templates
Desktop lib pig_1402912587015.log Videos
Documents Music pig_1402913727249.log wordcount
Downloads Pictures Public workspace
[cloudera@localhost ~]$ cd user/cloudera/wordcount
bash: cd: user/cloudera/wordcount: No such file or directory
[cloudera@localhost ~]$ cd user
bash: cd: user: No such file or directory
[cloudera@localhost ~]$ ^C
[cloudera@localhost ~]$


0

Hi Tim,

Try running following command to see the newly created directory:
Command: hadoop fs -ls /user/cloudera/

This will list all the files/directories under /user/cloudera inside HDFS, including the newly created wordcount directory.

Explanation:
1. "mkdir" and "hadoop fs -mkdir" : first one will create a directory in local filesystem while second one will create directory in HDFS[hadoop filesystem]
2. "ls" and "hadoop fs -ls": first will list all the files/directories of local filesystem and second will list all the files/directories in HDFS.


Hope this helps.
Happy Learning @ Dezyre !!

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password