Created 12-01-2015 07:09 AM
Suppose executed a bulk operation through Amabri UI e.g. "Start All Services" .
The requirement is -
I want to export the complete log of this operation for further analysis
One way is to find all hosts impacted by this operation , get the sub tasks executed on each hosts and then loop through them and get the logs and merge them
Is there a more simple way of getting all logs for a bulk operation done through ambari
Created 12-01-2015 09:15 AM
@pankaj singh Another option would be to get the log files directly from the individual nodes.
For example, use the following request to get all the task information for a request:
http://horton01.example.com:8080/api/v1/clusters/bigdata/requests/111?fields=*,tasks/Tasks/request_i...
The response looks something like this =>
"tasks" : [ { "Tasks" : { "command" : "CUSTOM_COMMAND", "command_detail" : "RESTART MAPREDUCE2/MAPREDUCE2_CLIENT", "host_name" : "horton01.example.com", "id" : 1157, "request_id" : 111, "role" : "MAPREDUCE2_CLIENT", "status" : "COMPLETED" } }, { "Tasks" : { "command" : "CUSTOM_COMMAND", "command_detail" : "RESTART MAPREDUCE2/HISTORYSERVER", "host_name" : "horton02.example.com", "id" : 1158, "request_id" : 111, "role" : "HISTORYSERVER", "status" : "COMPLETED" } },
The import parts are the id and the host_name
Now you can log into the host and retrieve the error and output logfile from:
For Example on host horton02.example.com:
Note: You might also be able to get the request and tasks ids from the Ambari Database.
Created 12-01-2015 08:24 AM
+ @Paul Codding and @bdurai
Once Logsearch is available you should be able to do this pretty easily from Logsearch UI because you can view all log messages across all components for the specific time window you are interested in (and filter by error level, include/exclude substrings etc). You can try a development version of it using steps here
Created 12-01-2015 08:58 AM
Awesome project 🙂
Created 12-01-2015 09:15 AM
@pankaj singh Another option would be to get the log files directly from the individual nodes.
For example, use the following request to get all the task information for a request:
http://horton01.example.com:8080/api/v1/clusters/bigdata/requests/111?fields=*,tasks/Tasks/request_i...
The response looks something like this =>
"tasks" : [ { "Tasks" : { "command" : "CUSTOM_COMMAND", "command_detail" : "RESTART MAPREDUCE2/MAPREDUCE2_CLIENT", "host_name" : "horton01.example.com", "id" : 1157, "request_id" : 111, "role" : "MAPREDUCE2_CLIENT", "status" : "COMPLETED" } }, { "Tasks" : { "command" : "CUSTOM_COMMAND", "command_detail" : "RESTART MAPREDUCE2/HISTORYSERVER", "host_name" : "horton02.example.com", "id" : 1158, "request_id" : 111, "role" : "HISTORYSERVER", "status" : "COMPLETED" } },
The import parts are the id and the host_name
Now you can log into the host and retrieve the error and output logfile from:
For Example on host horton02.example.com:
Note: You might also be able to get the request and tasks ids from the Ambari Database.
Created 12-01-2015 10:12 AM
It is helpful.
Created 12-01-2015 06:20 PM
Thanks for sharing. So this would allow users to access the same output/errors available via ambari when you start/stop a service...but its possible that the actual root cause would only be available in the service's log, right?
Created on 12-01-2015 06:48 PM - edited 08-19-2019 05:45 AM
exactly, its basically the content of these two fields from ambari UI =>
As you pointed out, the actual root cause is usually available in the individual service log -> /var/log/...