Puppet Class: profile::hive::site_hdfs

Defined in:
modules/profile/manifests/hive/site_hdfs.pp

Overview

Class profile::hive::site_hdfs

Ensures latest /etc/hive/conf/hive-site.xml is in hdfs

TODO: it would be much better if we had a nicer define or puppet function that would allow us to manage files in HDFS like we do in the regular filesystem. If we figure that out, we can replace this class and also the analytics_cluster::mysql_password class.

Parameters:

  • use_kerberos (Any) (defaults to: hiera('profile::hive::site_hdfs::use_kerberos', false))


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'modules/profile/manifests/hive/site_hdfs.pp', line 10

class profile::hive::site_hdfs (
    $use_kerberos = hiera('profile::hive::site_hdfs::use_kerberos', false),
){
    Class['cdh::hive'] -> Class['profile::hive::site_hdfs']

    $hdfs_path = '/user/hive/hive-site.xml'
    # Put /etc/hive/conf/hive-site.xml in HDFS whenever puppet
    # notices that it has changed.
    cdh::exec { 'put-hive-site-in-hdfs':
        command      => "/usr/bin/hdfs dfs -put -f ${cdh::hive::config_directory}/hive-site.xml ${hdfs_path} && /usr/bin/hdfs dfs -chmod 644 ${hdfs_path} && /usr/bin/hdfs dfs -chown hdfs:hdfs ${hdfs_path}",
        user         => 'hdfs',
        refreshonly  => true,
        subscribe    => File["${cdh::hive::config_directory}/hive-site.xml"],
        use_kerberos => $use_kerberos,
    }
}