Notes
Notes - notes.io |
From: Syed, Shanawaz - Dell Team
Sent: Monday, January 13, 2020 9:02 PM
To: Navaneeth, Rajesh
Cc: Anuj Kumar, Gupta; N, Bhaskaran; Prasad3, Guru; M, Akash - Dell Team
Subject: Installation Steps Linux - Prometheus, Grafana, Postgres, TimeScale, Prometheus Postgres Adapter
Hi Rajesh,
Please find the below installation steps on (AUSULCFO2AP01.us.dell.com)
Prometheus:
sudo yum update -y
sudo useradd --no-create-home --shell /bin/false prometheus
sudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheus
sudo chown prometheus:prometheus /etc/prometheus
sudo chown prometheus:prometheus /var/lib/prometheus
curl -LO https://github.com/prometheus/prometheus/releases/download/v2.15.2/prometheus-2.15.2.linux-amd64.tar.gz
tar -xvf prometheus-2.15.2.linux-amd64.tar.gz
mv prometheus-2.15.2.linux-amd64 prometheus-files
sudo cp prometheus-files/prometheus /usr/local/bin/
sudo cp prometheus-files/promtool /usr/local/bin/
sudo chown prometheus:prometheus /usr/local/bin/prometheus
sudo chown prometheus:prometheus /usr/local/bin/promtool
sudo cp -r prometheus-files/consoles /etc/prometheus
sudo cp -r prometheus-files/console_libraries /etc/prometheus
sudo chown -R prometheus:prometheus /etc/prometheus/consoles
sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries
sudo vi /etc/prometheus/prometheus.yml
please copy the following configuration to the prometheus.yml file:
----------------file content starts----------------
global:
scrape_interval: 10s
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
-----------------file content stops------------------
sudo chown prometheus:prometheus /etc/prometheus/prometheus.yml
sudo vi /etc/systemd/system/prometheus.service
please copy and past the below content to prometheus.service file:
-----------------file content starts------------------
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus
--config.file /etc/prometheus/prometheus.yml
--storage.tsdb.path /var/lib/prometheus/
--web.console.templates=/etc/prometheus/consoles
--web.console.libraries=/etc/prometheus/console_libraries
[Install]
WantedBy=multi-user.target
-----------------file content stops------------------
sudo systemctl daemon-reload
sudo systemctl start prometheus
To check the status:
sudo systemctl status prometheus
Grafana:
echo 'deb https://packagecloud.io/grafana/stable/debian/ jessie main' > /etc/apt/sources.list.d/grafana.list
curl https://packagecloud.io/gpg.key | sudo apt-key add -
sudo apt update
sudo apt install grafana
systemctl daemon-reload
systemctl start grafana-server
systemctl enable grafana-server
By default, Grafana will run under port 3000. Check it using the netstat command and make sure that the port 3000 is on the 'LISTEN' state list.
netstat -plntu
If you have the UFW firewall installed on the server, open the ssh service port, grafana port 3000, and then start the firewall using the following commands.
ufw allow ssh
ufw allow 3000/tcp
ufw enable
Type 'y' to continue to start and add UFW to run automatically at boot time.
To see the firewall status, run the command below.
ufw status
to instal pie-chart plugin:
wget -nv https://grafana.com/api/plugins/grafana-piechart-panel/versions/latest/download -O /tmp/grafana-piechart-panel.zip
unzip -q /tmp/grafana-piechart-panel.zip -d /tmp
mv /tmp/grafana-piechart-panel-* /var/lib/grafana/plugins/grafana-piechart-panel
sudo service grafana-server restart
Install of both TimescaleDB and PostgreSQL via yum :
curl -O https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
rpm -ivh pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
wget https://timescalereleases.blob.core.windows.net/rpm/timescaledb-0.12.1-postgresql-9.6-0.x86_64.rpm
sudo yum install timescaledb-0.12.1-postgresql-9.6-0.x86_64
The usual location of postgres.conf is /var/lib/pgsql/9.6/data/postgresql.conf for PostgreSQL 9.6
please Modify postgresql.conf to uncomment this line and add required libraries.
shared_preload_libraries = 'timescaledb'
Downloading Adapter:
wget https://github.com/timescale/prometheus-postgresql-adapter/releases/download/v0.6.0/prometheus-postgresql-adapter-0.6.0-linux-amd64.tar.gz
Starting Adapter:
./prometheus-postgresql-adapter -log.level=debug -leader-election.pg-advisory-lock-id=1 -leader-election.pg-advisory-lock.prometheus-timeout=6s
Note:
The above steps has been referred from below resources.
https://devopscube.com/install-configure-prometheus-linux/
https://www.howtoforge.com/tutorial/how-to-install-grafana-on-linux-servers/
https://docs.timescale.com/v0.12/getting-started/installation/linux/installation-docker#prometheus-docker
https://blog.timescale.com/blog/prometheus-ha-postgresql-8de68d19b6f5/
Thanks and Regards,
Shanawaz Syed
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team