No history found.

README.md:

Install Prometheus on Centos7

Step 1 - Create a new User and Download Prometheus

Create a new user

useradd -m -s /bin/bash prometheus

Become prometheus user and download the software

su - prometheus
wget https://github.com/prometheus/prometheus/releases/download/v2.17.1/prometheus-2.17.1.linux-amd64.tar.gz

Extract the tarball and rename the directory

tar -xzvf prometheus-2.17.1.linux-amd64.tar.gz
mv -v prometheus-2.17.1.linux-amd64 prometheus

Step 2 - Configure Prometheus As a Systemd Service

cat << 'EOF' > /etc/systemd/system/prometheus.server
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network-online.target

[Service]
User=prometheus
Restart=on-failure

#Change this line if you download the 
#Prometheus on different path user
ExecStart=/home/prometheus/prometheus/prometheus \
  --config.file=/home/prometheus/prometheus/prometheus.yml \
  --storage.tsdb.path=/home/prometheus/prometheus/data

[Install]
WantedBy=multi-user.target

EOF

Reload systemd

systemctl daemon-reload

Start and enable Prometheus

systemctl start prometheus
systemctl enable prometheus

Check that everything is fine

systemctl status prometheus
netstat -plntu

Step 3 - Configure Firewalld

Open port 9090 for the Prometheus access using firewall-cmd commands below.

firewall-cmd --add-port=9090/tcp --permanent
firewall-cmd --reload

Step 4 - Install and Configure node_exporter

Download node_exporter

su - prometheus
wget https://github.com/prometheus/node_exporter/releases/download/v1.0.0-rc.0/node_exporter-1.0.0-rc.0.linux-amd64.tar.gz

extract node exporter and rename the directory

tar -xzvf /vagrant/node_exporter-1.0.0-rc.0.linux-amd64.tar.gz
mv node_exporter-1.0.0-rc.0.linux-amd64/ node_exporter

Create a new service for node_exporter

cd /etc/systemd/system/
cat << EOF >> node_exporter.service
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
ExecStart=/home/prometheus/node_exporter/node_exporter

[Install]
WantedBy=default.target
EOF

Reload systemd

systemctl daemon-reload

Enable and start the service

systemctl start node_exporter
systemctl enable node_exporter

Check that everything is fine

netstat -plntu

Step 5 - Add node_exporter to the Prometheus Server

Login to the prometheus user.

su - prometheus

Goto the 'prometheus' directory and edit the configuration file 'prometheus.yml'.

cd prometheus/
vim prometheus.yml

Under the 'scrape_config' line, add new job_name node_exporter by copy-pasting the configuration below.

 - job_name: 'node_exporter'
    static_configs:
      - targets: ['localhost:9100']

Restart the prometheus service

systemctl restart prometheus

Links

https://www.howtoforge.com/tutorial/how-to-install-prometheus-and-node-exporter-on-centos-7/

Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/arendina/prometheus_grafana

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/arendina/prometheus_grafana

Clone this repository using git:
git clone git://git.rocketgit.com/user/arendina/prometheus_grafana

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main