wget https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz tar xf node_exporter-1.5.0.linux-amd64.tar.gz rm -rf /usr/local/node_exporter mv node_exporter-1.5.0.linux-amd64 /usr/local/node_exporter mkdir -p /usr/lib/systemd/system/ cat > /usr/lib/systemd/system/node_exporter.service << EOF [Unit] Description=node_exporter [Service] Restart=on-failure WorkingDirectory=/usr/local/node_exporter ExecStart=/usr/local/node_exporter/node_exporter [Install] WantedBy=multi-user.target EOF systemctl enable node_exporter systemctl start node_exporter systemctl status node_exporter # docker部署方式 yum install -y yum-utils yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo yum install -y docker-ce-19.03.9 docker-ce-cli-19.03.9 containerd.io docker-compose mkdir -p /etc/docker/ cat >/etc/docker/daemon.json <<EOF { "log-driver":"json-file", "log-opts": {"max-size":"200m", "max-file":"10"} } EOF cat /etc/docker/daemon.json systemctl enable docker && systemctl start docker cat >/node_exporter <<EOF #!/bin/bash docker run --name node-exporter -d --restart=always -p "19100:9100" -v "/proc:/host/proc:ro" -v "/sys:/host/sys:ro" -v "/:/rootfs:ro" prom/node-exporter docker ps -a | grep node-exporter exit 0 EOF chmod +x /node_exporter cd / && ./node_exporter
标签:node,1.5,exporter,tar,部署,usr,linux From: https://www.cnblogs.com/huanglingfa/p/17298962.html