Puppet Class: cdh::hadoop::jmxtrans::nodemanager

Defined in:
modules/cdh/manifests/hadoop/jmxtrans/nodemanager.pp

Overview

Class cdh::hadoop::jmxtrans::nodemanager

Sets up a jmxtrans instance for a Hadoop NodeManager running on the current host. Note: This requires the jmxtrans puppet module found at github.com/wikimedia/puppet-jmxtrans.

Parameters

$jmx_port - NodeManager JMX port. Default: 9983 $ganglia - Ganglia host:port $graphite - Graphite host:port $statsd - statsd host:port $outfile - outfile to which Kafka stats will be written. $objects - objects parameter to pass to jmxtrans::metrics. Only use

this if you need to override the default ones that this
class provides.

Usage

class { 'cdh::hadoop::jmxtrans::nodemanager':

ganglia => 'ganglia.example.org:8649'

}

Parameters:

  • jmx_port (Any) (defaults to: 9984)
  • ganglia (Any) (defaults to: undef)
  • graphite (Any) (defaults to: undef)
  • statsd (Any) (defaults to: undef)
  • outfile (Any) (defaults to: undef)
  • objects (Any) (defaults to: undef)


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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'modules/cdh/manifests/hadoop/jmxtrans/nodemanager.pp', line 22

