手机版
你好,游客 登录 注册
背景:
阅读新闻

Hadoop mapred-queue-acls 配置

[日期:2012-07-08] 来源:Linux社区  作者:yaoyinjie [字体:大 中 小]
Hadoop作业提交时可以指定相应的队列,例如:-Dmapred.job.queue.name=queue2
通过对mapred-queue-acls.xml和mapred-site.xml配置可以对不同的队列实现不同用户的提交权限.
先编辑mapred-site.xml,修改配置如下(增加四个队列):
  1. <property> 
  2.   <name>mapred.queue.names</name> 
  3.   <value>default,queue1,queue2,queue3,queue4</value> 
  4.   <description> Comma separated list of queues configured for this jobtracker. 
  5.     Jobs are added to queues and schedulers can configure different  
  6.     scheduling properties for the various queues. To configure a property  
  7.     for a queue, the name of the queue must match the name specified in this  
  8.     value. Queue properties that are common to all schedulers are configured  
  9.     here with the naming convention, mapred.queue.$QUEUE-NAME.$PROPERTY-NAME, 
  10.     for e.g. mapred.queue.default.submit-job-acl. 
  11.     The number of queues configured in this parameter could depend on the 
  12.     type of scheduler being used, as specified in  
  13.     mapred.jobtracker.taskScheduler. For example, the JobQueueTaskScheduler 
  14.     supports only a single queue, which is the default configured here. 
  15.     Before adding more queues, ensure that the scheduler you've configured 
  16.     supports multiple queues. 
  17.   </description> 
  18. </property> 

修改生效后通过jobtrack界面可以看到配置的队列信息:

Hadoop mapred-queue-acls 配置

要对队列进行控制, 还需要编辑mapred-queue-acls.xml文件

  1. <property> 
  2.   <name>mapred.queue.queue1.acl-submit-job</name> 
  3.   <value>' '</value> 
  4.   <description> Comma separated list of user and group names that are allowed 
  5.    to submit jobs to the 'default' queue. The user list and the group list 
  6.    are separated by a blank. For e.g. user1,user2 group1,group2. 
  7.    If set to the special value '*', it means all users are allowed to 
  8.    submit jobs. If set to ' '(i.e. space), no user will be allowed to submit 
  9.    jobs. 
  10.  
  11.    It is only used if authorization is enabled in Map/Reduce by setting the 
  12.    configuration property mapred.acls.enabled to true. 
  13.    Irrespective of this ACL configuration, the user who started the cluster and 
  14.    cluster administrators configured via 
  15.    mapreduce.cluster.administrators can submit jobs. 
  16.   </description> 
  17. </property> 

  要配置多个队列, 只需要重复添加上面配置信息,修改队列名称和value值,为方便测试,queue1禁止所有用户向其提交作业. 
   要使该配置生效, 还需要修改mapred-site.xml,将mapred.acls.enabled值设置为true

  1. <property> 
  2.   <name>mapred.acls.enabled</name> 
  3.   <value>true</value> 
  4.   <description> Specifies whether ACLs should be checked 
  5.     for authorization of users for doing various queue and job level operations. 
  6.     ACLs are disabled by default. If enabled, access control checks are made by 
  7.     JobTracker and TaskTracker when requests are made by users for queue 
  8.     operations like submit job to a queue and kill a job in the queue and job 
  9.     operations like viewing the job-details (See mapreduce.job.acl-view-job) 
  10.     or for modifying the job (See mapreduce.job.acl-modify-job) using 
  11.     Map/Reduce APIs, RPCs or via the console and web user interfaces. 
  12.   </description> 
  13. </property> 
linux
相关资讯       Hadoop部署 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款