See inline comment.
Diff comments:
>
> === modified file 'hooks/callbacks.py'
> --- hooks/callbacks.py 2015-08-13 21:19:50 +0000
> +++ hooks/callbacks.py 2015-08-24 15:15:23 +0000
> @@ -74,3 +87,31 @@
>
> def clear_active_flag():
> unitdata.kv().set('charm.active', False)
> +
> +
> +def conf_ganglia_metrics(purgeConf=False):
> + """
> + Send hadoop specific metrics to a ganglia server
> + """
> + config = hookenv.config()
> + ganglia_metrics = config['ganglia_metrics'] and not purgeConf
> + ganglia_metrics_changed = ganglia_metrics !=
> unitdata.kv().get('ganglia_metrics', False)
> + unitdata.kv().set('ganglia_metrics', ganglia_metrics)
> + comment = '#' if not ganglia_metrics else ''
> + ganglia_host = 'UNSET_BY_JUJU' if not ganglia_metrics else
> Ganglia().host()
> + ganglia_sink_str = comment +
> '*.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31'
> + hookenv.log("Configuring ganglia sink in
> /etc/hadoop/conf/hadoop-metrics2.properties", level=None)
> + render(
> + source='hadoop-metrics2.properties.j2',
> + target='/etc/hadoop/conf/hadoop-metrics2.properties',
> + context={
> + 'ganglia_host': ganglia_host,
> + 'ganglia_sink_str': ganglia_sink_str,
> + },
> + ),
> + if ganglia_metrics_changed:
> + #check_call(['actions/restart-hdfs'])
> + # IMPLEMENT RESTART COMPUTE SLAVE?
I believe this would be handled by the hdfs/yarn-master restarts and shouldn't
be done by the slave.
> + hookenv.log("please manually restart compute slave hadoop
> components", level=None)
> +
> +purge_ganglia_metrics = partial(conf_ganglia_metrics, purgeConf=True)
--
https://code.launchpad.net/~bigdata-dev/charms/trusty/apache-hadoop-compute-slave/ganglia_metrics/+merge/268539
Your team Juju Big Data Development is requested to review the proposed merge
of lp:~bigdata-dev/charms/trusty/apache-hadoop-compute-slave/ganglia_metrics
into lp:~bigdata-dev/charms/trusty/apache-hadoop-compute-slave/trunk.
--
Mailing list: https://launchpad.net/~bigdata-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~bigdata-dev
More help : https://help.launchpad.net/ListHelp