Hadoop Ganglia恶搞不';向gmond发送数据时无法工作

Hadoop Ganglia恶搞不';向gmond发送数据时无法工作,hadoop,spoofing,ganglia,Hadoop,Spoofing,Ganglia,我正在使用ganglia 3.6.0进行监视。我有一个应用程序,可以收集、聚合集群中所有主机的一些指标。然后它把它们送到格蒙德。应用程序在主机1上运行 这里的问题是,当设置spoof=false时,ganglia最终认为这只是来自host1的度量。事实上,这些度量是由host1生成的,但适用于集群中的所有主机 但是当设置spoof=true时,我希望gmond会接受我指定的主机名。但它根本不接受这些标准。事件度量未显示在主机1上 我使用的代码是从GangliaSink(来自hadoop comm

我正在使用ganglia 3.6.0进行监视。我有一个应用程序,可以收集、聚合集群中所有主机的一些指标。然后它把它们送到格蒙德。应用程序在主机1上运行

这里的问题是,当设置spoof=false时,ganglia最终认为这只是来自
host1
的度量。事实上,这些度量是由
host1
生成的,但适用于集群中的所有主机

但是当设置spoof=true时,我希望gmond会接受我指定的主机名。但它根本不接受这些标准。事件度量未显示在主机1上

我使用的代码是从GangliaSink(来自hadoop common)复制的,它应用了Ganglia 3.1x格式

xdr_int(128);               // metric_id = metadata_msg
xdr_string(getHostName());       // hostname
xdr_string(name);           // metric name
xdr_int(1);                 // spoof = True
xdr_string(type);           // metric type
xdr_string(name);           // metric name
xdr_string(gConf.getUnits());    // units
xdr_int(gSlope.ordinal());  // slope
xdr_int(gConf.getTmax());        // tmax, the maximum time between metrics
xdr_int(gConf.getDmax());        // dmax, the maximum data value
xdr_int(1);                 /*Num of the entries in extra_value field for 
                              Ganglia 3.1.x*/
xdr_string("GROUP");        /*Group attribute*/
xdr_string(groupName);      /*Group value*/

// send the metric to Ganglia hosts
emitToGangliaHosts();

// Now we send out a message with the actual value.
// Technically, we only need to send out the metadata message once for
// each metric, but I don't want to have to record which metrics we did and
// did not send.
xdr_int(133);         // we are sending a string value
xdr_string(getHostName()); // hostName
xdr_string(name);     // metric name
xdr_int(1);           // spoof = True
xdr_string("%s");     // format field
xdr_string(value);    // metric value

// send the metric to Ganglia hosts
emitToGangliaHosts();

我确实为每个指标指定了主机名。但它似乎没有被gmond使用/识别

解决了这个问题。。。主机名格式问题。格式需要类似于
ip:hostname
,例如
1.2.3.4:host0000001
或任何
string:string
都可以:-)