Promethues: initial installation of node_exporter

Introduction

In the operation and maintenance monitoring system, there is generally a program called an agent . It runs on the collected machine and is used to collect information about the machine or the service running on it. Commonly collected data include the machine's cpu, memory, disk, etc., or information about some common open source software running on it (such as the operating information of rocketmq). Here is a small program for collecting machine information: node_exporter , and promethues An agent used in conjunction.

background

Rocketmq is used as a middleware messaging system in the company's project. I used promethues+grafana as the monitoring of this system. Using exporter as a collector, I used node_exporter and rocketmq_exporter to collect the machine node information of rocketmq and the service information of rocketmq, respectively.

project address

node_exporter:https://github.com/prometheus/node_exporter/

method of obtaining

You can download the source code for local compilation or use the released binary package directly, here we directly use the release version of 1.0.0


#Download binary compressed package 
wget https://github.com/prometheus/node_exporter/releases/download/v1.0.0/node_exporter-1.0.0.linux-amd64.tar.gz #Unzip 
to /usr/local directory tar xzvf node_exporter-1.0.0.linux-amd64.tar.gz -C /usr/local/ #Rename 
after entering the /usr/local directory 
cd /usr/local 
mv node_exporter-1.0.0.linux-amd64 node_exporter

Configure systemd management

1) Execute: vi /etc/systemd/system/node_exporter.service, copy and paste the following

[Unit]

Description=node_exporter

After=network.target


[Service]

ExecStart=/usr/local/node_exporter/node_exporter

Restart=on-failure


[Install]

WantedBy=multi-user.target 

2) Configure startup


#Reload the configuration under systemd 
systemctl daemon-reload #Configure to start, if you want to turn off systemctl disable node_exporter 
systemctl enable node_exporter

3) Start and check node_exporter

#Start node_exporter 
systemctl start node_exporter 
#Check node_exporter status 
systemctl status node_exporter

4) View log

Execute: systemctl status node_exporter -l

So far, the node_exporter has been built on the collected machine. Later I will continue to share how to install rockermq-exporter on the machine and configure node_exporter in the promethues and grafana panels.

Blogger: Test to make money

Motto: Focus on testing and automation, and strive to improve R&D efficiency; through testing and diligence to complete the original accumulation, through reading and financial management to financial freedom.

csdn:https://blog.csdn.net/ccgshigao

Blog Park: https://www.cnblogs.com/qa-freeroad/

51cto :https://blog.51cto.com/14900374


Guess you like

Origin blog.51cto.com/14900374/2542691