Puppet Class: profile::analytics::cluster::hdfs_mount

Defined in:
modules/profile/manifests/analytics/cluster/hdfs_mount.pp

Overview

Class profile::analytic::cluster::hdfs_mount

Include a FUSE mountpoint under /mnt/hdfs to access HDFS.

Parameters:

  • monitoring_enabled (Any) (defaults to: lookup('profile::analytics::cluster::hdfs_mount::monitoring_enabled', { 'default_value' => false }))
  • kerberos_enabled (Any) (defaults to: lookup('profile::analytics::cluster::hdfs_mount::kerberos_enabled', { 'default_value' => false }))
  • monitoring_user (Any) (defaults to: lookup('profile::analytics::cluster::hdfs_mount::monitoring_user', { 'default_value' => 'analytics-privatedata' }))


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
# File 'modules/profile/manifests/analytics/cluster/hdfs_mount.pp', line 5

class profile::analytics::cluster::hdfs_mount(
    $monitoring_enabled = lookup('profile::analytics::cluster::hdfs_mount::monitoring_enabled', { 'default_value' => false }),
    $kerberos_enabled = lookup('profile::analytics::cluster::hdfs_mount::kerberos_enabled', { 'default_value' => false }),
    $monitoring_user = lookup('profile::analytics::cluster::hdfs_mount::monitoring_user', { 'default_value' => 'analytics-privatedata' }),
) {
    # Include Hadoop ecosystem client classes.
    require ::profile::hadoop::common

    # Mount HDFS via Fuse on Analytics client nodes.
    # This will mount HDFS at /mnt/hdfs read only.
    class { '::cdh::hadoop::mount': }

    if $monitoring_enabled {
        if $kerberos_enabled {
            require ::profile::kerberos::client

            # The following requires a keytab for the analytics user deployed on the host.
            $kerberos_prefix = "/usr/bin/sudo -u ${monitoring_user} ${::profile::kerberos::client::run_command_script} ${monitoring_user} "
            sudo::user { 'nagios-check_hadoop_mount_readability':
                user       => 'nagios',
                privileges => ["ALL = (${monitoring_user}) NOPASSWD: ${::profile::kerberos::client::run_command_script} ${monitoring_user} /usr/local/lib/nagios/plugins/check_mountpoint_readability ${cdh::hadoop::mount::mount_point}"],
            }
        } else {
            $kerberos_prefix = ''
        }

        file { '/usr/local/lib/nagios/plugins/check_mountpoint_readability':
            ensure => present,
            source => 'puppet:///modules/profile/analytics/check_mountpoint_readability',
            mode   => '0555',
            owner  => 'root',
            group  => 'root',
        }
        nrpe::monitor_service { 'check_hadoop_mount_readability':
            description    => 'Check if the Hadoop HDFS Fuse mountpoint is readable',
            nrpe_command   => "${kerberos_prefix}/usr/local/lib/nagios/plugins/check_mountpoint_readability ${cdh::hadoop::mount::mount_point}",
            check_interval => 30,
            retries        => 2,
            contact_group  => 'analytics',
            require        => File['/usr/local/lib/nagios/plugins/check_mountpoint_readability'],
            notes_url      => 'https://wikitech.wikimedia.org/wiki/Analytics/Systems/Cluster/Hadoop/Administration#Fixing_HDFS_mount_at_/mnt/hdfs',
        }
    }
}