{"id":19086,"date":"2026-07-16T17:57:46","date_gmt":"2026-07-16T09:57:46","guid":{"rendered":"https:\/\/kbwp.transwarp.cn\/?p=19086"},"modified":"2026-07-16T17:57:46","modified_gmt":"2026-07-16T09:57:46","slug":"transwarp-manager-%e9%9b%86%e7%be%a4%e5%81%a5%e5%ba%b7%e7%8a%b6%e6%80%81%e6%a3%80%e6%b5%8b-api-%e5%8f%82%e8%80%83%e7%a4%ba%e4%be%8b","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=19086","title":{"rendered":"Transwarp Manager \u96c6\u7fa4\u5065\u5eb7\u72b6\u6001\u68c0\u6d4b API \u53c2\u8003\u793a\u4f8b"},"content":{"rendered":"<blockquote>\n<p>\u672c\u6587\u6863\u9762\u5411\u96c6\u7fa4\u4f7f\u7528\u65b9\uff0c\u63d0\u4f9b\u901a\u8fc7 <strong>Transwarp Manager\uff08TOS\uff09<\/strong> REST API \u68c0\u6d4b<strong>\u96c6\u7fa4\u6574\u4f53\u5065\u5eb7\u72b6\u6001<\/strong>\u4e0e<strong>\u670d\u52a1\u5065\u5eb7\u72b6\u6001<\/strong>\u7684\u63a5\u53e3\u8bf4\u660e\u4e0e\u8c03\u7528\u793a\u4f8b\uff0c\u53ef\u4f5c\u4e3a\u8fd0\u7ef4\u76d1\u63a7\u3001\u5de1\u68c0\u811a\u672c\u96c6\u6210\u7684\u53c2\u8003\u3002<\/p>\n<p>\u793a\u4f8b\u73af\u5883\uff1aManager \u5730\u5740 <code>http:\/\/172.18.131.171:8180<\/code>\uff08\u8bf7\u66ff\u6362\u4e3a\u60a8\u7684\u5b9e\u9645 Manager \u5730\u5740\uff09<\/p>\n<\/blockquote>\n<hr \/>\n<h2>\u4e00\u3001\u524d\u7f6e\u8bf4\u660e<\/h2>\n<h3>1.1 \u8ba4\u8bc1\u65b9\u5f0f<\/h3>\n<p>\u6240\u6709\u4e1a\u52a1\u63a5\u53e3\u5747\u9700\u5148\u767b\u5f55\u83b7\u53d6\u4f1a\u8bdd Cookie\uff08<code>JSESSIONID<\/code>\uff09\uff0c\u540e\u7eed\u8bf7\u6c42\u901a\u8fc7 <code>-b cookies.txt<\/code> \u643a\u5e26\u3002\u4f1a\u8bdd\u8fc7\u671f\uff08\u8fd4\u56de 401\/403\uff09\u65f6\u91cd\u65b0\u767b\u5f55\u5373\u53ef\u3002<\/p>\n<h3>1.2 \u901a\u7528\u7ea6\u5b9a<\/h3>\n<ul>\n<li>\u6240\u6709\u63a5\u53e3\u57fa\u7840\u8def\u5f84\uff1a<code>http:\/\/&lt;Manager_IP&gt;:8180<\/code><\/li>\n<li>\u8bf7\u6c42\u5934\uff1a<code>accept: *\/*<\/code>\uff1b\u6d89\u53ca\u8bf7\u6c42\u4f53\u7684\u63a5\u53e3\u9700 <code>Content-Type: application\/json<\/code><\/li>\n<li>\u8fd4\u56de\u683c\u5f0f\uff1aJSON\uff08\u5c11\u6570\u8def\u5f84\u578b\u63a5\u53e3\u8fd4\u56de\u7eaf\u6587\u672c\uff09<\/li>\n<li>\u65f6\u95f4\u6233\u5b57\u6bb5\u5747\u4e3a<strong>\u6beb\u79d2\u7ea7 Unix \u65f6\u95f4\u6233<\/strong><\/li>\n<\/ul>\n<h3>1.3 \u767b\u5f55\u83b7\u53d6 Cookie<\/h3>\n<pre><code class=\"language-bash\">curl -X POST 'http:\/\/172.18.131.171:8180\/api\/users\/login' \\\n  -H 'accept: *\/*' \\\n  -H 'Content-Type: application\/json' \\\n  -d '{\n    \"userName\": \"lj_111\",\n    \"userPassword\": \"123456\",\n    \"captcha\": \"string\",\n    \"twoStepCode\": \"string\"\n  }' \\\n  -c cookies.txt<\/code><\/pre>\n<blockquote>\n<p>\u8bf7\u5c06 <code>userName<\/code> \/ <code>userPassword<\/code> \u66ff\u6362\u4e3a\u60a8\u7684\u5b9e\u9645\u8d26\u53f7\u3002<\/p>\n<\/blockquote>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  \"userName\": \"lj_111\",\n  \"roles\": [{\"roleName\": \"admin\", \"source\": \"ROLE\", \"sourceName\": null}],\n  \"permissions\": [{\"type\": \"ADMIN\", \"resId\": -1}],\n  \"isAdmin\": true\n}<\/code><\/pre>\n<p>\u767b\u5f55\u6210\u529f\u540e\uff0c<code>cookies.txt<\/code> \u5c06\u7528\u4e8e\u540e\u7eed\u6240\u6709\u793a\u4f8b\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u3001\u96c6\u7fa4\u6574\u4f53\u5065\u5eb7\u72b6\u6001\u68c0\u6d4b<\/h2>\n<h3>2.1 \u83b7\u53d6\u96c6\u7fa4\u5217\u8868<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u83b7\u53d6 Manager \u7ba1\u7406\u7684\u96c6\u7fa4\u53ca\u5176 ID\uff08\u540e\u7eed\u63a5\u53e3\u9700\u7528\u5230 <code>clusterId<\/code>\uff09\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/clusters' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">[\n  {\"id\": 1, \"name\": \"KV\uff08\u6d4b\u8bd5\u5b8c\u8bb0\u5f97\u6062\u590d\uff09\"}\n]<\/code><\/pre>\n<h3>2.2 \u96c6\u7fa4\u72b6\u6001\uff08\u5065\u5eb7\u68c0\u67e5\u4e0e\u544a\u8b66\uff09\u2605<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u83b7\u53d6\u96c6\u7fa4\u7ea7\u7684\u5065\u5eb7\u68c0\u67e5\u9879\u4e0e\u544a\u8b66\u9879\uff0c\u662f\u5224\u65ad<strong>\u96c6\u7fa4\u6574\u4f53\u5065\u5eb7<\/strong>\u6700\u76f4\u63a5\u7684\u63a5\u53e3\u3002\u6bcf\u4e00\u9879\u5305\u542b\u6807\u9898\u3001\u7c7b\u578b\u3001\u72b6\u6001\u3001\u63cf\u8ff0\u53ca\u544a\u8b66\u7b49\u7ea7\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/clusters\/1\/states' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">[\n  {\n    \"title\": \"\u8282\u70b9\u7f51\u7edc\u5ef6\u8fdf\/\u4e22\u5305\u6bd4\u4f8b\u8fc7\u9ad8\",\n    \"type\": \"AQUILA_ALERT\",\n    \"status\": \"WARNING\",\n    \"description\": \"\u8282\u70b9kv1\u8bbf\u95ee\u5176\u4ed6\u8282\u70b9\u7684\u7f51\u7edc\u5ef6\u8fdf\u68c0\u6d4b\u5305\u8d85\u65f6\u6bd4\u4f8b\u8d85\u8fc733.33%\",\n    \"href\": \"https:\/\/kv1:8666\/#\/home\/alertList?id=6c49526223fa72a1\",\n    \"aquilaLevel\": \"L3\",\n    \"aquilaUrgency\": \"\u4e00\u822c\",\n    \"aquilaPriority\": \"\u5b9a\u671f\u89c2\u5bdf\",\n    \"aquilaPri\": 3\n  }\n]<\/code><\/pre>\n<p><strong>\u5b57\u6bb5\u8bf4\u660e\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>title<\/code><\/td>\n<td>\u68c0\u67e5\u9879\/\u544a\u8b66\u6807\u9898<\/td>\n<\/tr>\n<tr>\n<td><code>type<\/code><\/td>\n<td>\u7c7b\u578b\uff0c\u5982 <code>AQUILA_ALERT<\/code>\uff08\u544a\u8b66\uff09\u3001<code>DAEMON_CHECK<\/code>\uff08\u5b88\u62a4\u8fdb\u7a0b\u68c0\u67e5\uff09\u3001<code>VITAL_SIGN_CHECK<\/code>\uff08\u5c31\u7eea\u68c0\u67e5\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>status<\/code><\/td>\n<td><strong>\u72b6\u6001<\/strong>\uff1a<code>HEALTHY<\/code>\uff08\u5065\u5eb7\uff09\/ <code>WARNING<\/code>\uff08\u544a\u8b66\uff09\/ <code>DOWN<\/code>\uff08\u5f02\u5e38\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>description<\/code><\/td>\n<td>\u8be6\u7ec6\u63cf\u8ff0<\/td>\n<\/tr>\n<tr>\n<td><code>aquilaLevel<\/code><\/td>\n<td>\u544a\u8b66\u7b49\u7ea7\uff08L1~L4\uff09\uff0c\u4ec5\u544a\u8b66\u9879\u6709<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\u5224\u5b9a\u903b\u8f91\uff1a\u8fd4\u56de\u6570\u7ec4\u4e3a\u7a7a\u6216\u6240\u6709\u9879 <code>status=HEALTHY<\/code>\uff0c\u5219\u96c6\u7fa4\u6574\u4f53\u5065\u5eb7\uff1b\u5b58\u5728 <code>WARNING<\/code>\/<code>DOWN<\/code> \u9879\u5219\u9700\u5173\u6ce8\u3002<\/p>\n<\/blockquote>\n<h3>2.3 \u96c6\u7fa4\u7edf\u8ba1\u4fe1\u606f<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u83b7\u53d6\u96c6\u7fa4\u670d\u52a1\u603b\u6570\u4e0e\u8282\u70b9\u603b\u6570\uff0c\u7528\u4e8e\u6982\u89c8\u89c4\u6a21\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/clusters\/1\/statistics' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\"servicesNum\": 29, \"nodesNum\": 4}<\/code><\/pre>\n<h3>2.4 \u96c6\u7fa4\u544a\u8b66\u6c47\u603b \u2605<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u83b7\u53d6\u96c6\u7fa4\u5f53\u524d\u544a\u8b66\u7684\u6c47\u603b\u8ba1\u6570\u4e0e\u6700\u8fd1\u544a\u8b66\u5217\u8868\uff0c\u914d\u5408 2.2 \u7528\u4e8e\u96c6\u7fa4\u5065\u5eb7\u8bc4\u4f30\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/alerts\/aquila\/summary' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  \"criticalCount\": 3,\n  \"warningCount\": 0,\n  \"unknownCount\": 0,\n  \"recent\": [\n    {\n      \"severity\": \"CRITICAL\",\n      \"timestamp\": 1784193939959,\n      \"title\": \"POD starwarp\/starwarp-console-server-... \u5728\u8fc7\u53bb5\u5206\u949f\u5185\u91cd\u542f\u4e861\u6b21\u3002\",\n      \"contextStr\": \"\"\n    },\n    {\n      \"severity\": \"CRITICAL\",\n      \"timestamp\": 1783983859680,\n      \"title\": \"\u8282\u70b9kv1\u8bbf\u95ee\u5176\u4ed6\u8282\u70b9\u7684\u7f51\u7edc\u5ef6\u8fdf\u68c0\u6d4b\u5305\u8d85\u65f6\u6bd4\u4f8b\u8d85\u8fc733.33%\",\n      \"contextStr\": \"KV\uff08\u6d4b\u8bd5\u5b8c\u8bb0\u5f97\u6062\u590d\uff09\/kv1\"\n    }\n  ]\n}<\/code><\/pre>\n<p><strong>\u5b57\u6bb5\u8bf4\u660e\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>criticalCount<\/code><\/td>\n<td>\u4e25\u91cd\u544a\u8b66\u6570<\/td>\n<\/tr>\n<tr>\n<td><code>warningCount<\/code><\/td>\n<td>\u4e00\u822c\u544a\u8b66\u6570<\/td>\n<\/tr>\n<tr>\n<td><code>unknownCount<\/code><\/td>\n<td>\u672a\u77e5\u544a\u8b66\u6570<\/td>\n<\/tr>\n<tr>\n<td><code>recent[].severity<\/code><\/td>\n<td>\u544a\u8b66\u7ea7\u522b\uff1a<code>CRITICAL<\/code> \/ <code>WARNING<\/code> \/ <code>UNKNOWN<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>recent[].timestamp<\/code><\/td>\n<td>\u544a\u8b66\u65f6\u95f4\uff08\u6beb\u79d2\u65f6\u95f4\u6233\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u76f8\u5173\u63a5\u53e3\uff1a<\/p>\n<pre><code class=\"language-bash\"># \u544a\u8b66\u603b\u6570\ncurl -s 'http:\/\/172.18.131.171:8180\/api\/alerts\/aquila\/count' -b cookies.txt\n# \u8fd4\u56de\uff1a{\"count\": 10000}\n\n# \u544a\u8b66\u660e\u7ec6\u5217\u8868\ncurl -s 'http:\/\/172.18.131.171:8180\/api\/alerts\/aquila' -b cookies.txt<\/code><\/pre>\n<h3>2.5 \u8282\u70b9\u5728\u7ebf\u72b6\u6001<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u83b7\u53d6\u6240\u6709\u8282\u70b9\u7684\u5728\u7ebf\u72b6\u6001\u4e0e\u57fa\u7840\u8d44\u6e90\u4fe1\u606f\uff0c\u8282\u70b9\u79bb\u7ebf\u4f1a\u5f71\u54cd\u96c6\u7fa4\u5065\u5eb7\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/nodes' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff08\u5355\u8282\u70b9\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  \"id\": 4,\n  \"hostName\": \"kv1\",\n  \"ipAddress\": \"172.18.131.171\",\n  \"clusterName\": \"KV\uff08\u6d4b\u8bd5\u5b8c\u8bb0\u5f97\u6062\u590d\uff09\",\n  \"rackName\": \"\/default-rack\",\n  \"osName\": \"CentOS Linux\",\n  \"arch\": \"x86_64\",\n  \"logicalCoreCount\": 16,\n  \"status\": \"ONLINE\",\n  \"memTotal\": 67386531840,\n  \"diskCount\": 7\n}<\/code><\/pre>\n<p><strong>\u5b57\u6bb5\u8bf4\u660e\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>hostName<\/code> \/ <code>ipAddress<\/code><\/td>\n<td>\u8282\u70b9\u4e3b\u673a\u540d \/ IP<\/td>\n<\/tr>\n<tr>\n<td><code>status<\/code><\/td>\n<td><strong>\u8282\u70b9\u72b6\u6001<\/strong>\uff1a<code>ONLINE<\/code>\uff08\u5728\u7ebf\uff09\/ <code>OFFLINE<\/code>\uff08\u79bb\u7ebf\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>logicalCoreCount<\/code><\/td>\n<td>CPU \u903b\u8f91\u6838\u6570<\/td>\n<\/tr>\n<tr>\n<td><code>memTotal<\/code><\/td>\n<td>\u5185\u5b58\u603b\u91cf\uff08\u5b57\u8282\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>diskCount<\/code><\/td>\n<td>\u78c1\u76d8\u6570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\u8282\u70b9\u7ea7\u5065\u5eb7\u68c0\u67e5\u9879\u53ef\u901a\u8fc7 <code>GET \/api\/nodes\/{nodeId}\/states<\/code> \u83b7\u53d6\uff0c\u7ed3\u6784\u4e0e 2.2 \u4e00\u81f4\u3002<\/p>\n<\/blockquote>\n<hr \/>\n<h2>\u4e09\u3001\u670d\u52a1\u5065\u5eb7\u72b6\u6001\u68c0\u6d4b<\/h2>\n<h3>3.1 \u670d\u52a1\u5217\u8868\uff08\u5168\u5c40\u5065\u5eb7\u4e00\u89c8\uff09\u2605<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u83b7\u53d6\u96c6\u7fa4\u5168\u90e8\u670d\u52a1\u53ca\u5176\u5065\u5eb7\u72b6\u6001\uff0c\u7528\u4e8e\u4e00\u6b21\u6027\u638c\u63e1\u6240\u6709\u670d\u52a1\u7684\u5065\u5eb7\u6982\u51b5\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/services' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff08\u5355\u670d\u52a1\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  \"id\": 20,\n  \"name\": \"HDFS1\",\n  \"type\": \"HDFS\",\n  \"version\": \"transwarp-9.3.3-final\",\n  \"health\": \"HEALTHY\",\n  \"installed\": true,\n  \"monitored\": true,\n  \"hasStaleConfig\": true,\n  \"toRestart\": false,\n  \"enableKerberos\": true\n}<\/code><\/pre>\n<p><strong>\u5173\u952e\u5b57\u6bb5\u8bf4\u660e\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>id<\/code><\/td>\n<td>\u670d\u52a1 ID\uff08\u540e\u7eed\u63a5\u53e3\u9700\u7528\u5230\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>name<\/code> \/ <code>type<\/code><\/td>\n<td>\u670d\u52a1\u540d\u79f0 \/ \u7c7b\u578b\uff08HDFS\u3001YARN\u3001KUNDB \u7b49\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>version<\/code><\/td>\n<td>\u5df2\u5b89\u88c5\u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td><code>health<\/code><\/td>\n<td><strong>\u670d\u52a1\u5065\u5eb7\u72b6\u6001<\/strong>\uff1a<code>HEALTHY<\/code>\uff08\u5065\u5eb7\uff09\/ <code>DOWN<\/code>\uff08\u5f02\u5e38\uff09\/ <code>WARNING<\/code>\uff08\u544a\u8b66\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>monitored<\/code><\/td>\n<td>\u662f\u5426\u7eb3\u5165\u76d1\u63a7<\/td>\n<\/tr>\n<tr>\n<td><code>hasStaleConfig<\/code><\/td>\n<td>\u662f\u5426\u5b58\u5728\u5f85\u91cd\u542f\u751f\u6548\u7684\u914d\u7f6e\u53d8\u66f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\u5224\u5b9a\u903b\u8f91\uff1a\u904d\u5386\u8fd4\u56de\u6570\u7ec4\uff0c\u7edf\u8ba1\u5404 <code>health<\/code> \u53d6\u503c\u5206\u5e03\u5373\u53ef\u5f97\u5230\u670d\u52a1\u5065\u5eb7\u6982\u89c8\u3002<\/p>\n<\/blockquote>\n<p><strong>\u5feb\u901f\u6c47\u603b\u793a\u4f8b\uff08\u6309\u5065\u5eb7\u72b6\u6001\u5206\u7ec4\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/services' -b cookies.txt \\\n  | python -c \"import sys,json; \\\n[print(f\\\"{s['health']:10s} {s['type']:18s} {s['name']}\\\") for s in json.load(sys.stdin)]\"<\/code><\/pre>\n<h3>3.2 \u670d\u52a1\u8be6\u60c5\u4e0e\u5065\u5eb7\u68c0\u67e5\u9879 \u2605<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u83b7\u53d6\u5355\u4e2a\u670d\u52a1\u7684\u8be6\u60c5\uff0c\u5176\u4e2d <code>states<\/code> \u5b57\u6bb5\u4e3a\u8be5\u670d\u52a1\u7684<strong>\u5065\u5eb7\u68c0\u67e5\u9879\u660e\u7ec6<\/strong>\uff08\u8fd0\u884c\u68c0\u67e5\u3001\u5c31\u7eea\u68c0\u67e5\u7b49\uff09\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/services\/20' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  \"states\": [\n    {\n      \"title\": \"\u8fd0\u884c\u68c0\u67e5\",\n      \"type\": \"DAEMON_CHECK\",\n      \"status\": \"HEALTHY\",\n      \"description\": \"9\u4e2a\u89d2\u8272\u5065\u5eb7\uff0c0\u4e2a\u89d2\u8272\u4e0d\u53ef\u7528\uff0c0\u4e2a\u89d2\u8272\u4e0d\u5065\u5eb7\"\n    },\n    {\n      \"title\": \"\u5c31\u7eea\u68c0\u67e5\",\n      \"type\": \"VITAL_SIGN_CHECK\",\n      \"status\": \"HEALTHY\",\n      \"description\": \"8\u4e2a\u89d2\u8272\u5065\u5eb7\uff0c0\u4e2a\u89d2\u8272\u4e0d\u53ef\u7528\uff0c0\u4e2a\u89d2\u8272\u4e0d\u5065\u5eb7\uff0c0\u4e2a\u89d2\u8272\u5728\u9000\u5f79\u4e2d\uff0c0\u4e2a\u89d2\u8272\u5df2\u9000\u5f79\"\n    }\n  ],\n  \"id\": 20,\n  \"type\": \"HDFS\",\n  \"name\": \"HDFS1\",\n  \"version\": \"transwarp-9.3.3-final\",\n  \"health\": \"HEALTHY\"\n}<\/code><\/pre>\n<p><strong>\u5b57\u6bb5\u8bf4\u660e\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>states[].title<\/code><\/td>\n<td>\u68c0\u67e5\u9879\u6807\u9898\uff08\u8fd0\u884c\u68c0\u67e5 \/ \u5c31\u7eea\u68c0\u67e5\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>states[].type<\/code><\/td>\n<td>\u68c0\u67e5\u7c7b\u578b\uff1a<code>DAEMON_CHECK<\/code>\uff08\u8fdb\u7a0b\u5b58\u6d3b\uff09\u3001<code>VITAL_SIGN_CHECK<\/code>\uff08\u5c31\u7eea\/\u53ef\u7528\u6027\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>states[].status<\/code><\/td>\n<td><strong>\u68c0\u67e5\u72b6\u6001<\/strong>\uff1a<code>HEALTHY<\/code> \/ <code>WARNING<\/code> \/ <code>DOWN<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>states[].description<\/code><\/td>\n<td>\u68c0\u67e5\u7ed3\u679c\u63cf\u8ff0\uff08\u542b\u5065\u5eb7\/\u4e0d\u53ef\u7528\/\u4e0d\u5065\u5eb7\u89d2\u8272\u8ba1\u6570\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>health<\/code><\/td>\n<td>\u670d\u52a1\u6574\u4f53\u5065\u5eb7\u72b6\u6001\uff08\u6c47\u603b\u503c\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p><code>states<\/code> \u6570\u7ec4\u4e3a\u7a7a\u6216\u5168\u90e8 <code>HEALTHY<\/code> \u5373\u4ee3\u8868\u670d\u52a1\u5065\u5eb7\uff1b<code>description<\/code> \u4e2d&quot;\u4e0d\u53ef\u7528&quot;&quot;\u4e0d\u5065\u5eb7&quot;\u89d2\u8272\u8ba1\u6570 &gt; 0 \u65f6\u9700\u8fdb\u4e00\u6b65\u7528 3.3 \u5b9a\u4f4d\u3002<\/p>\n<\/blockquote>\n<h3>3.3 \u670d\u52a1\u89d2\u8272\u5065\u5eb7\u660e\u7ec6 \u2605<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u5f53\u670d\u52a1\u5b58\u5728\u4e0d\u5065\u5eb7\u89d2\u8272\u65f6\uff0c\u5b9a\u4f4d\u5230<strong>\u5177\u4f53\u89d2\u8272\u3001\u6240\u5728\u8282\u70b9\u3001\u68c0\u67e5\u7ed3\u679c\u4e0e\u8be6\u60c5<\/strong>\uff0c\u662f\u670d\u52a1\u5065\u5eb7\u6392\u969c\u7684\u6838\u5fc3\u63a5\u53e3\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/services\/20\/rolesHealths' -b cookies.txt<\/code><\/pre>\n<p><strong>\u8fd4\u56de\u793a\u4f8b\uff08\u5355\u6761\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  \"roleId\": 141,\n  \"node\": \"kv2\",\n  \"roleType\": \"HDFS_DATANODE\",\n  \"roleName\": \"Data Node\",\n  \"category\": \"DAEMON_CHECK\",\n  \"categoryTitle\": \"\u8fd0\u884c\u68c0\u67e5\",\n  \"result\": \"HEALTHY\",\n  \"detail\": \"kv2\u8282\u70b9default\u547d\u540d\u7a7a\u95f4\u4e2d\u89d2\u8272Data Node\uff08hadoop-hdfs-datanode-hdfs1\uff09\u6b63\u5728\u8fd0\u884c\uff1ahadoop-hdfs-datanode-hdfs1-56b4cc566c-hsdj4\uff08Running\uff09\",\n  \"checkTime\": 1784194139647\n}<\/code><\/pre>\n<p><strong>\u5b57\u6bb5\u8bf4\u660e\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>roleId<\/code><\/td>\n<td>\u89d2\u8272\u5b9e\u4f8b ID<\/td>\n<\/tr>\n<tr>\n<td><code>node<\/code><\/td>\n<td>\u89d2\u8272\u6240\u5728\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td><code>roleType<\/code> \/ <code>roleName<\/code><\/td>\n<td>\u89d2\u8272\u7c7b\u578b \/ \u663e\u793a\u540d\uff08\u5982 <code>HDFS_DATANODE<\/code> \/ <code>Data Node<\/code>\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>category<\/code><\/td>\n<td>\u68c0\u67e5\u7c7b\u522b\uff1a<code>DAEMON_CHECK<\/code>\uff08\u8fd0\u884c\u68c0\u67e5\uff09\u3001<code>VITAL_SIGN_CHECK<\/code>\uff08\u5c31\u7eea\u68c0\u67e5\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>result<\/code><\/td>\n<td><strong>\u89d2\u8272\u5065\u5eb7\u7ed3\u679c<\/strong>\uff1a<code>HEALTHY<\/code> \/ <code>UNHEALTHY<\/code> \/ <code>UNAVAILABLE<\/code> \/ <code>DECOMMISSIONED<\/code> \/ <code>DECOMMISSIONING<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>detail<\/code><\/td>\n<td>\u68c0\u67e5\u7ed3\u679c\u8be6\u60c5<\/td>\n<\/tr>\n<tr>\n<td><code>checkTime<\/code><\/td>\n<td>\u6700\u8fd1\u68c0\u67e5\u65f6\u95f4\uff08\u6beb\u79d2\u65f6\u95f4\u6233\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>3.4 \u670d\u52a1\u89d2\u8272\u7c7b\u578b\u4e0e\u5206\u5e03\uff08\u8f85\u52a9\uff09<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u4e86\u89e3\u670d\u52a1\u7684\u89d2\u8272\u6784\u6210\u4e0e\u5728\u5404\u8282\u70b9\u7684\u5206\u5e03\uff0c\u8f85\u52a9\u5065\u5eb7\u8bc4\u4f30\u3002<\/p>\n<pre><code class=\"language-bash\"># \u670d\u52a1\u89d2\u8272\u7c7b\u578b\ncurl -s 'http:\/\/172.18.131.171:8180\/api\/services\/20\/roleTypes' -b cookies.txt\n# \u8fd4\u56de\uff1a[{\"typeName\":\"HDFS_NAMENODE\",\"friendlyName\":\"Name Node\"}, ...]\n\n# \u89d2\u8272\u5728\u5404\u8282\u70b9\u7684\u5206\u5e03\ncurl -s 'http:\/\/172.18.131.171:8180\/api\/services\/20\/roleDistribution' -b cookies.txt<\/code><\/pre>\n<p><strong>roleDistribution \u8fd4\u56de\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-json\">{\n  \"kv1\": [\"Name Node\"],\n  \"kv2\": [\"Data Node\", \"Journal Node\", \"Name Node\"],\n  \"kv3\": [\"Data Node\", \"Journal Node\"],\n  \"kv4\": [\"Data Node\", \"Httpfs\", \"Journal Node\"]\n}<\/code><\/pre>\n<h3>3.5 \u5355\u89d2\u8272\u5065\u5eb7\u660e\u7ec6<\/h3>\n<p><strong>\u7528\u9014\uff1a<\/strong> \u6309 <code>roleId<\/code> \u67e5\u8be2\u5355\u4e2a\u89d2\u8272\u7684\u5065\u5eb7\u68c0\u67e5\u660e\u7ec6\uff08<code>roleId<\/code> \u53ef\u4ece 3.3 \u6216 <code>GET \/api\/serviceRoles?serviceId={id}<\/code> \u83b7\u53d6\uff09\u3002<\/p>\n<pre><code class=\"language-bash\">curl -s 'http:\/\/172.18.131.171:8180\/api\/serviceRoles\/141\/healths' -b cookies.txt<\/code><\/pre>\n<p>\u8fd4\u56de\u7ed3\u6784\u4e0e 3.3 \u4e00\u81f4\u3002<\/p>\n<hr \/>\n<h2>\u56db\u3001\u5065\u5eb7\u72b6\u6001\u53d6\u503c\u901f\u67e5<\/h2>\n<h3>4.1 \u670d\u52a1 \/ \u96c6\u7fa4\u5065\u5eb7\u72b6\u6001\uff08<code>health<\/code> \/ <code>status<\/code>\uff09<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u53d6\u503c<\/th>\n<th>\u542b\u4e49<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>HEALTHY<\/code><\/td>\n<td>\u5065\u5eb7<\/td>\n<td>\u6240\u6709\u68c0\u67e5\u901a\u8fc7<\/td>\n<\/tr>\n<tr>\n<td><code>WARNING<\/code><\/td>\n<td>\u544a\u8b66<\/td>\n<td>\u5b58\u5728\u975e\u81f4\u547d\u95ee\u9898\uff0c\u9700\u5173\u6ce8<\/td>\n<\/tr>\n<tr>\n<td><code>DOWN<\/code><\/td>\n<td>\u5f02\u5e38<\/td>\n<td>\u670d\u52a1\u4e0d\u53ef\u7528\u6216\u5173\u952e\u68c0\u67e5\u5931\u8d25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>4.2 \u89d2\u8272\u5065\u5eb7\u7ed3\u679c\uff08<code>result<\/code>\uff09<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u53d6\u503c<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>HEALTHY<\/code><\/td>\n<td>\u5065\u5eb7<\/td>\n<\/tr>\n<tr>\n<td><code>UNHEALTHY<\/code><\/td>\n<td>\u4e0d\u5065\u5eb7<\/td>\n<\/tr>\n<tr>\n<td><code>UNAVAILABLE<\/code><\/td>\n<td>\u4e0d\u53ef\u7528<\/td>\n<\/tr>\n<tr>\n<td><code>DECOMMISSIONING<\/code><\/td>\n<td>\u9000\u5f79\u4e2d<\/td>\n<\/tr>\n<tr>\n<td><code>DECOMMISSIONED<\/code><\/td>\n<td>\u5df2\u9000\u5f79<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>4.3 \u544a\u8b66\u7ea7\u522b\uff08<code>severity<\/code> \/ <code>aquilaLevel<\/code>\uff09<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u53d6\u503c<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>CRITICAL<\/code> \/ L1~L2<\/td>\n<td>\u4e25\u91cd\uff0c\u9700\u7acb\u5373\u5904\u7406<\/td>\n<\/tr>\n<tr>\n<td><code>WARNING<\/code> \/ L3<\/td>\n<td>\u4e00\u822c\uff0c\u5b9a\u671f\u89c2\u5bdf<\/td>\n<\/tr>\n<tr>\n<td><code>UNKNOWN<\/code> \/ L4<\/td>\n<td>\u672a\u77e5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u6863\u9762\u5411\u96c6\u7fa4\u4f7f\u7528\u65b9\uff0c\u63d0\u4f9b\u901a\u8fc7 Transwarp Manager\uff08TOS\uff09 REST API \u68c0\u6d4b\u96c6\u7fa4\u6574\u4f53\u5065 ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=19086\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":155,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-19086","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/19086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/155"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19086"}],"version-history":[{"count":1,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/19086\/revisions"}],"predecessor-version":[{"id":19087,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/19086\/revisions\/19087"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}