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 05-24-2018 11:40 AM
I have read many documents and implements many solutions. I have made directory as `<user_name>` by following commands and gave ownership and permission to the folder as HDFS user.
[root@sandbox ~]# su hdfs [hdfs@sandbox root]$ hdfs dfs -mkdir /user/tempuser [hdfs@sandbox root]$ hdfs dfs -chown tempuser:hdfs /user/tempuser [hdfs@sandbox root]$ hdfs dfs -chmod 700 /user/tempuser [hdfs@sandbox root]$ su tempuser su: user tempuser does not exist [hdfs@sandbox root]$
But is throwing error as user <username> does not exist.
Please help me to resolve it.
Regards,
Jay.
Created 05-24-2018 12:18 PM
The above code snippet is for creating a user's home directory in HDFS.
You will need to create the local Linux user, to do so a root or if you have sudo privileges do the following
# useradd tempuser
To set the password, you will be prompted twice
# passwd tempuser
Using sudo privileges
$ sudo useradd tempuser
See aabove
$ sudo passwd tempuser
This will also create a user home on the local Linux box in /home/tempuser this is different from the hdfs user home /user/tempuser with MUST exst if the tempuser is to run and hive queries etc
Hope that helps
Created 05-24-2018 12:18 PM
The above code snippet is for creating a user's home directory in HDFS.
You will need to create the local Linux user, to do so a root or if you have sudo privileges do the following
# useradd tempuser
To set the password, you will be prompted twice
# passwd tempuser
Using sudo privileges
$ sudo useradd tempuser
See aabove
$ sudo passwd tempuser
This will also create a user home on the local Linux box in /home/tempuser this is different from the hdfs user home /user/tempuser with MUST exst if the tempuser is to run and hive queries etc
Hope that helps
Created 05-24-2018 12:53 PM
Is it for CentOS? Because I am using Hortonworks Sandbox on Oracle Virtual Machine.
Created 05-24-2018 01:30 PM
Yes that okay the same commands will work
Created 05-25-2018 08:17 AM
Thank you @Geoffrey Shelton Okot It helps.
Actually, I was thinking it will create a user in CentOS only. But It has created a user in HDFS as well.
Created 05-24-2018 01:39 PM
I'm just curious. Why do hive jobs need the home directory to run the job?
Created 05-24-2018 01:54 PM
Hive jobs need a temporary working directory where hiveJars used during the execution are temporarily stored. See example
$ hdfs dfs -ls /user/hive Found 3 items drwx------ - hive hdfs 0 2018-04-25 20:00 /user/hive/.Trash drwxr-xr-x - hive hdfs 0 2018-04-13 23:04 /user/hive/.hiveJars -rw-r--r-- 3 hive hdfs 642 2018-05-24 08:43 /user/hive/derby.log $ hdfs dfs -ls /user/hive/.hiveJars Found 1 items -rw-r--r-- 3 hive hdfs 22006904 2018-04-13 23:04 /user/hive/.hiveJars/hive-exec-1.2.1000.2.6.2.0-205-79292bba9a3e076ad6d7a33c604b892fa0d45f6f60ae07a507e5e659a297f665.jar
Hope that helps explain
Created 05-24-2018 01:55 PM
If you found this answer addressed your question, please take a moment to log in and click the "accept" link on the answer.