cauwulixuan / hadoop_exporter

A hadoop exporter for prometheus, scrape hadoop metrics (including HDFS, YARN, MAPREDUCE, HBASE. etc.) from hadoop components jmx url.
87 stars 54 forks source link

services-api 是什么?并没有说明 #2

Open csxuyang opened 5 years ago

csxuyang commented 5 years ago

执行命令报错 [root@rhel6-140 hadoop_exporter-master]# python hadoop_exporter.py -c bigdata -hdfs http://XXX:50070/jmx usage: hadoop_exporter.py [-h] [-c cluster_name] -s services_api [-hdfs namenode_jmx_url] [-rm resourcemanager_jmx_url] [-dn datanode_jmx_url] [-jn journalnode_jmx_url] [-mr mapreduce2_jmx_url] [-nm nodemanager_jmx_url] [-hbase hbase_jmx_url] [-rs regionserver_jmx_url] [-hive hive_jmx_url] [-ld llapdaemon_jmx_url] [-p metrics_path] [-host ip_or_hostname] [-P port] hadoop_exporter.py: error: argument -s/--services-api is required

services-api 是什么?并没有说明

seawenc commented 5 years ago

同问

harshapic commented 5 years ago

Can you please let me know how to start service api.where will i get this:

-s services_api, --services-api services_api Services api to scrape each hadoop jmx url. (default "127.0.0.1:9035")

AlamBeg commented 4 years ago

Same question!! Error: hadoop_exporter.py: error: argument -s/--services-api is required Could you please let me aware whar shall i give on services-api ?

ehassan1312 commented 4 years ago

I got the same error . how to set services-api ?

wtx626 commented 4 years ago

how to set services-api ?

AlamBeg commented 4 years ago

I have changed the code of hadoop_exporter.py. As you can see below steps.

step1: I wrote a function while will bypass service-api and will work for all exporter step2: function:

def direct_call(): datanode_flag = 1 if datanode_flag: datanode_url = "http://10.0.5.1:50075/jmx" logger.info("datanode_url = {0}, start to register".format(datanode_url)) cluster = "hadoop" REGISTRY.register(DataNodeMetricCollector(cluster, datanode_url)) datanode_flag = 0 else: logger.error("No service running in THIS node")

step3: Modified on calling the main function as below

def main(): try: args = utils.parse_args() address = args.address port = int(args.port) rest_url = args.services_api register_consul(address, port) direct_call() register_prometheus(rest_url) except Exception as e: logger.info('Error happened, msg: %s'%e) else: pass

if name == "main": main()

step: I will upload my modified code on my github link. https://github.com/AlamBeg/Hadoop_Metrics_Exporter

AlamBeg commented 4 years ago

There are other good ways to export all Hadoop metrics which i will update on my GitLab link very soon. Thanks Alam

luckercs commented 4 years ago

services-api 是什么??

AlamBeg commented 4 years ago

services-api 是什么??

service-api is not required. Just comment this line rest_url = args.services_api on hadoop_exporter.py . I will modify these all framework and share with you all guys very soon.