{"id":82088,"date":"2026-07-25T06:36:32","date_gmt":"2026-07-24T22:36:32","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/82088.html"},"modified":"2026-07-25T06:36:32","modified_gmt":"2026-07-24T22:36:32","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%99%be%e5%8f%b0%ef%bc%8cssh%e9%80%90%e5%8f%b0%e8%a3%85%e7%9b%91%e6%8e%a7%e5%88%b0%e7%8c%b4%e5%b9%b4%e9%a9%ac%e6%9c%88%ef%bc%9f%e6%88%91%e7%94%a8ansible%e4%b8%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/82088.html","title":{"rendered":"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a"},"content":{"rendered":"<h3>\u524d\u8a00<\/h3>\n<p>\u624b\u91cc\u53ea\u6709\u51e0\u53f0\u670d\u52a1\u5668\u7684\u65f6\u5019&#xff0c;\u9010\u53f0 SSH \u4e0a\u53bb\u88c5 Node Exporter \u4e0d\u662f\u4ec0\u4e48\u5927\u95ee\u9898\u3002\u4f46\u4e1a\u52a1\u4e00\u6269\u5f20&#xff0c;\u670d\u52a1\u5668\u4ece\u51e0\u53f0\u53d8\u6210\u51e0\u5341\u53f0\u3001\u4e0a\u767e\u53f0\u7684\u65f6\u5019&#xff0c;\u8fd9\u4e8b\u5c31\u5f00\u59cb\u53d8\u5473\u4e86\u2014\u2014\u624b\u52a8 SSH \u8fdb\u53bb\u3001\u6572\u547d\u4ee4\u3001\u786e\u8ba4\u670d\u52a1\u542f\u52a8&#xff0c;\u4e00\u5957\u6d41\u7a0b\u8d70\u4e0b\u6765\u53ef\u80fd\u5927\u534a\u5929\u5c31\u8fc7\u53bb\u4e86&#xff0c;\u800c\u4e14\u4e2d\u95f4\u8fd8\u5bb9\u6613\u51fa\u9519&#xff0c;\u88c5\u5b8c\u7684\u7248\u672c\u8fd8\u4e0d\u4e00\u5b9a\u7edf\u4e00\u3002\u8fd0\u7ef4\u56e2\u961f\u7a0d\u5fae\u5927\u4e00\u70b9&#xff0c;\u5149\u662f&#034;\u5927\u5bb6\u90fd\u5728\u88c5\u76d1\u63a7&#034;\u8fd9\u4ef6\u4e8b\u672c\u8eab\u5c31\u6210\u4e86\u4e00\u573a\u7ba1\u7406\u5669\u68a6\u3002<\/p>\n<p>Ansible \u5c31\u662f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u3002\u5b83\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u65e0\u4ee3\u7406\u7684\u81ea\u52a8\u5316\u8fd0\u7ef4\u5de5\u5177&#xff0c;\u57fa\u4e8e SSH \u8fde\u63a5&#xff0c;\u88ab\u63a7\u673a\u5668\u4e0a\u53ea\u8981\u6709 Python \u548c SSH \u5c31\u80fd\u8dd1&#xff0c;\u4e0d\u9700\u8981\u5728\u6bcf\u53f0\u673a\u5668\u4e0a\u88c5\u989d\u5916\u7684\u5ba2\u6237\u7aef\u3002\u5199\u597d\u4e00\u4e2a Playbook \u4e4b\u540e&#xff0c;\u4e00\u6761\u547d\u4ee4\u5c31\u80fd\u540c\u65f6\u5bf9\u6240\u6709\u76ee\u6807\u673a\u5668\u6267\u884c\u64cd\u4f5c&#xff0c;\u7248\u672c\u7edf\u4e00\u3001\u914d\u7f6e\u7edf\u4e00\u3001\u6267\u884c\u7ed3\u679c\u7edf\u4e00\u3002\u66f4\u91cd\u8981\u7684\u662f\u5b83\u7684\u5e42\u7b49\u6027\u2014\u2014\u91cd\u590d\u6267\u884c\u7ed3\u679c\u4e00\u81f4&#xff0c;\u6ca1\u88c5\u7684\u4f1a\u88c5&#xff0c;\u5df2\u88c5\u597d\u7684\u4e0d\u4f1a\u91cd\u590d\u64cd\u4f5c&#xff0c;\u4e0d\u4f1a\u56e0\u4e3a\u91cd\u590d\u6267\u884c\u628a\u73af\u5883\u5f04\u4e71\u3002\u7528 Ansible \u5199\u597d Node Exporter \u7684\u90e8\u7f72 Playbook \u4e4b\u540e&#xff0c;\u4e09\u5206\u949f\u4e4b\u5185\u53ef\u4ee5\u628a\u4e0a\u767e\u53f0\u670d\u52a1\u5668\u5168\u90e8\u7eb3\u7ba1&#xff0c;Prometheus \u90a3\u8fb9\u76f4\u63a5\u5c31\u80fd\u6293\u53d6\u5230\u6240\u6709\u4e3b\u673a\u7684\u76d1\u63a7\u6570\u636e\u3002<\/p>\n<p>\u672c\u6587\u5c06\u624b\u628a\u624b\u6559\u4f60\u7f16\u5199\u4e00\u4e2a\u8f7b\u91cf\u3001\u53ef\u590d\u7528\u7684Ansible\u81ea\u52a8\u5316\u90e8\u7f72\u65b9\u6848&#xff0c;\u4ece\u6b64\u544a\u522b\u91cd\u590d\u52b3\u52a8&#xff0c;\u771f\u6b63\u5b9e\u73b0\u201c\u76d1\u63a7\u5148\u884c&#xff0c;\u7a33\u5b9a\u65e0\u5fe7\u201d\u3002<\/p>\n<p>\u5982\u679c\u4f60\u8fd8\u60f3\u76d1\u63a7\u5bb6\u91cc\u7684\u7535\u8111&#xff0c;\u4f46\u8bbe\u5907\u5728\u5185\u7f51\u65e0\u6cd5\u76f4\u8fde&#xff1f;\u522b\u6025&#xff0c;\u6587\u672b\u9644\u8d60 cpolar \u5185\u7f51\u7a7f\u900f\u65b9\u6848&#xff0c;\u8ba9 Ansible \u7167\u6837\u8fdc\u7a0b\u90e8\u7f72&#xff01;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223627-6a63e8ebe4b7e.png\" alt=\"image-20251209173019852\" \/><\/p>\n<h3>1.\u5728\u4f60\u7684\u865a\u62df\u673a\u4e0a\u5b89\u88c5ansiable<\/h3>\n<h4>1.1 \u4ec0\u4e48\u662fAnsible&#xff1f;<\/h4>\n<p>Ansible\u662f\u4e00\u4e2a\u5f00\u6e90\u7684 \u81ea\u52a8\u5316\u8fd0\u7ef4\u5de5\u5177&#xff0c;\u7531Red Hat\u8d5e\u52a9\u5f00\u53d1&#xff0c;\u7528\u4e8e\u5b9e\u73b0&#xff1a;<\/p>\n<ul>\n<li>\u914d\u7f6e\u7ba1\u7406&#xff08;Configuration Management&#xff09;<\/li>\n<li>\u5e94\u7528\u90e8\u7f72&#xff08;Application Deployment&#xff09;<\/li>\n<li>\u4efb\u52a1\u81ea\u52a8\u5316&#xff08;Task Automation&#xff09;<\/li>\n<li>IT\u7f16\u6392&#xff08;Orchestration&#xff09;<\/li>\n<\/ul>\n<p>\u5b83\u6700\u5927\u7684\u7279\u70b9\u662f&#xff1a;\u7b80\u5355\u3001\u65e0\u4ee3\u7406\u3001\u57fa\u4e8eSSH\u3001\u4f7f\u7528YAML\u8bed\u6cd5\u3002<\/p>\n<h4>1.2 Ansible\u7684\u6838\u5fc3\u4f5c\u7528<\/h4>\n<li>\u6279\u91cf\u6267\u884c\u547d\u4ee4<\/li>\n<p>\u65e0\u9700\u9010\u53f0\u767b\u5f55\u670d\u52a1\u5668&#xff0c;\u4e00\u6761\u547d\u4ee4\u53ef\u5728\u6210\u767e\u4e0a\u5343\u53f0\u673a\u5668\u4e0a\u540c\u65f6\u8fd0\u884c&#xff1a;<\/p>\n<li>\u7edf\u4e00\u914d\u7f6e\u7ba1\u7406<\/li>\n<p>\u786e\u4fdd\u6240\u6709\u670d\u52a1\u5668\u7684\u914d\u7f6e\u4e00\u81f4&#xff0c;\u6bd4\u5982&#xff1a;<\/p>\n<ul>\n<li>\u5b89\u88c5\u6307\u5b9a\u7248\u672c\u7684\u8f6f\u4ef6&#xff08;\u5982 Node Exporter\u3001Nginx&#xff09;<\/li>\n<li>\u540c\u6b65\u914d\u7f6e\u6587\u4ef6&#xff08;\u5982 \/etc\/hosts\u3001prometheus.yml&#xff09;<\/li>\n<li>\u521b\u5efa\u7528\u6237\u3001\u8bbe\u7f6e\u6743\u9650\u3001\u7ba1\u7406\u670d\u52a1\u72b6\u6001<\/li>\n<li>\u81ea\u52a8\u5316\u90e8\u7f72\u5e94\u7528<\/li>\n<\/ul>\n<p>\u901a\u8fc7 Playbook&#xff08;YAML \u6587\u4ef6&#xff09;\u5b9a\u4e49\u90e8\u7f72\u6d41\u7a0b&#xff0c;\u4e00\u952e\u5b8c\u6210\u590d\u6742\u5e94\u7528\u4e0a\u7ebf&#xff1a;<\/p>\n<li>\u5e42\u7b49\u6027&#xff08;Idempotency&#xff09;<\/li>\n<p>\u91cd\u590d\u6267\u884c\u540c\u4e00\u4e2a Playbook&#xff0c;\u7ed3\u679c\u59cb\u7ec8\u4e00\u81f4\u2014\u2014\u6ca1\u88c5\u7684\u4f1a\u88c5&#xff0c;\u5df2\u88c5\u7684\u4e0d\u4f1a\u91cd\u590d\u64cd\u4f5c&#xff0c;\u5b89\u5168\u53ef\u9760\u3002<\/p>\n<li>\u65e0\u9700\u5b89\u88c5\u5ba2\u6237\u7aef&#xff08;Agentless&#xff09;<\/li>\n<p>Ansible\u901a\u8fc7SSH \u4e0e\u76ee\u6807\u4e3b\u673a\u901a\u4fe1&#xff0c;\u53ea\u9700\u63a7\u5236\u673a\u5b89\u88c5Ansible&#xff0c;\u88ab\u63a7\u673a\u53ea\u8981\u6709Python \u548cSSH\u5373\u53ef\u3002<\/p>\n<li>\u652f\u6301\u4e91\u548c\u5bb9\u5668\u7f16\u6392<\/li>\n<p>\u53ef\u7ba1\u7406AWS\u3001Azure\u3001\u963f\u91cc\u4e91\u7b49\u4e91\u8d44\u6e90&#xff0c;\u4e5f\u80fd\u64cd\u4f5cDocker\u3001Kubernetes\u3002<\/p>\n<h4>1.3 \u5b89\u88c5ansiale<\/h4>\n<p>\u6211\u8fd9\u91cc\u662fubuntu\u7cfb\u7edf&#xff0c;\u5982\u679c\u60f3\u4f7f\u7528centos\u53ef\u4ee5\u770b\u53c2\u8003cpolar\u5b98\u7f51\u7684\u8fd9\u7bc7\u6559\u7a0b&#xff1a;\u300a\u522b\u518d\u624b\u52a8\u64cd\u4f5c\u4e86&#xff01;\u6211\u7528Ansible&#043;cpolar\u7ed9\u98de\u725bOS\u88c5\u4e86\u4e2a\u201c\u9065\u63a7\u5668\u300b<\/p>\n<p>\u767b\u5f55\u5230 Ubuntu\u7cfb\u7edf&#xff0c;\u5e76\u5728APT\u547d\u4ee4\u4e0b\u8fd0\u884c\u4ee5\u5e94\u7528\u66f4\u65b0&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> upgrade <span class=\"token parameter variable\">-y<\/span><\/p>\n<p>\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Ansible&#xff1a;<\/p>\n<p><span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> ansible<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223628-6a63e8ec0ebce.png\" alt=\"b22459cbd77b782b0540844e877693c0\" \/><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u9a8c\u8bc1ansiable\u7248\u672c&#xff1a;<\/p>\n<p>ansible <span class=\"token parameter variable\">&#8211;version<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223628-6a63e8ec2f343.png\" alt=\"5728544c3e02fe61e823691627fe54e0\" \/><\/p>\n<p>\u6211\u4eec\u67e5\u770b\u4e00\u4e0b&#xff0c;\u6709\u6ca1\u6709\u542f\u52a8\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">ls<\/span> \/etc\/ansible<\/p>\n<p>\u6211\u53d1\u73b0\u6211\u8fd9\u91cc\u6ca1\u6709&#xff0c;\u90a3\u6211\u4eec\u624b\u52a8\u914d\u4e00\u4e0b&#xff0c;\u521b\u5efaansiable\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/etc\/ansible<\/p>\n<p>\u7f16\u5199hosts\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> \/etc\/ansible\/hosts <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">EOF<br \/>\n[local]<br \/>\nlocalhost ansible_connection&#061;local<br \/>\nEOF<\/span><\/p>\n<p>\u7f16\u5199ansiable.cfg\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> \/etc\/ansible\/ansible.cfg <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">EOF<br \/>\n[defaults]<br \/>\ninventory &#061; \/etc\/ansible\/hosts<br \/>\nhost_key_checking &#061; False<br \/>\nremote_user &#061; root<br \/>\nstdout_callback &#061; yaml<br \/>\nEOF<\/span><\/p>\n<p>\u9a8c\u8bc1\u662f\u5426\u6210\u529f&#xff1a;<\/p>\n<p>ansible localhost <span class=\"token parameter variable\">-m<\/span> <span class=\"token function\">ping<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223628-6a63e8ec41d87.png\" alt=\"f1dff617f524f088860e1b8183ad3a93\" \/><\/p>\n<h3>2.\u914d\u7f6eansiable\u6587\u4ef6\u641e\u5b9aNode Exporter\u90e8\u7f72&#xff01;<\/h3>\n<p>\u786e\u4fdd\u4f60\u5728playbook\u6240\u5728\u76ee\u5f55&#xff08;\u5047\u8bbe\u662f \/etc\/ansible&#xff09;&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> \/etc\/ansible<\/p>\n<p>\u521b\u5efatemplates\u76ee\u5f55<\/p>\n<p><span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> templates<\/p>\n<p>\u521b\u5efa\u670d\u52a1\u6a21\u677f\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> templates\/node_exporter.service.j2 <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#039;EOF&#039;<br \/>\n[Unit]<br \/>\nDescription&#061;Node Exporter<br \/>\nAfter&#061;network.target<\/p>\n<p>[Service<br \/>\nUser&#061;node_exporter<br \/>\nGroup&#061;node_exporter<br \/>\nType&#061;simple<br \/>\nExecStart&#061;{{ install_dir }}\/node_exporter &#8211;collector.systemd &#8211;collector.processes<br \/>\nRestart&#061;on-failure<br \/>\nRestartSec&#061;5<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<br \/>\nEOF<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223628-6a63e8ec5332b.png\" alt=\"12d3dce8e099503e406717535efa4447\" \/><\/p>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u6765\u8fc7\u4e00\u4e0b\u5b89\u88c5node_exporter\u57fa\u672c\u6b65\u9aa4&#xff1a;<\/p>\n<p><span class=\"token function\">mkdir<\/span> \/shan<br \/>\n<span class=\"token builtin class-name\">cd<\/span> \/shan<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-LO<\/span> https:\/\/github.com\/prometheus\/node_exporter\/releases\/download\/v1.10.2\/node_exporter-1.10.2.linux-amd64.tar.gz<\/p>\n<p><span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-zxvf<\/span> node_exporter-1.10.2.linux-amd64.tar.gz<\/p>\n<p><span class=\"token function\">rm<\/span> <span class=\"token parameter variable\">-rf<\/span> node_exporter-1.10.2.linux-amd64.tar.gz<br \/>\n<span class=\"token function\">mv<\/span> node_exporter-1.10.2.linux-amd64\/ node_exporter<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">vi<\/span> \/etc\/systemd\/system\/node_exporter.service<br \/>\n<span class=\"token punctuation\">[<\/span>Unit<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">Description<\/span><span class=\"token operator\">&#061;<\/span>Node Exporter<br \/>\n<span class=\"token assign-left variable\">Documentation<\/span><span class=\"token operator\">&#061;<\/span>https:\/\/github.com\/prometheus\/node_exporter<br \/>\n<span class=\"token assign-left variable\">After<\/span><span class=\"token operator\">&#061;<\/span>network.target<\/p>\n<p><span class=\"token punctuation\">[<\/span>Service<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">User<\/span><span class=\"token operator\">&#061;<\/span>node_exporter<br \/>\n<span class=\"token assign-left variable\">Group<\/span><span class=\"token operator\">&#061;<\/span>node_exporter<br \/>\n<span class=\"token assign-left variable\">Type<\/span><span class=\"token operator\">&#061;<\/span>simple<br \/>\n<span class=\"token assign-left variable\">ExecStart<\/span><span class=\"token operator\">&#061;<\/span>\/shan\/node_exporter\/node_exporter<\/p>\n<p><span class=\"token punctuation\">[<\/span>Install<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">WantedBy<\/span><span class=\"token operator\">&#061;<\/span>default.target<\/p>\n<p><span class=\"token function\">useradd<\/span> &#8211;no-create-home <span class=\"token parameter variable\">&#8211;shell<\/span> \/bin\/false node_exporter<\/p>\n<p>systemctl start node_exporter<br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> node_exporter<\/p>\n<p>\u624b\u52a8\u64cd\u4f5c\u8fd8\u597d&#xff0c;\u4f46\u662f\u4e00\u952e\u90e8\u7f72\u662f\u4e0d\u662f\u611f\u89c9\u5934\u90fd\u5927\u4e86&#xff1f;<\/p>\n<p>\u522b\u6025&#xff0c;\u6211\u8fd9\u8fb9\u5df2\u7ecf\u7814\u7a76\u597d\u5566&#xff01;\u53ea\u9700\u8981\u4f60\u590d\u5236\u7c98\u8d34&#xff0c;\u5c31\u80fd\u64cd\u4f5c\u6210\u529f&#xff01;<\/p>\n<p>\u7f16\u8f91hosts\u6587\u4ef6&#xff0c;\u52a0\u5165\u4f60\u6240\u8981\u76d1\u63a7\u7684ip\u548c\u4ed6\u7684\u7528\u6237\u540d\u53ca\u5bc6\u7801&#xff1a;<\/p>\n<p>[test]<br \/>\nip ansible_ssh_user&#061;\u7528\u6237\u540d ansible_ssh_pass&#061;\u5bc6\u7801<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223628-6a63e8ec797dc.png\" alt=\"image-20251210145736836\" \/><\/p>\n<p>\u7f16\u8f91\u547d\u4ee4yml\u6587\u4ef6&#xff1a;<\/p>\n<p>&#8212;<br \/>\n&#8211; name: \u5b89\u88c5node_exporter<br \/>\n  hosts: <span class=\"token builtin class-name\">test<\/span><br \/>\n  become: <span class=\"token function\">yes<\/span><br \/>\n  vars:<br \/>\n    node_exporter_version: <span class=\"token string\">&#034;1.8.2&#034;<\/span><br \/>\n    node_exporter_url: <span class=\"token string\">&#034;https:\/\/ghproxy.net\/https:\/\/github.com\/prometheus\/node_exporter\/releases\/download\/v{{ node_exporter_version }}\/node_exporter-{{ node_exporter_version }}.linux-amd64.tar.gz&#034;<\/span><br \/>\n    install_dir: <span class=\"token string\">&#034;\/shan&#034;<\/span><\/p>\n<p>  tasks:<br \/>\n    &#8211; name: \u521b\u5efa\u5b58\u50a8\u76ee\u5f55<br \/>\n      file:<br \/>\n        path: <span class=\"token string\">&#034;{{ install_dir }}&#034;<\/span><br \/>\n        state: directory<br \/>\n        mode: <span class=\"token string\">&#039;0755&#039;<\/span><\/p>\n<p>    &#8211; name: \u4e0b\u8f7dnode_exporter<br \/>\n      get_url:<br \/>\n        url: <span class=\"token string\">&#034;{{ node_exporter_url }}&#034;<\/span><br \/>\n        dest: <span class=\"token string\">&#034;{{ install_dir }}\/node_exporter.tar.gz&#034;<\/span><br \/>\n        mode: <span class=\"token string\">&#039;0644&#039;<\/span><br \/>\n        timeout: <span class=\"token number\">30<\/span><br \/>\n      retries: <span class=\"token number\">3<\/span><br \/>\n      delay: <span class=\"token number\">10<\/span><\/p>\n<p>    &#8211; name: \u89e3\u538bnode_exporter<br \/>\n      unarchive:<br \/>\n        src: <span class=\"token string\">&#034;{{ install_dir }}\/node_exporter.tar.gz&#034;<\/span><br \/>\n        dest: <span class=\"token string\">&#034;{{ install_dir }}&#034;<\/span><br \/>\n        remote_src: <span class=\"token function\">yes<\/span><\/p>\n<p>    &#8211; name: \u6e05\u7406\u538b\u7f29\u5305<br \/>\n      file:<br \/>\n        path: <span class=\"token string\">&#034;{{ install_dir }}\/node_exporter.tar.gz&#034;<\/span><br \/>\n        state: absent<\/p>\n<p>    &#8211; name: \u91cd\u547d\u540d\u89e3\u538b\u76ee\u5f55\u4e3a node_exporter<br \/>\n      command: <span class=\"token function\">mv<\/span> <span class=\"token string\">&#034;{{ install_dir }}\/node_exporter-{{ node_exporter_version }}.linux-amd64&#034;<\/span> <span class=\"token string\">&#034;{{ install_dir }}\/node_exporter&#034;<\/span><br \/>\n      args:<br \/>\n        creates: <span class=\"token string\">&#034;{{ install_dir }}\/node_exporter&#034;<\/span><\/p>\n<p>    &#8211; name: \u5220\u9664\u65e7\u76ee\u5f55<br \/>\n      file:<br \/>\n        path: <span class=\"token string\">&#034;{{ install_dir }}\/node_exporter-{{ node_exporter_version }}.linux-amd64&#034;<\/span><br \/>\n        state: absent<\/p>\n<p>    &#8211; name: \u521b\u5efa\u4e13\u7528\u7528\u6237<br \/>\n      user:<br \/>\n        name: node_exporter<br \/>\n        system: <span class=\"token function\">yes<\/span><br \/>\n        shell: \/sbin\/nologin<br \/>\n        createhome: no<\/p>\n<p>    &#8211; name: \u914d\u7f6esystemd\u670d\u52a1<br \/>\n      template:<br \/>\n        src: node_exporter.service.j2<br \/>\n        dest: \/etc\/systemd\/system\/node_exporter.service<br \/>\n        owner: root<br \/>\n        group: root<br \/>\n        mode: <span class=\"token string\">&#039;0644&#039;<\/span><\/p>\n<p>    &#8211; name: \u91cd\u8f7dsystemd\u914d\u7f6e<br \/>\n      systemd:<br \/>\n        daemon_reload: <span class=\"token function\">yes<\/span><\/p>\n<p>    &#8211; name: \u542f\u52a8\u5e76\u542f\u7528node_exporter\u670d\u52a1<br \/>\n      systemd:<br \/>\n        name: node_exporter<br \/>\n        enabled: <span class=\"token function\">yes<\/span><br \/>\n        state: started<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223628-6a63e8ec887af.png\" alt=\"image-20251210150904340\" \/><\/p>\n<p>\u7136\u540e\u4f7f\u7528ansible-playbook\u6267\u884c\u5c31\u597d\u5566&#xff1a;<\/p>\n<p>ansible-playbook node_exporter.yml<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223628-6a63e8ecefdf0.png\" alt=\"187b0e0638890dbc343cac3219973d45\" \/><\/p>\n<p>\u5207\u6362\u5230\u88ab\u5b89\u88c5\u7684IP\u4e0b&#xff0c;\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f&#xff1a;<\/p>\n<p>systemctl status node_exporter<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223629-6a63e8ed635ad.png\" alt=\"f8de645b4c9a1b645172edc4b92a983e\" \/><\/p>\n<p>\u81f3\u6b64\u6211\u4eec\u901a\u8fc7ansible\u914d\u7f6enode_exporter\u7b97\u662f\u6210\u529f\u5566&#xff01;<\/p>\n<p>\u6211\u4eec\u540e\u7eed\u53ef\u4ee5\u5728hosts\u6dfb\u52a0\u4e0a\u767e\u53f0\u4e3b\u673a\u7edf\u4e00\u5b89\u88c5\u3002<\/p>\n<p>\u90a3\u4e48\u95ee\u9898\u6765\u4e86&#xff0c;\u76ee\u524d\u6211\u4eec\u53ea\u662f\u5728\u7edf\u4e00\u5c40\u57df\u7f51\u4e0b\u53ef\u4ee5\u90e8\u7f72&#xff0c;\u90a3\u4e48\u6211\u4eec\u60f3\u90e8\u7f72\u5bb6\u91cc\u7535\u8111&#xff0c;\u60f3\u76d1\u63a7\u5bb6\u91cc\u7535\u8111\u7684\u6307\u6807\u600e\u4e48\u529e\u5462&#xff1f;\u522b\u6025&#xff0c;cpolar\u6765\u62ef\u6551\u4f60&#xff01;<\/p>\n<h3>3.\u5b89\u88c5cpolar\u5b9e\u73b0\u968f\u65f6\u968f\u5730\u5f00\u53d1<\/h3>\n<p>cpolar \u53ef\u4ee5\u5c06\u4f60\u672c\u5730\u7535\u8111\u4e2d\u7684\u670d\u52a1&#xff08;\u5982 SSH\u3001Web\u3001\u6570\u636e\u5e93&#xff09;\u6620\u5c04\u5230\u516c\u7f51\u3002\u5373\u4f7f\u4f60\u5728\u5bb6\u91cc\u6216\u5916\u51fa\u65f6&#xff0c;\u4e5f\u53ef\u4ee5\u901a\u8fc7\u516c\u7f51\u5730\u5740\u8fde\u63a5\u56de\u672c\u5730\u8fd0\u884c\u7684\u5f00\u53d1\u73af\u5883\u3002<\/p>\n<p>\u2764\ufe0f\u4ee5\u4e0b\u662f\u5b89\u88c5cpolar\u6b65\u9aa4&#xff1a;<\/p>\n<p>\u4f7f\u7528\u4e00\u952e\u811a\u672c\u5b89\u88c5\u547d\u4ee4&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">curl<\/span> https:\/\/get.cpolar.sh <span class=\"token operator\">|<\/span> <span class=\"token function\">sh<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223629-6a63e8ed99dd4.png\" alt=\"image-20250725104019896\" \/><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u6267\u884c\u4e0b\u65b9\u547d\u4ee4\u67e5\u770bcpolar\u670d\u52a1\u72b6\u6001&#xff1a;&#xff08;\u5982\u56fe\u6240\u793a\u5373\u4e3a\u6b63\u5e38\u542f\u52a8&#xff09;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl status cpolar<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223629-6a63e8eda7019.png\" alt=\"22e5adfaf290a17fc3384bb296055259\" \/><\/p>\n<p>Cpolar\u5b89\u88c5\u548c\u6210\u529f\u542f\u52a8\u670d\u52a1\u540e&#xff0c;\u5728\u6d4f\u89c8\u5668\u4e0a\u8f93\u5165\u865a\u62df\u673a\u4e3b\u673aIP\u52a09200\u7aef\u53e3\u5373:\u3010http:\/\/ip:9200\u3011\u8bbf\u95eeCpolar\u7ba1\u7406\u754c\u9762&#xff0c;\u4f7f\u7528Cpolar\u5b98\u7f51\u6ce8\u518c\u7684\u8d26\u53f7\u767b\u5f55,\u767b\u5f55\u540e\u5373\u53ef\u770b\u5230cpolar web \u914d\u7f6e\u754c\u9762,\u63a5\u4e0b\u6765\u5728web \u754c\u9762\u914d\u7f6e\u5373\u53ef&#xff1a;<\/p>\n<p>\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u672c\u57309200\u7aef\u53e3&#xff0c;\u4f7f\u7528cpolar\u8d26\u6237\u5bc6\u7801\u767b\u5f55\u5373\u53ef,\u767b\u5f55\u540e\u5373\u53ef\u5bf9\u96a7\u9053\u8fdb\u884c\u7ba1\u7406\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223629-6a63e8edbc8e5.png\" alt=\"8a6698b1bf26d64ba3645827fbfb1c29\" \/><\/p>\n<h3>4.\u914d\u7f6e\u516c\u7f51\u5730\u5740<\/h3>\n<p>\u901a\u8fc7\u914d\u7f6e&#xff0c;\u4f60\u53ef\u4ee5\u5728\u672c\u5730 WSL \u6216 Linux \u7cfb\u7edf\u4e0a\u8fd0\u884c SSH \u670d\u52a1&#xff0c;\u5e76\u901a\u8fc7 Cpolar \u5c06\u5176\u6620\u5c04\u5230\u516c\u7f51&#xff0c;\u4ece\u800c\u5b9e\u73b0\u4ece\u4efb\u610f\u8bbe\u5907\u8fdc\u7a0b\u8fde\u63a5\u5f00\u53d1\u73af\u5883\u7684\u76ee\u7684\u3002<\/p>\n<ul>\n<li>\u96a7\u9053\u540d\u79f0&#xff1a;\u53ef\u81ea\u5b9a\u4e49&#xff0c;\u672c\u4f8b\u4f7f\u7528\u4e86:ssh&#xff0c;\u6ce8\u610f\u4e0d\u8981\u4e0e\u5df2\u6709\u7684\u96a7\u9053\u540d\u79f0\u91cd\u590d<\/li>\n<li>\u534f\u8bae&#xff1a;tcp<\/li>\n<li>\u672c\u5730\u5730\u5740&#xff1a;22<\/li>\n<li>\u7aef\u53e3\u7c7b\u578b&#xff1a;\u968f\u673a\u4e34\u65f6TCP\u7aef\u53e3<\/li>\n<li>\u5730\u533a&#xff1a;China Top<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223630-6a63e8ee0b9eb.png\" alt=\"image-20251210155046672\" \/><\/p>\n<p>\u521b\u5efa\u6210\u529f\u540e&#xff0c;\u6253\u5f00\u5de6\u4fa7\u5728\u7ebf\u96a7\u9053\u5217\u8868,\u53ef\u4ee5\u770b\u5230\u521a\u521a\u901a\u8fc7\u521b\u5efa\u96a7\u9053\u751f\u6210\u4e86\u516c\u7f51\u5730\u5740&#xff0c;\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u5728\u5176\u4ed6\u7535\u8111\u6216\u8005\u79fb\u52a8\u7aef\u8bbe\u5907&#xff08;\u5f02\u5730&#xff09;\u4e0a&#xff0c;\u4f7f\u7528\u4efb\u610f\u4e00\u4e2a\u5730\u5740\u5728\u7ec8\u7aef\u4e2d\u8bbf\u95ee\u5373\u53ef\u3002<\/p>\n<ul>\n<li>\n<p>tcp \u8868\u793a\u4f7f\u7528\u7684\u534f\u8bae\u7c7b\u578b<\/p>\n<\/li>\n<li>\n<p>2.tcp.cpolar.top\u662f Cpolar \u63d0\u4f9b\u7684\u57df\u540d<\/p>\n<\/li>\n<li>\n<p>16198\u662f\u968f\u673a\u5206\u914d\u7684\u516c\u7f51\u7aef\u53e3\u53f7<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223630-6a63e8ee45561.png\" alt=\"image-20251210155148924\" \/><\/p>\n<p>\u901a\u8fc7 Cpolar \u63d0\u4f9b\u7684\u516c\u7f51\u5730\u5740\u548c\u7aef\u53e3&#xff0c;\u5c31\u53ef\u4ee5\u4f7f\u7528ansible\u8fdb\u884c\u8fdc\u7a0b\u90e8\u7f72\u5566&#xff01;<\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u64cd\u4f5c\u4e00\u4e0b\u3002<\/p>\n<p>\u4fee\u6539hosts\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token punctuation\">[<\/span>dbservers<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token number\">2<\/span>.tcp.cpolar.top <span class=\"token assign-left variable\">ansible_user<\/span><span class=\"token operator\">&#061;<\/span>root <span class=\"token assign-left variable\">ansible_port<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">16198<\/span> <span class=\"token assign-left variable\">ansible_password<\/span><span class=\"token operator\">&#061;<\/span>***<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223630-6a63e8ee8ab9f.png\" alt=\"image-20251210155413050\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u6267\u884c\u914d\u7f6enode_exporter\u6587\u4ef6&#xff1a;<\/p>\n<p>ansible-playbook node_exporter.yml<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223630-6a63e8ee93fb8.png\" alt=\"image-20251210155816696\" \/><\/p>\n<p>\u6267\u884c\u6210\u529f&#xff0c;\u6211\u4eec\u53bb\u5bf9\u5e94\u4e3b\u673a\u67e5\u770bnode_exporter\u670d\u52a1\u662f\u5426\u5f00\u542f\u6210\u529f&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223631-6a63e8ef097ad.png\" alt=\"image-20251210155932650\" \/><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u770b\u89c1&#xff0c;\u76ee\u6807\u4e3b\u673a\u5df2\u7ecf\u6210\u529f\u5b89\u88c5~<\/p>\n<h3>5.\u4fdd\u7559\u56fa\u5b9aTCP\u516c\u7f51\u5730\u5740<\/h3>\n<p>\u4f7f\u7528cpolar\u4e3a\u5176\u914d\u7f6eTCP\u5730\u5740&#xff0c;\u8be5\u5730\u5740\u4e3a\u56fa\u5b9a\u5730\u5740&#xff0c;\u4e0d\u4f1a\u968f\u673a\u53d8\u5316\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223631-6a63e8ef369a6.png\" alt=\"image-20251210160529622\" \/><\/p>\n<p>\u9009\u62e9\u533a\u57df\u548c\u63cf\u8ff0&#xff1a;\u6709\u4e00\u4e2a\u4e0b\u62c9\u83dc\u5355&#xff0c;\u5f53\u524d\u9009\u62e9\u7684\u662f\u201cChina VIP\u201d\u3002 \u53f3\u4fa7\u8f93\u5165\u6846&#xff0c;\u7528\u4e8e\u586b\u5199\u63cf\u8ff0\u4fe1\u606f\u3002 \u4fdd\u7559\u6309\u94ae&#xff1a;\u5728\u53f3\u4fa7\u6709\u4e00\u4e2a\u6a59\u8272\u7684\u201c\u4fdd\u7559\u201d\u6309\u94ae&#xff0c;\u70b9\u51fb\u8be5\u6309\u94ae\u53ef\u4ee5\u4fdd\u7559\u6240\u9009\u7684TCP\u5730\u5740\u3002 \u5217\u8868\u4e2d\u663e\u793a\u4e86\u4e00\u6761\u5df2\u4fdd\u7559\u7684TCP\u5730\u5740\u8bb0\u5f55\u3002<\/p>\n<ul>\n<li>\n<p>\u5730\u533a&#xff1a;\u663e\u793a\u4e3a\u201cChina VIP\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u5730\u5740&#xff1a;\u663e\u793a\u4e3a\u201c15.tcp.cpolar.top:13633\u201d\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223631-6a63e8ef7534d.png\" alt=\"image-20251210160555284\" \/><\/p>\n<\/li>\n<\/ul>\n<p>\u767b\u5f55cpolar web UI\u7ba1\u7406\u754c\u9762&#xff0c;\u70b9\u51fb\u5de6\u4fa7\u4eea\u8868\u76d8\u7684\u96a7\u9053\u7ba1\u7406\u2014\u2014\u96a7\u9053\u5217\u8868&#xff0c;\u627e\u5230\u6240\u8981\u914d\u7f6e\u7684\u96a7\u9053ssh&#xff0c;\u70b9\u51fb\u53f3\u4fa7\u7684\u7f16\u8f91\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223631-6a63e8ef8d0a2.png\" alt=\"image-20251210160639397\" \/><\/p>\n<p>\u4fee\u6539\u96a7\u9053\u4fe1\u606f&#xff0c;\u5c06\u4fdd\u7559\u6210\u529f\u7684TCP\u7aef\u53e3\u914d\u7f6e\u5230\u96a7\u9053\u4e2d\u3002<\/p>\n<ul>\n<li>\u7aef\u53e3\u7c7b\u578b&#xff1a;\u9009\u62e9\u56fa\u5b9aTCP\u7aef\u53e3<\/li>\n<li>\u9884\u7559\u7684TCP\u5730\u5740&#xff1a;\u586b\u5199\u4fdd\u7559\u6210\u529f\u7684TCP\u5730\u5740<\/li>\n<\/ul>\n<p>\u70b9\u51fb\u66f4\u65b0\u3002<\/p>\n<p><img decoding=\"async\" src=\"2026-07-2512eu1xg3qyo.png\" alt=\"image-20251210160618660\" \/><\/p>\n<p>\u521b\u5efa\u5b8c\u6210\u540e&#xff0c;\u6253\u5f00\u5728\u7ebf\u96a7\u9053\u5217\u8868&#xff0c;\u6b64\u65f6\u53ef\u4ee5\u770b\u5230\u968f\u673a\u7684\u516c\u7f51\u5730\u5740\u5df2\u7ecf\u53d1\u751f\u53d8\u5316&#xff0c;\u5730\u5740\u540d\u79f0\u4e5f\u53d8\u6210\u4e86\u4fdd\u7559\u548c\u56fa\u5b9a\u7684TCP\u5730\u5740\u3002<\/p>\n<p><img decoding=\"async\" src=\"2026-07-25j2majv0i045.png\" alt=\"image-20251210160652740\" \/><\/p>\n<p>\u8fd9\u6837\u6211\u4eec\u7684ansible\u64cd\u4f5c\u5c31\u6ca1\u6709\u4efb\u4f55\u7684\u963b\u788d\u5566&#xff01;<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u624b\u91cc\u53ea\u6709\u51e0\u53f0\u670d\u52a1\u5668\u7684\u65f6\u5019&#xff0c;\u9010\u53f0 SSH \u4e0a\u53bb\u88c5 Node Exporter \u4e0d\u662f\u4ec0\u4e48\u5927\u95ee\u9898\u3002\u4f46\u4e1a\u52a1\u4e00\u6269\u5f20&#xff0c;\u670d\u52a1\u5668\u4ece\u51e0\u53f0\u53d8\u6210\u51e0\u5341\u53f0\u3001\u4e0a\u767e\u53f0\u7684\u65f6\u5019&#xff0c;\u8fd9\u4e8b\u5c31\u5f00\u59cb\u53d8\u5473\u4e86\u2014\u2014\u624b\u52a8 SSH \u8fdb\u53bb\u3001\u6572\u547d\u4ee4\u3001\u786e\u8ba4\u670d\u52a1\u542f\u52a8&#xff0c;\u4e00\u5957\u6d41\u7a0b\u8d70\u4e0b\u6765\u53ef\u80fd\u5927\u534a\u5929\u5c31\u8fc7\u53bb\u4e86&#xff0c;\u800c\u4e14\u4e2d\u95f4\u8fd8\u5bb9\u6613\u51fa\u9519&#xff0c;\u88c5\u5b8c\u7684\u7248\u672c\u8fd8\u4e0d\u4e00\u5b9a\u7edf\u4e00\u3002\u8fd0\u7ef4\u56e2\u961f\u7a0d\u5fae\u5927\u4e00\u70b9&#xff0c;\u5149\u662f&#034;\u5927\u5bb6\u90fd\u5728\u88c5\u76d1\u63a7&#034;\u8fd9\u4ef6\u4e8b\u672c\u8eab\u5c31\u6210\u4e86\u4e00\u573a\u7ba1\u7406\u5669\u68a6\u3002<\/p>\n<p>Ansible \u5c31\u662f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u3002\u5b83\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u65e0\u4ee3\u7406\u7684\u81ea\u52a8\u5316\u8fd0\u7ef4\u5de5\u5177&#xff0c;\u57fa\u4e8e SSH \u8fde\u63a5&#xff0c;\u88ab\u63a7\u673a\u5668\u4e0a\u53ea\u8981\u6709 Python \u548c SSH \u5c31\u80fd\u8dd1&#xff0c;\u4e0d\u9700\u8981\u5728\u6bcf\u53f0\u673a\u5668\u4e0a\u88c5\u989d\u5916\u7684\u5ba2\u6237\u7aef\u3002\u5199\u597d\u4e00\u4e2a Playbook \u4e4b\u540e&#xff0c;\u4e00\u6761\u547d\u4ee4\u5c31\u80fd\u540c\u65f6\u5bf9\u6240\u6709\u76ee\u6807\u673a\u5668\u6267\u884c\u64cd\u4f5c&#xff0c;\u7248\u672c\u7edf\u4e00\u3001\u914d\u7f6e\u7edf\u4e00\u3001\u6267\u884c\u7ed3\u679c\u7edf\u4e00\u3002\u66f4\u91cd\u8981\u7684\u662f\u5b83\u7684\u5e42\u7b49\u6027\u2014\u2014\u91cd\u590d\u6267\u884c\u7ed3\u679c\u4e00\u81f4&#xff0c;\u6ca1\u88c5\u7684\u4f1a\u88c5&#xff0c;\u5df2\u88c5\u597d\u7684\u4e0d\u4f1a\u91cd\u590d\u64cd\u4f5c&#xff0c;\u4e0d\u4f1a\u56e0\u4e3a\u91cd\u590d\u6267\u884c\u628a\u73af\u5883\u5f04\u4e71\u3002\u7528 Ansible \u5199\u597d Node Exporter \u7684\u90e8\u7f72 Playbook \u4e4b\u540e&#xff0c;\u4e09\u5206\u949f\u4e4b\u5185\u53ef\u4ee5\u628a\u4e0a\u767e\u53f0\u670d\u52a1\u5668\u5168\u90e8\u7eb3\u7ba1&#xff0c;Prometheus \u90a3\u8fb9\u76f4\u63a5\u5c31\u80fd\u6293\u53d6\u5230\u6240\u6709\u4e3b\u673a\u7684\u76d1\u63a7\u6570\u636e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00<br \/>\n\u624b\u91cc\u53ea\u6709\u51e0\u53f0\u670d\u52a1\u5668\u7684\u65f6\u5019&#xff0c;\u9010\u53f0 SSH \u4e0a\u53bb\u88c5 Node Exporter \u4e0d\u662f\u4ec0\u4e48\u5927\u95ee\u9898\u3002\u4f46\u4e1a\u52a1\u4e00\u6269\u5f20&#xff0c;\u670d\u52a1\u5668\u4ece\u51e0\u53f0\u53d8\u6210\u51e0\u5341\u53f0\u3001\u4e0a\u767e\u53f0\u7684\u65f6\u5019&#xff0c;\u8fd9\u4e8b\u5c31\u5f00\u59cb\u53d8\u5473\u4e86\u2014\u2014\u624b\u52a8 SSH \u8fdb\u53bb\u3001\u6572\u547d\u4ee4\u3001\u786e\u8ba4\u670d\u52a1\u542f\u52a8&#xff0c;\u4e00\u5957\u6d41\u7a0b\u8d70\u4e0b\u6765\u53ef\u80fd\u5927\u534a\u5929\u5c31\u8fc7\u53bb\u4e86&#xff0c;\u800c\u4e14\u4e2d\u95f4\u8fd8\u5bb9\u6613\u51fa\u9519&#xff0c;\u88c5\u5b8c\u7684\u7248\u672c\u8fd8\u4e0d\u4e00\u5b9a\u7edf\u4e00\u3002\u8fd0\u7ef4\u56e2\u961f\u7a0d\u5fae\u5927\u4e00\u70b9&#xff0c;\u5149\u662f\\&#8221;\u5927\u5bb6\u90fd\u5728\u88c5\u76d1\u63a7\\&#8221;\u8fd9\u4ef6\u4e8b\u672c\u8eab\u5c31\u6210\u4e86\u4e00\u573a\u7ba1\u7406\u5669\u68a6\u3002<br \/>\nAnsible<\/p>\n","protected":false},"author":2,"featured_media":82068,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1064,43],"topic":[],"class_list":["post-82088","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ansible","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/82088.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u8a00 \u624b\u91cc\u53ea\u6709\u51e0\u53f0\u670d\u52a1\u5668\u7684\u65f6\u5019&#xff0c;\u9010\u53f0 SSH \u4e0a\u53bb\u88c5 Node Exporter \u4e0d\u662f\u4ec0\u4e48\u5927\u95ee\u9898\u3002\u4f46\u4e1a\u52a1\u4e00\u6269\u5f20&#xff0c;\u670d\u52a1\u5668\u4ece\u51e0\u53f0\u53d8\u6210\u51e0\u5341\u53f0\u3001\u4e0a\u767e\u53f0\u7684\u65f6\u5019&#xff0c;\u8fd9\u4e8b\u5c31\u5f00\u59cb\u53d8\u5473\u4e86\u2014\u2014\u624b\u52a8 SSH \u8fdb\u53bb\u3001\u6572\u547d\u4ee4\u3001\u786e\u8ba4\u670d\u52a1\u542f\u52a8&#xff0c;\u4e00\u5957\u6d41\u7a0b\u8d70\u4e0b\u6765\u53ef\u80fd\u5927\u534a\u5929\u5c31\u8fc7\u53bb\u4e86&#xff0c;\u800c\u4e14\u4e2d\u95f4\u8fd8\u5bb9\u6613\u51fa\u9519&#xff0c;\u88c5\u5b8c\u7684\u7248\u672c\u8fd8\u4e0d\u4e00\u5b9a\u7edf\u4e00\u3002\u8fd0\u7ef4\u56e2\u961f\u7a0d\u5fae\u5927\u4e00\u70b9&#xff0c;\u5149\u662f&quot;\u5927\u5bb6\u90fd\u5728\u88c5\u76d1\u63a7&quot;\u8fd9\u4ef6\u4e8b\u672c\u8eab\u5c31\u6210\u4e86\u4e00\u573a\u7ba1\u7406\u5669\u68a6\u3002 Ansible\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/82088.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-24T22:36:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223627-6a63e8ebe4b7e.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82088.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/82088.html\",\"name\":\"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-24T22:36:32+00:00\",\"dateModified\":\"2026-07-24T22:36:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/82088.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/82088.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82088.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/82088.html","og_locale":"zh_CN","og_type":"article","og_title":"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u8a00 \u624b\u91cc\u53ea\u6709\u51e0\u53f0\u670d\u52a1\u5668\u7684\u65f6\u5019&#xff0c;\u9010\u53f0 SSH \u4e0a\u53bb\u88c5 Node Exporter \u4e0d\u662f\u4ec0\u4e48\u5927\u95ee\u9898\u3002\u4f46\u4e1a\u52a1\u4e00\u6269\u5f20&#xff0c;\u670d\u52a1\u5668\u4ece\u51e0\u53f0\u53d8\u6210\u51e0\u5341\u53f0\u3001\u4e0a\u767e\u53f0\u7684\u65f6\u5019&#xff0c;\u8fd9\u4e8b\u5c31\u5f00\u59cb\u53d8\u5473\u4e86\u2014\u2014\u624b\u52a8 SSH \u8fdb\u53bb\u3001\u6572\u547d\u4ee4\u3001\u786e\u8ba4\u670d\u52a1\u542f\u52a8&#xff0c;\u4e00\u5957\u6d41\u7a0b\u8d70\u4e0b\u6765\u53ef\u80fd\u5927\u534a\u5929\u5c31\u8fc7\u53bb\u4e86&#xff0c;\u800c\u4e14\u4e2d\u95f4\u8fd8\u5bb9\u6613\u51fa\u9519&#xff0c;\u88c5\u5b8c\u7684\u7248\u672c\u8fd8\u4e0d\u4e00\u5b9a\u7edf\u4e00\u3002\u8fd0\u7ef4\u56e2\u961f\u7a0d\u5fae\u5927\u4e00\u70b9&#xff0c;\u5149\u662f\"\u5927\u5bb6\u90fd\u5728\u88c5\u76d1\u63a7\"\u8fd9\u4ef6\u4e8b\u672c\u8eab\u5c31\u6210\u4e86\u4e00\u573a\u7ba1\u7406\u5669\u68a6\u3002 Ansible","og_url":"https:\/\/www.wsisp.com\/helps\/82088.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-24T22:36:32+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260724223627-6a63e8ebe4b7e.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/82088.html","url":"https:\/\/www.wsisp.com\/helps\/82088.html","name":"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-24T22:36:32+00:00","dateModified":"2026-07-24T22:36:32+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/82088.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/82088.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/82088.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u670d\u52a1\u5668\u4e0a\u767e\u53f0\uff0cSSH\u9010\u53f0\u88c5\u76d1\u63a7\u5230\u7334\u5e74\u9a6c\u6708\uff1f\u6211\u7528Ansible\u4e09\u5206\u949f\u5168\u90e8\u641e\u5b9a"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=82088"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82088\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/82068"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=82088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=82088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=82088"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=82088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}