vi /etc/systemd/system/prometheus.service
[Unit]
Description=prometheus
After=network.target
[Service]
ExecStart=/home/prometheus/prometheus-2.4.3.linux-amd64/prometheus --config.file=/home/prometheus/prometheus-2.4.3.linux-amd64//prometheus.yml --storage.tsdb.path=/home/prometheus/prometheus-2.4.3.linux-amd64/data
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start prometheus.service
systemctl status prometheus.service
systemctl enable prometheus.service
vi /etc/systemd/system/node_exporter.service
[Unit]
Description=node_exporter Monitoring System
Documentation=node_exporter Monitoring System
[Service]
ExecStart=/usr/local/nodexeporter/node_exporter-1.3.1.linux-amd64/node_exporter --web.listen-address=:9100
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start node_exporter.service
systemctl status node_exporter.service
systemctl enable node_exporter.service