Reputation: 339
I want to get the integral id / hash id of task manager and report metrics using that.
Upvotes: 1
Views: 2755
Reputation: 668
You can get a JSON formatted output of the scheduled TaskManagers by:
curl -s "http://localhost:8081/taskmanagers/"
If you are interested only in the id of the TaskManager, you can fetch it using jq (https://stedolan.github.io/jq/).
Example of fetching the id of the first TaskManager:
local task_manager_id=`curl -s "http://localhost:8081/taskmanagers/" | jq -r '.taskmanagers[0].id'`
Upvotes: 1
Reputation: 339
Finally I got the solution by getting YARN application container ID for each task manager was running into.
The container id's suits my purpose, thanks for all your insights though.
Upvotes: 0
Reputation: 1280
You can use the metric system for that.
Within a (rich) user-defined function call getRuntimeContext().getMetricGroup().getAllVariables().get("<tm_id>")
Upvotes: 2
Reputation: 867
You can check which tasks are mapped to which task slot on the JobManager’s web frontend at http://localhost:8081. You have also a bunch of metrics.
Upvotes: 0