Created
September 16, 2016 11:13
-
-
Save NitinKumar94/0650bc3e8cdb0cdde22f52c74bc728f4 to your computer and use it in GitHub Desktop.
This script restarts all tez clients, hive clients, hcat clients, hive server, hive metastore and webhcat server using ambari REST API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -uadmin:admin -H 'X-Requested-By: ambari' -X POST -d ' | |
{ | |
"RequestInfo":{ | |
"command":"RESTART", | |
"context":"Restart Tez Clients on all nodes of the cluster", | |
"operation_level":{ | |
"level":"HOST", | |
"cluster_name":"SubexAnalytics" | |
} | |
}, | |
"Requests/resource_filters":[ | |
{ | |
"service_name":"TEZ", | |
"component_name":"TEZ_CLIENT", | |
"hosts":"node1.analytics.subex" | |
}, | |
{ | |
"service_name":"TEZ", | |
"component_name":"TEZ_CLIENT", | |
"hosts":"node2.analytics.subex" | |
}, | |
{ | |
"service_name":"TEZ", | |
"component_name":"TEZ_CLIENT", | |
"hosts":"node3.analytics.subex" | |
}, | |
{ | |
"service_name":"TEZ", | |
"component_name":"TEZ_CLIENT", | |
"hosts":"node5.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HCAT", | |
"hosts":"node1.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HCAT", | |
"hosts":"node2.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HCAT", | |
"hosts":"node5.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HIVE_CLIENT", | |
"hosts":"node1.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HIVE_CLIENT", | |
"hosts":"node2.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HIVE_CLIENT", | |
"hosts":"node5.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"MYSQL_SERVER", | |
"hosts":"node3.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HIVE_SERVER", | |
"hosts":"node3.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"HIVE_METASTORE", | |
"hosts":"node3.analytics.subex" | |
}, | |
{ | |
"service_name":"HIVE", | |
"component_name":"WEBHCAT_SERVER", | |
"hosts":"node3.analytics.subex" | |
} | |
] | |
}' http://<SERVER_HOST>:<SERVER_PORT>/api/v1/clusters/<CLUSTERNAME>/requests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment