Creating Multiple Users in Hadoop Cluster

What happens if we share same user among multiple users?


If we share same hadoop user account among multiple users then we suffer from following problems
- Difficult to trace the jobs and track the tasks/defects done by each user
- Shared account arriase security issue.
- If all are given the same user account, all users will have the same privilege and all can
access everyone’s data, can modify it, can perform execution, can delete it also.

What are the benefits of creating multiple users?


  • The directories/files of one user cannot be modified by other user.
  • Other users cannot add new files to a user’s directory.
  • Other users cannot perform any tasks (mapreduce etc) on a user’s files.

Steps for setting up multiple User Accounts


[1] Create a New User

 Ubuntu: $ sudo  adduser  --ingroup   <groupname>   <username>
 Redhat: $ useradd  -g <groupname>   <username>
 All: $ passwd <username>


[2] Chanage permission of hadoop temp directory

Change the permission of a directory in HDFS where hadoop stores its temporary data.
Find that directory by looking entry hadoop.tmp.dir into core-site.xml
Then from the superuser account do the following step.

$ hadoop fs –chmod -R  1777 /path/to/hadoop/tmp/directory


[3] Give write access to hadoop temp directory in user machine

The next step is to give write permission to our user group on hadoop.tmp.dir. Open core-site.xml to get the path for hadoop.tmp.dir. This should be done only in the machine(node) where the new user is added.

$ chmod 777 /path/to/hadoop/tmp/dirctory


[4] Create user home directory in HDFS

The next step is to create a directory structure in HDFS for the new user.
For that from the superuser, create a directory structure.

$ hadoop  fs –mkdir /user/username/


[5] Change the ownership of user home directory in HDFS

The ownership of the newly created directory structure is with superuser.With this new user
will not be able to run mapreduce programs. So change the ownership of newly created directory in HDFS to the new user.

$ hadoop  fs –chown –R username:groupname   <directory to access in HDFS>

Eg: hadoop fs –chown –R username:groupname  /user/username/


[6] Now run jobs with new user

Login with new user and run jobs

$ su - newuser
$ bin/hadoop jar pathToJar.jar mainClass input/path output/path

58 comments

Thank for sharing this great Hadoop tutorials Blog post. I will use your command when upgrade hadoop.
Hadoop Training in hyderabad

hi guys,Thanks for your sharing i have to very useful for the your information.Thanks a lot.
Hadoop Training in Chennai

Hadoop Developer online training| Hadoop Developer ...
www.21cssindia.com/courses/hadoop-online-training-182.html
hadoop developer online training, hadoop developer training, hadoop developer course contents, hadoop developer, hadoop developer enquiry, hadoop ...Many more… | Call Us +917386622889
Visit: http://www.21cssindia.com/courses.html

$ hadoop fs –chmod -R 1777 /path/to/hadoop/tmp/directory is not working for me. I am using apache hadoop 1.2.0.

I am getting the following.
[haas@ip-10-251-34-217 ~]$ hadoop fs -chmod -R 1777 /tmp/
chmod: chmod : mode '1777' does not match the expected pattern.

Please suggest me any idea. Thanks.

I don't think there was a Apache Hadoop version 1.2.0. So from where you took that hadoop.

Better to use hadoop release 0.20.* or above

This comment has been removed by the author.

Hi,
Thanks for providing information hadoop training provides by the online with ral time experts on
hadoop online training

Hi,
Thanks for nice information and best online trainers providing hadoop online training

This information which you provided is very much useful for us.It was very interesting and useful for hadoop online training.We also providing qa online training institute in USA.

It was really a nice article and I was really impressed by reading this article. We are also giving all software Course Online Training. The Hadoop Online Training is one of the leading Online Training institute in the world.

ya i had set the path initially. actually i created user called hduser and from that user i installed hadoop.now if i run the chmod command its showing “chmod: Unknown command
Usage: java FsShell ………….”
some syntax it will show and in last line its showing
“The general command line syntax is
bin/hadoop command [genericOptions] [commandOptions] ”
so i used the command bin/ hadoop fs –chmod -R 1777 /app/hadoop/tmp/
now is showing
bash: bin/hadoop: No such file or directory
what exactly wrong i did can u have any idea???
please help me

Hadoop Developer --- "
Big Data (Hadoop) Developer Online Training
Send ur Enquiry to contact@21cssindia.com
Understanding Big Data
Introduction/Installation - Hadoop Custom VM(Single Node)
Understanding Big Data
3V (Volume-Variety-Velocity) Characteristics
Structured and Unstructured Data
Application and use cases of Big Data" more… Online Training- Corporate Training- IT Support U Can Reach Us On +917386622889 - +919000444287 http://www.21cssindia.com/courses/hadoop-online-training-182.html

I see this content as a Unique and very informative article. Impressive article like this may help many like me in finding the best Hadoop Training in Chennai and there finding the best hadoop training institute in chennai