class cdh::hadoop::jmxtrans::nodemanager(
    $jmx_port       = 9984,
    $ganglia        = undef,
    $graphite       = undef,
    $statsd         = undef,
    $outfile        = undef,
    $objects        = undef,
) {
    $jmx = "${::fqdn}:${jmx_port}"
    $group_name = 'Hadoop.NodeManager'

    # query for metrics from Hadoop DataNode's JVM
    jmxtrans::metrics::jvm { 'hadoop-hdfs-nodemanager':
        jmx          => $jmx,
        group_prefix => "${group_name}.",
        outfile      => $outfile,
        ganglia      => $ganglia,
        graphite     => $graphite,
        statsd       => $statsd,
    }


    $nodemanager_objects = $objects ? {
        # if $objects was not set, then use this as the
        # default set of JMX MBean objects to query.
        undef   => [
            {
                'name'          => 'Hadoop:name=JvmMetrics,service=NodeManager',
                'resultAlias'   => "${group_name}.JvmMetrics",
                'attrs'         => {
                    'GcCount'                       => { 'slope' => 'positive' },
                    'GcCountPS MarkSweep'           => { 'slope' => 'positive' },
                    'GcCountPS Scavenge'            => { 'slope' => 'positive' },
                    'GcTimeMillis'                  => { 'slope' => 'both' },
                    'GcTimeMillisPS MarkSweep'      => { 'slope' => 'both' },
                    'GcTimeMillisPS Scavenge'       => { 'slope' => 'both' },
                    'LogError'                      => { 'slope' => 'positive' },
                    'LogFatal'                      => { 'slope' => 'positive' },
                    'LogInfo'                       => { 'slope' => 'both' },
                    'LogWarn'                       => { 'slope' => 'positive' },
                    'MemHeapCommittedM'             => { 'slope' => 'both' },
                    'MemHeapUsedM'                  => { 'slope' => 'both' },
                    'MemNonHeapCommittedM'          => { 'slope' => 'both' },
                    'MemNonHeapUsedM'               => { 'slope' => 'both' },
                    'ThreadsBlocked'                => { 'slope' => 'both' },
                    'ThreadsNew'                    => { 'slope' => 'both' },
                    'ThreadsRunnable'               => { 'slope' => 'both' },
                    'ThreadsTerminated'             => { 'slope' => 'both' },
                    'ThreadsTimedWaiting'           => { 'slope' => 'both' },
                    'ThreadsWaiting'                => { 'slope' => 'both' },
                },

            },
            {
                'name'          => 'Hadoop:name=NodeManagerMetrics,service=NodeManager',
                'resultAlias'   => "${group_name}.NodeManagerMetrics",
                'attrs'         => {
                    'AllocatedContainers'           => { 'slope' => 'both' },
                    'AllocatedGB'                   => { 'slope' => 'both' },
                    'AvailableGB'                   => { 'slope' => 'both' },
                    'ContainersCompleted'           => { 'slope' => 'positive' },
                    'ContainersFailed'              => { 'slope' => 'positive' },
                    'ContainersIniting'             => { 'slope' => 'both' },
                    'ContainersKilled'              => { 'slope' => 'positive' },
                    'ContainersLaunched'            => { 'slope' => 'positive' },
                    'ContainersRunning'             => { 'slope' => 'both' },
                },
            },

            {
                'name' =>          'Hadoop:name=RpcActivityForPort8040,service=NodeManager',
                'resultAlias'   => "${group_name}.RpcActivityForPort8040",
                'attrs'         => {
                    'CallQueueLength'               => { 'slope' => 'both' },
                    'NumOpenConnections'            => { 'slope' => 'both' },
                    'ReceivedBytes'                 => { 'slope' => 'positive' },
                    'RpcAuthenticationFailures'     => { 'slope' => 'positive' },
                    'RpcAuthenticationSuccesses'    => { 'slope' => 'positive' },
                    'RpcAuthorizationFailures'      => { 'slope' => 'positive' },
                    'RpcAuthorizationSuccesses'     => { 'slope' => 'positive' },
                    'RpcProcessingTimeAvgTime'      => { 'slope' => 'both' },
                    'RpcProcessingTimeNumOps'       => { 'slope' => 'positive' },
                    'RpcQueueTimeAvgTime'           => { 'slope' => 'both' },
                    'RpcQueueTimeNumOps'            => { 'slope' => 'positive' },
                    'SentBytes'                     => { 'slope' => 'positive' },
                },
            },

            {
                'name' =>          'Hadoop:name=RpcActivityForPort8041,service=NodeManager',
                'resultAlias'   => "${group_name}.RpcActivityForPort8041",
                'attrs'         => {
                    'CallQueueLength'               => { 'slope' => 'both' },
                    'NumOpenConnections'            => { 'slope' => 'both' },
                    'ReceivedBytes'                 => { 'slope' => 'both' },
                    'RpcAuthenticationFailures'     => { 'slope' => 'both' },
                    'RpcAuthenticationSuccesses'    => { 'slope' => 'both' },
                    'RpcAuthorizationFailures'      => { 'slope' => 'both' },
                    'RpcAuthorizationSuccesses'     => { 'slope' => 'both' },
                    'RpcProcessingTimeAvgTime'      => { 'slope' => 'both' },
                    'RpcProcessingTimeNumOps'       => { 'slope' => 'positive' },
                    'RpcQueueTimeAvgTime'           => { 'slope' => 'both' },
                    'RpcQueueTimeNumOps'            => { 'slope' => 'positive' },
                    'SentBytes'                     => { 'slope' => 'positive' },
                },
            },

            {
                'name' =>          'Hadoop:name=RpcDetailedActivityForPort8041,service=NodeManager',
                'resultAlias'   => "${group_name}.RpcDetailedActivityForPort8041",
                'attrs'         => {
                    'StartContainerAvgTime'         => { 'slope' => 'both' },
                    'StartContainerNumOps'          => { 'slope' => 'positive' },
                    'StopContainerAvgTime'          => { 'slope' => 'both' },
                    'StopContainerNumOps'           => { 'slope' => 'positive' },

                },
            },

            {
                'name' =>          'Hadoop:name=ShuffleMetrics,service=NodeManager',
                'resultAlias'   => "${group_name}.ShuffleMetrics",
                'attrs'         => {
                    'ShuffleConnections'            => { 'slope' => 'both' },
                    'ShuffleOutputBytes'            => { 'slope' => 'positive' },
                    'ShuffleOutputsFailed'          => { 'slope' => 'positive' },
                    'ShuffleOutputsOK'              => { 'slope' => 'positive' },
                },
            },

        ],

        # else use $objects
        default => $objects,
    }

    # query for jmx metrics
    jmxtrans::metrics { "hadoop-yarn-nodemanager-${::hostname}-${jmx_port}":
        jmx                  => $jmx,
        outfile              => $outfile,
        ganglia              => $ganglia,
        ganglia_group_name   => $group_name,
        graphite             => $graphite,
        graphite_root_prefix => $group_name,
        statsd               => $statsd,
        statsd_root_prefix   => $group_name,
        objects              => $nodemanager_objects,
    }
}