Skip to content

Commit

Permalink
Auto fetching of Hadoop GID and mapred UID
Browse files Browse the repository at this point in the history
Instead of keeping hard coded values of hadoop group and mapred user,
this patch adds the feature of fetching the values from the node
itself.

Signed-off-by: Shashank Sahni <[email protected]>
  • Loading branch information
shredder12 committed Oct 26, 2013
1 parent 11c9693 commit 68fcb52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion multistack/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

SSH_ATTEMPTS = 10
SSH_TIMEOUT = 60
INSTANCE_TIMEOUT = 120
INSTANCE_TIMEOUT = 120
UMASK='0022'
8 changes: 3 additions & 5 deletions multistack/services/run.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from multistack.services.remote import Remote

HADOOP_GID='123'
HDFS_UID='201'
MAPRED_UID='202'
UMASK='0022'
from multistack.constants import *

def setup_s3fs(credentials, remote):
"""
Expand Down Expand Up @@ -38,6 +34,8 @@ def mount_bucket(bucket, remote):
@type remote: remote.Remote instance
"""

MAPRED_UID = remote.sudo("id -u mapred")
HADOOP_GID = remote.sudo("grep -i hadoop /etc/group | cut -d ':' -f 3")
remote.sudo("mkdir /media/{0}".format(bucket))
remote.sudo("chown root:hadoop -R /media/{0}".format(bucket))
remote.sudo("chmod 775 -R /media/{0}".format(bucket))
Expand Down

0 comments on commit 68fcb52

Please sign in to comment.