Need help with passing arguments from xargs to subsequent Hadoop command.
I have results like below from this command.
yarn application -list -appStates RUNNING | grep <user> | awk '{print $1}'
Results of above command as below.
17/09/19 12:24:36 INFO client.ConfiguredRMFailoverProxyProvider:
Failing over to rm21 Total Application-Id
application_1505017974932_14847
application_1505017974932_14815
application_1505017974932_14810
application_1505017974932_14784
application_1505017974932_14796
application_1505017974932_14778
I need to be able to pass above output one by one to below command.
yarn application -movetoqueue <application_ID of above output> -queue myqueue
Could you please help here in finding the right command to achieve the same?
Similar setup is working for me in below command but not in the above as above command has n
a)
yarn application -list -appStates RUNNING | grep <user> | awk '{print $1}' | xargs -n 1 yarn application -kill
This is another way..
b.) for app in yarn application -list -appStates RUNNING | grep <user> | awk '{print $1}’; do yarn application -kill "$app"; done
Appreciate your help on this.