add: prometheus
This commit is contained in:
parent
f99fe37eff
commit
9707e6631e
10
prometheus/README.md
Normal file
10
prometheus/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# prometheus
|
||||
|
||||
## install prometheus
|
||||
|
||||
https://www.youtube.com/watch?app=desktop&v=yrscZ-kGc_Y&ab_channel=Techdox
|
||||
|
||||
## install node_exporter
|
||||
|
||||
wget https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz
|
||||
105
prometheus/node-exporter.md
Normal file
105
prometheus/node-exporter.md
Normal file
@ -0,0 +1,105 @@
|
||||
# Setting Up Node Exporter
|
||||
|
||||
## Download Node Exporter
|
||||
|
||||
Begin by downloading Node Exporter using the wget command:
|
||||
|
||||
```bash
|
||||
wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
|
||||
```
|
||||
|
||||
Note: Ensure you are using the latest version of Node Exporter and the correct architecture build for your server. The provided link is for amd64. For the latest releases, check here - Prometheus Node Exporter Releases
|
||||
|
||||
## Extract the Contents¶
|
||||
|
||||
After downloading, extract the contents with the following command:
|
||||
|
||||
```bash
|
||||
tar xvf node_exporter-1.7.0.linux-amd64.tar.gz
|
||||
```
|
||||
|
||||
## Move the Node Exporter Binary¶
|
||||
|
||||
Change to the directory and move the node_exporter binary to /usr/local/bin:
|
||||
|
||||
```bash
|
||||
cd node_exporter-1.7.0.linux-amd64
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo cp node_exporter /usr/local/bin
|
||||
```
|
||||
|
||||
Then, clean up by removing the downloaded tar file and its directory:
|
||||
|
||||
```bash
|
||||
rm -rf ./node_exporter-1.7.0.linux-amd64
|
||||
```
|
||||
|
||||
## Create a Node Exporter User¶
|
||||
|
||||
Create a dedicated user for running Node Exporter:
|
||||
```bash
|
||||
sudo useradd --no-create-home --shell /bin/false node_exporter
|
||||
```
|
||||
|
||||
Assign ownership permissions of the node_exporter binary to this user:
|
||||
```bash
|
||||
sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
|
||||
```
|
||||
|
||||
## Configure the Service¶
|
||||
|
||||
To ensure Node Exporter automatically starts on server reboot, configure the systemd service:
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/node_exporter.service
|
||||
```
|
||||
|
||||
Then, paste the following configuration:
|
||||
|
||||
```properties
|
||||
[Unit]
|
||||
Description=Node Exporter
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User=node_exporter
|
||||
Group=node_exporter
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/node_exporter
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Save and exit the editor.
|
||||
|
||||
## Enable and Start the Service¶
|
||||
|
||||
Reload the systemd daemon:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
Enable the Node Exporter service:
|
||||
```bash
|
||||
sudo systemctl enable node_exporter
|
||||
```
|
||||
|
||||
|
||||
Start the service:
|
||||
|
||||
```bash
|
||||
sudo systemctl start node_exporter
|
||||
```
|
||||
|
||||
To confirm the service is running properly, check its status:
|
||||
|
||||
```bash
|
||||
sudo systemctl status node_exporter.service
|
||||
```
|
||||
Loading…
Reference in New Issue
Block a user