Puppet Class: hbase
- Inherits:
- hbase::params
- Defined in:
- manifests/init.pp
Overview
Class: hbase
HBase Cluster setup.
| 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']
  }
} |