Support Questions

Find answers, ask questions, and share your expertise

Add and start a new flume agent on a host without restart whole flume service

avatar
Expert Contributor

I use ambari and HDP.

Recently,I use flume,but I found that:

I had add a agent on flume,and it started,when I want add a new flume agent ,the config of new flume agent not appreaed on the configure,I had to restart the whole flume service.

Is there a way to add and start the new flume without restart all the flume service ??

1 ACCEPTED SOLUTION

avatar
Master Mentor

@darkz yu

Can you try to start the newly added flume agent using the Ambari APIs?

Example:

curl -u admin:admin -H "X-Requested-By: ambari" -d '{"RequestInfo":{"context":"Starting Flume agent","flume_handler":"agent","operation_level": {"level":"HOST_COMPONENT","cluster_name":"Cluster","service_name":"FLUME","host_name":"${hostname_of_new_flume_agent}"}},"Body":{"HostRoles":{"state":"STARTED"}}}' -X PUT "http://${AMBARI_HOST}:8080/api/v1/clusters/${CLUSTER_NAME}/hosts/${hostname_of_new_flume_agent}/host_components/FLUME_HANDLER"

.

Please replace the values present inside the ${} according to your environment.

View solution in original post

2 REPLIES 2

avatar
Master Mentor

@darkz yu

Can you try to start the newly added flume agent using the Ambari APIs?

Example:

curl -u admin:admin -H "X-Requested-By: ambari" -d '{"RequestInfo":{"context":"Starting Flume agent","flume_handler":"agent","operation_level": {"level":"HOST_COMPONENT","cluster_name":"Cluster","service_name":"FLUME","host_name":"${hostname_of_new_flume_agent}"}},"Body":{"HostRoles":{"state":"STARTED"}}}' -X PUT "http://${AMBARI_HOST}:8080/api/v1/clusters/${CLUSTER_NAME}/hosts/${hostname_of_new_flume_agent}/host_components/FLUME_HANDLER"

.

Please replace the values present inside the ${} according to your environment.

avatar
Expert Contributor

@Jay SenSharma

I try it and it works fine.

It should be:

curl -u ${ambari_user_name}:${ambari_user_pass} -H "X-Requested-By: ambari"-d '{"RequestInfo":{"context":"Starting Flume agent","flume_handler":"agent","operation_level": {"level":"HOST_COMPONENT","cluster_name":"${CLUSTER_NAME}","service_name":"FLUME","host_name":"${hostname_of_new_flume_agent}"}},"Body":{"HostRoles":{"state":"STARTED"}}}'-X PUT "http://${AMBARI_HOST}:8080/api/v1/clusters/${CLUSTER_NAME}/hosts/${hostname_of_new_flume_agent}/host_components/FLUME_HANDLER"

And now if I want do add a new agent ,I must change the configure on the ambari web ui ,then call the ambari server api above.

Why not make it more easy??