Puppet Class: hbase

Inherits:
hbase::params
Defined in:
manifests/init.pp

Overview

Class: hbase

HBase Cluster setup.

Parameters:

  • hdfs_hostname (Any)
  • master_hostname (Any) (defaults to: undef)
  • backup_hostnames (Any) (defaults to: undef)
  • rest_hostnames (Any) (defaults to: undef)
  • thrift_hostnames (Any) (defaults to: undef)
  • zookeeper_hostnames (Any)
  • external_zookeeper (Any) (defaults to: $hbase::params::external_zookeeper)
  • slaves (Any) (defaults to: [])
  • frontends (Any) (defaults to: [])
  • realm (Any) (defaults to: '')
  • properties (Any) (defaults to: undef)
  • descriptions (Any) (defaults to: undef)
  • features (Any) (defaults to: {})
  • acl (Any) (defaults to: undef)
  • alternatives (Any) (defaults to: '::default')
  • group (Any) (defaults to: 'users')
  • https (Any) (defaults to: undef)
  • https_keystore (Any) (defaults to: '/etc/security/server.keystore')
  • https_keystore_password (Any) (defaults to: 'changeit')
  • https_keystore_keypassword (Any) (defaults to: undef)
  • perform (Any) (defaults to: $hbase::params::perform)


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'manifests/init.pp', line 5

class hbase (
  $hdfs_hostname,
  $master_hostname = undef,
  $backup_hostnames = undef,
  $rest_hostnames = undef,
  $thrift_hostnames = undef,
  $zookeeper_hostnames,
  $external_zookeeper = $hbase::params::external_zookeeper,
  $slaves = [],
  $frontends = [],
  $realm = '',
  $properties = undef,
  $descriptions = undef,
  $features = {},
  $acl = undef,
  $alternatives = '::default',
  $group = 'users',
  $https = undef,
  $https_keystore = '/etc/security/server.keystore',
  $https_keystore_password = 'changeit',
  $https_keystore_keypassword = undef,
  $perform = $hbase::params::perform,
) inherits hbase::params {
  include stdlib

  if $hbase::realm and $hbase::realm != '' {
    $sec_properties = {
      'hadoop.security.authorization' => true,
      'hadoop.proxyuser.hbase.groups' => $hbase::group,
      'hadoop.proxyuser.hbase.hosts'  => '*',
      'hbase.security.authentication' => 'kerberos',
      'hbase.master.keytab.file' => '/etc/security/keytab/hbase.service.keytab',
      'hbase.master.kerberos.principal' => "hbase/_HOST@${hbase::realm}",
      'hbase.regionserver.keytab.file' => '/etc/security/keytab/hbase.service.keytab',
      'hbase.regionserver.kerberos.principal' => "hbase/_HOST@${hbase::realm}",
      'hbase.security.authorization' => true,
      'hbase.coprocessor.master.classes' => 'org.apache.hadoop.hbase.security.access.AccessController',
      'hbase.coprocessor.region.classes' => 'org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.AccessController',
      'hbase.security.exec.permissions.checks' => true,
      'hbase.rest.authentication.type' => 'kerberos',
      'hbase.rest.authentication.kerberos.principal' => "HTTP/_HOST@${hbase::realm}",
      'hbase.rest.authentication.kerberos.keytab' => "${hbase::hbase_homedir}/hadoop.keytab",
      'hbase.rest.keytab.file' => '/etc/security/keytab/hbase.service.keytab',
      'hbase.rest.kerberos.principal' => "hbase/_HOST@${hbase::realm}",
      'hbase.rpc.protection' => 'auth-conf',
      'hbase.rpc.engine' => 'org.apache.hadoop.hbase.ipc.SecureRpcEngine',
      'hbase.thrift.keytab.file' => '/etc/security/keytab/hbase.service.keytab',
      'hbase.thrift.kerberos.principal' => "hbase/_HOST@${hbase::realm}",
    }
  } else {
    $sec_properties = {}
  }
  if $hbase::https and $hbase::https != 'hdfs' {
    if $https_keystore_keypassword {
      $keypass = $https_keystore_keypassword
    } else {
      $keypass = $https_keystore_password
    }
    $https_properties = {
      'hadoop.ssl.enabled' => true,
      'hbase.thrift.ssl.enabled' => true,
      'hbase.thrift.ssl.keystore.store' => "${hbase::hbase_homedir}/keystore.server",
      'hbase.thrift.ssl.keystore.password' => $https_keystore_password,
      'hbase.thrift.ssl.keystore.keypassword' => $keypass,
    }
  } else {
    $https_properties = {}
  }
  if $hbase::external_zookeeper {
    $zoo_properties = {}
  } else {
    $zoo_properties = {
      'hbase.zookeeper.property.clientPort' => 2181,
      'hbase.zookeeper.property.dataDir' => '/var/lib/hbase/zookeeper',
    }
  }

  $_properties = merge($hbase::params::properties, $sec_properties, $https_properties, $zoo_properties, $properties)
  $_descriptions = merge($hbase::params::descriptions, $descriptions)

  if ($hbase::perform) {
    include hbase::install
    include hbase::config
    include hbase::service

    Class['hbase::install']
    -> Class['hbase::config']
    ~> Class['hbase::service']
    ->Class['hbase']
  }
}