In the final tutorial of the Prometheus Integration learning path, we will upgrade all of our services installed in our application. This can be used for reference in the future as part of ongoing maintenance of your project, so be sure to bookmark this page.
Visit the Prometheus downloads page for the latest version. Copy the correct link and download the Prometheus binary to the server that you will upgrade Prometheus on.
wget \
https://github.com/prometheus/prometheus/releases/download/v2.18.0/prometheus-2.18.0.linux-amd64.tar.gz
Untar and move the downloaded Prometheus binary
tar -xvf prometheus-2.18.0.linux-amd64.tar.gz
mv prometheus-2.18.0.linux-amd64 prometheus-files
The executable that we're replacing is in use, so we need to stop the service so it can be replaced.
sudo systemctl stop prometheus.service
Copy prometheus
and promtool
binary from prometheus-files folder to /usr/bin
and change the ownership to prometheus user.
sudo cp prometheus-files/prometheus /usr/bin/
sudo cp prometheus-files/promtool /usr/bin/
sudo chown prometheus:prometheus /usr/bin/prometheus
sudo chown prometheus:prometheus /usr/bin/promtool
Move the consoles
and console_libraries
directories from prometheus-files
to /etc/prometheus
folder and change the ownership to prometheus user.
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
Restart the Prometheus service
sudo systemctl start prometheus.service
Remove the download and temporary files
rm -rf prometheus-2.18.0.linux-amd64.tar.gz prometheus-files
Visit the Prometheus downloads page for the latest version. Copy the correct link and download the Prometheus binary to the server that you will upgrade Prometheus on.
wget \
https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.darwin-amd64.tar.gz
Untar and move the downloaded Node Exporter binary
tar -xvf node_exporter-0.18.1.linux-amd64.tar.gz
mv node_exporter-0.18.1.linux-amd64 node_exporter-files
The executable that we're replacing is in use, so we need to stop the service so it can be replaced.
sudo systemctl stop node_exporter.service
Copy node_exporter
binary from node_exporter-files
folder to /usr/bin
and change the ownership to prometheus user.
sudo cp node_exporter-files/node_exporter /usr/bin/
sudo chown node_exporter:node_exporter /usr/bin/node_exporter
Restart the Node Exporter service
sudo systemctl start node_exporter.service
Remove the download and temporary files
rm -rf node_exporter-0.18.1.linux-amd64.tar.gz node_exporter-files
Visit the Prometheus downloads page for the latest version. Copy the correct link and download the Process Exporter binary to the server that you will upgrade.
wget \
https://github.com/ncabatoff/process-exporter/releases/download/v0.6.0/process-exporter-0.6.0.linux-amd64.tar.gz
Untar and move the downloaded Process Exporter binary
tar -xvf process-exporter-0.6.0.linux-amd64.tar.gz
mv process-exporter-0.6.0.linux-amd64 process_exporter-files
The executable that we're replacing is in use, so we need to stop the service so it can be replaced.
sudo systemctl stop process_exporter.service
Copy process_exporter
binary from process_exporter-files
folder to /usr/bin
and change the ownership to prometheus user.
sudo cp process_exporter-files/process-exporter /usr/bin/
sudo chown process_exporter:process_exporter /usr/bin/process-exporter
Restart the Node Exporter service
sudo systemctl start process_exporter.service
Remove the download and temporary files
rm -rf process-exporter-0.6.0.linux-amd64.tar.gz process_exporter-files
Download the Couchbase Exporter python code.
curl -L \
https://github.com/couchbaselabs/cbprometheus_python/tarball/master > \
couchbase_exporter.tar.gz
Untar and move the downloaded Couchbase Exporter code
mkdir -p couchbase_exporter
tar -xzf couchbase_exporter.tar.gz \
-C couchbase_exporter --strip-components=1
It is unlikely that the Python dependcies have changed, incase they have changed they'll need to be installed
sudo pip install -r ./couchbase_exporter/requirements
Copy couchbase_exporter
directory from couchbase_exporter
folder to /opt/couchbase_exporter
and change the ownership to the couchbase_exporter user.
sudo cp -R couchbase_exporter/* /opt/couchbase_exporter
sudo chown -R couchbase_exporter:couchbase_exporter /opt/couchbase_exporter
Restart the Node Exporter service
sudo systemctl restart emperor.uwsgi.service
Remove the download and temporary files
rm -rf couchbase_exporter*
Visit the Prometheus downloads page for the latest version. Copy the correct link and download the AlertManager binary to the server that you will upgrade.
wget \
https://github.com/prometheus/alertmanager/releases/download/v0.20.0/alertmanager-0.20.0.linux-amd64.tar.gz
Untar and move the downloaded Prometheus binary
tar -xvf alertmanager-0.20.0.linux-amd64.tar.gz
mv alertmanager-0.20.0.linux-amd64 alertmanager-files
The executable that we're replacing is in use, so we need to stop the service so it can be replaced.
sudo systemctl stop alertmanager.service
Copy prometheus
and promtool
binary from prometheus-files folder to /usr/bin
and change the ownership to prometheus user.
sudo cp prometheus-files/prometheus /usr/bin/
sudo cp prometheus-files/promtool /usr/bin/
sudo chown prometheus:prometheus /usr/bin/prometheus
sudo chown prometheus:prometheus /usr/bin/promtool
Copy alertmanager
and amtool
binary from alertmanager-files
folder to ``/usr/bin` and change the ownership to alertmanager user.
sudo cp alertmanager-files/alertmanager /usr/bin/
sudo cp alertmanager-files/amtool /usr/bin/
sudo chown alertmanager:alertmanager /usr/bin/alertmanager
sudo chown alertmanager:alertmanager /usr/bin/amtool
Restart the AlertManager service
sudo systemctl start alertmanager.service
Remove the download and temporary files
rm -rf alertmanager-files
For our final task, it's an easy one. WE can update Grafana with a simple Yum command and pat ourselves on the back for making through this rigourous but required setup and configuration.
sudo yum update grafana