OSDN Git Service

add .envrc
[metasearch/grid-chef-repo.git] / roles / hadoop-pleiades-with-security.rb
1 name 'hadoop-pleiades-with-security'
2 description 'Pleiades Hadoop cluster node with security'
3
4 run_list(
5   'role[node_commons]',
6   'role[nameservice-client-grid]',
7   'role[hadoop]',
8   'role[jce_policy]'
9 )
10
11 #env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []
12
13 grid_etc_root = '/grid/etc'
14 grid_vol_root = '/grid/vol'
15 cluster_name = 'pleiades'
16 hadoop_attributes = {
17   'with_security' => true,
18   # hadoop-env.sh
19   'HADOOP_CLASSPATH' => '/usr/share/java/commons-daemon.jar',
20   'HADOOP_USER_CLASSPATH_FIRST' => true,
21   # core-site.xml
22   'this.cluster.name' => cluster_name, 
23   'this.domain' => 'grid.example.com',
24   'this.realm' => 'GRID.EXAMPLE.COM',
25   'this.keytab.dir' => "#{grid_etc_root}/keytabs/#{cluster_name}",
26   'this.namenode.fqdn' => '${this.cluster.name}-nn.${this.domain}',
27   'fs.checkpoint.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/checkpoint",
28   #'fs.checkpoint.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/checkpoint,/export/home/${user.name}/var/lib/checkpoint",
29   'hadoop.http.authentication.kerberos.principal' => 'HTTP/${this.fqdn}@${this.realm}',
30   'hadoop.proxyuser' => {
31     'oozie' => {
32       'hosts' => '${this.cluster.name}-wf.${this.domain},wf00.${this.domain},wf01.${this.domain}',
33       'groups' => 'hadoopers'
34     },
35     'httpfs' => {
36       'hosts' => '${this.cluster.name}-pxy.${this.domain},pxy00.${this.domain},pxy01.${this.domain}',
37       'groups' => 'hadoopers'
38     }
39   },
40   # hdfs-site.xml
41   'this.secondary.namenode.fqdn' => '${this.cluster.name}-cn.${this.domain}',
42   'dfs.name.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/name",
43   #'dfs.name.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/name,/export/home/${user.name}/var/lib/name",
44   'dfs.datanode.kerberos.principal' => 'hdfs/_HOST@${this.realm}',
45   'dfs.replication' => '2',
46   #'dfs.replication' => '3',
47   # mapred-site.xml
48   'this.jobtracker.fqdn' => '${this.cluster.name}-jt.${this.domain}',
49   'this.jobhistory.fqdn' => '${this.cluster.name}-jt.${this.domain}',
50   #'this.jobhistory.fqdn' => '${this.cluster.name}-jh.${this.domain}',
51   'mapreduce.tasktracker.kerberos.principal' => 'mapred/_HOST@${this.realm}'
52 }
53
54 #default_attributes
55
56 override_attributes(
57   'grid' => {
58     'etc_root' => grid_etc_root,
59     'vol_root' => grid_vol_root,
60     'max_vol_nums' => '4'
61   },
62   'hadoop' => hadoop_attributes
63 )
64