添加 READM.txt
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
#curl -s 127.0.0.1:9091/metrics | grep node_textfile_scrape_error
|
||||||
|
验证prom文件是否有格式问题
|
||||||
|
|
||||||
|
#node_exporter 配置文件
|
||||||
|
# 1. 强制覆盖 service 文件
|
||||||
|
cat > /etc/systemd/system/node_exporter.service << 'EOF'
|
||||||
|
[Unit]
|
||||||
|
Description=Node Exporter
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
ExecStart=/usr/local/bin/node_exporter --collector.textfile.directory=/opt/prom_textfile
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# 2. 必须重新加载配置
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
# 3. 强制重启
|
||||||
|
systemctl stop node_exporter
|
||||||
|
sleep 2
|
||||||
|
systemctl start node_exporter
|
||||||
|
|
||||||
|
# 4. 检查是否真的带了 textfile 参数
|
||||||
|
ps aux | grep node_exporter
|
||||||
|
|
||||||
|
|
||||||
|
第一步:先生成密钥(必须先做!)
|
||||||
|
打开 PowerShell,直接运行这条命令,全程按 3 次回车,什么都不用输入:
|
||||||
|
powershell
|
||||||
|
ssh-keygen -t rsa
|
||||||
|
✅ 出现下面的文字就成功了:
|
||||||
|
plaintext
|
||||||
|
Generating public/private rsa key pair.
|
||||||
|
第二步:再运行这条授权命令(这次一定成功)
|
||||||
|
powershell
|
||||||
|
Get-Content ~/.ssh/id_rsa.pub | ssh root@10.150.117.190 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
|
||||||
|
运行后只需要输入一次 Linux 密码,以后永远不用再输!
|
||||||
Reference in New Issue
Block a user