Thanks for sharing... Actually Hadoop is a highly growing & scoopful technology in IT market it’s an open-source software framework for managing big data in a distributed fashion on large commodity computing hardware. FITA provides Hadoop training in Chennai get in to fita and out with your career.

Nice article i was really impressed by seeing this article, it was very interesting and it is very useful for me.I get a lot of great information from this blog. Thank you for your sharing this informative blog.Hybris Training | Hybris Online Training

Thanks for your support, i am very interested in learning Hadoop.. If you want more details on HADOOP BIGDATA
just go through this link.....http://www.tekclasses.com/courses/hadoop/

Oracle DBA Training in Chennai
Thanks for sharing this informative blog. I did Oracle DBA Certification in Greens Technology at Adyar. This is really useful for me to make a bright career..

Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..
Websphere Training in Chennai

Data warehousing Training in Chennai
I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly..

Selenium Training in Chennai
Wonderful blog.. Thanks for sharing informative blog.. its very useful to me..

Oracle Training in chennai
Thanks for sharing such a great information..Its really nice and informative..

SAP Training in Chennai
This post is really nice and informative. The explanation given is really comprehensive and informative..

This information is impressive..I am inspired with your post writing style & how continuously you describe this topic. After reading your post,thanks
for taking the time to discuss this, I feel happy about it and I love learning more about this topic
Android Training In Chennai In Chennai

Pretty article! I found some useful information in your blog, it was awesome to read,thanks for sharing this great content to my vision, keep sharing..
Unix Training In Chennai

I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
SalesForce Training in Chennai

I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
SalesForce Training in Chennai

I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
SalesForce Training in Chennai

There are lots of information about latest technology and how to get trained in them, like Best Hadoop Training In Chennai in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will
make me to get trained in future technologies Hadoop Training in Chennai By the way you are running a great blog. Thanks for sharing this blogs..

This is really an awesome article. Thank you for sharing this.It is worth reading for everyone. Visit us:
Oracle Training in Chennai

very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
Oracle DBA Training in Chennai

great article!!!!!This is very importent information for us.I like all content and information.I have read it.You know more about this please visit again.
Oracle RAC Training in Chennai

Wonderful tips, very helpful well explained. Your post is definitely incredible. I will refer this to my friend.
SalesForce Training in Chennai

I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
Java Training in Chennai

Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
PHP Training in Chennai

Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.Nice article i was really impressed by seeing this article, it was very interesting and it is very useful for me..
Android Training in Chennai

Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
SAP Training in Chennai

Excellent information with unique content and it is very useful to know about the information based on blogs.
Hadoop Training in Chennai

It is really very helpful for us and I have gathered some important information from this blog.If anyone wants to Selenium Training in Chennai reach Greens Technology training and placement academy.
selenium Training in Chennai

Information which you provided on Hadoop Online Training is so impressive

Rajasthan Gram Panchayat 2252 Sathin Recruitment 2015-16

This is awesome blog with smart content, Nice to see your post. Thanks.....

Latest Govt JObs 2016


Very efficiently written post. It will be valuable to anybody who employees it, including myself. Keep up the good work...................

Thanks for sharing this information .You may also refer http://www.s4techno.com/hadoop-training-in-pune/

Freelance Best Makeup & Hair Artist in Jaipur with huge experience and Specialization in Bridal and Wedding Makeup,Celebrity Makeup,Professional Makeup,Creative Makeup,Bollywood Makeup and Character Makeup in Delhi,Jaipur,Rajasthan. Natural Makeup that allows your skin to breath with a radiant glow and remains flawless throughout your special day.


Best Makeup and Hairstyle in jaipur
Fiza Makeup Academy in jaipur
Best bridal makeup artist in jaipur(bollywood makeup,creative makeup,Airbrush makeup,character makeup)
Make up and Hair kit
Professional makeup artist course in jaipur
Makeup and hairstyle tips
Makeup and hair Images
Makeup and hair tutorials
Makeup and hair contract


I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon...
Software Testing Training in Chennai

Freelance Best Makeup & Hair Artist in Jaipur with huge experience and Specialization in Bridal and Wedding Makeup,Celebrity Makeup,Professional Makeup,Creative Makeup,Bollywood Makeup and Character Makeup in Delhi,Jaipur,Rajasthan. Natural Makeup that allows your skin to breath with a radiant glow and remains flawless throughout your special day.
Best makeup and hairstyle in jaipur
Fiza makeup academy in jaipur
Best bridal makeup artist in jaipur(bollywood makeup,creative makeup,Airbrush makeup,character makeup)
Make up and Hair kit
Professional makeup artist course in jaipur
Fiza Makeup and hairstyle tips
Fiza Makeup and hair Images
Fiza Makeup and hair tutorials
Fiza Makeup and hair contract


It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai