Puppet Class: cdh::hive::server

Defined in:
modules/cdh/manifests/hive/server.pp

Overview

Class cdh::hive::server

Configures hive-server2. Requires that cdh::hadoop is included so that hadoop-client is available to create hive HDFS directories.

See: www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/CDH5-Installation-Guide/cdh5ig_hiveserver2_configure.html

Parameters

$port - Port on which hive-server2 listens. Default: undef $use_kerberos - Use kerberos auth to create HDFS directories.

Parameters:

  • port (Any) (defaults to: undef)
  • use_kerberos (Any) (defaults to: false)


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
# File 'modules/cdh/manifests/hive/server.pp', line 11

class cdh::hive::server(
    $port             = undef,
    $use_kerberos     = false,
)
{
    # cdh::hive::server requires hadoop client and configs are installed.
    Class['cdh::hadoop'] -> Class['cdh::hive::server']
    Class['cdh::hive']   -> Class['cdh::hive::server']

    package { 'hive-server2':
        ensure => 'installed',
        alias  => 'hive-server',
    }

    # sudo -u hdfs hdfs dfs -mkdir /user/hive
    # sudo -u hdfs hdfs dfs -chmod 0775 /user/hive
    # sudo -u hdfs hdfs dfs -chown hive:hadoop /user/hive
    cdh::hadoop::directory { '/user/hive':
        owner        => 'hive',
        group        => 'hadoop',
        mode         => '0775',
        use_kerberos => $use_kerberos,
        require      => Package['hive'],
    }
    # sudo -u hdfs hdfs dfs -mkdir /user/hive/warehouse
    # sudo -u hdfs hdfs dfs -chmod 1777 /user/hive/warehouse
    # sudo -u hdfs hdfs dfs -chown hive:hadoop /user/hive/warehouse
    cdh::hadoop::directory { '/user/hive/warehouse':
        owner        => 'hive',
        group        => 'hadoop',
        mode         => '1777',
        use_kerberos => $use_kerberos,
        require      => Cdh::Hadoop::Directory['/user/hive'],
    }

    service { 'hive-server2':
        ensure     => 'running',
        require    => [
            Package['hive-server2'],
            Cdh::Hadoop::Directory['/user/hive/warehouse'],
        ],
        hasrestart => true,
        hasstatus  => true,
    }
}