Difference between revisions of "How To Install Prometheus in Linux from binaries"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 58: Line 58:
  
 
:<code>rm -rf prometheus-2.0.0.linux-amd64.tar.gz prometheus-2.0.0.linux-amd64</code>
 
:<code>rm -rf prometheus-2.0.0.linux-amd64.tar.gz prometheus-2.0.0.linux-amd64</code>
 +
 +
 +
== Related terms ==
 +
* [[Prometheus Installation]]
  
  
Line 67: Line 71:
 
[[Category:Server administration]]
 
[[Category:Server administration]]
 
[[Category:Monitoring]]
 
[[Category:Monitoring]]
 +
[[Category:Prometheus]]
  
  
 
{{CC license}} Source: wikiversity
 
{{CC license}} Source: wikiversity

Latest revision as of 06:38, 29 April 2021

Creating Service Users[edit]

  • Create these two users, and use the --no-create-home and --shell /bin/false options so that these users can't log into the server.
sudo useradd --no-create-home --shell /bin/false prometheus
sudo useradd --no-create-home --shell /bin/false node_exporter


  • Before we download the Prometheus binaries, create the necessary directories for storing Prometheus' files and data. Following standard Linux conventions, we'll create a directory in /etc for Prometheus' configuration files and a directory in /var/lib for its data.
sudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheus


  • Now, set the user and group ownership on the new directories to the prometheus user.
sudo chown prometheus:prometheus /etc/prometheus
sudo chown prometheus:prometheus /var/lib/prometheus

Downloading Prometheus[edit]

  • First, download and unpack the current stable version of Prometheus into your home directory.
curl -LO https://github.com/prometheus/prometheus/releases/download/v2.0.0/prometheus-2.0.0.linux-amd64.tar.gz


  • Now, unpack the downloaded archive.
tar xvf prometheus-2.0.0.linux-amd64.tar.gz


  • This will create a directory called prometheus-2.0.0.linux-amd64 containing two binary files (prometheus and promtool), consoles and console_libraries directories containing the web interface files, a license, a notice, and several example files.

Copy the two binaries to the /usr/local/bin directory.

sudo cp prometheus-2.0.0.linux-amd64/prometheus /usr/local/bin/
sudo cp prometheus-2.0.0.linux-amd64/promtool /usr/local/bin/


  • Set the user and group ownership on the binaries to the prometheus user created in Step 1.
sudo chown prometheus:prometheus /usr/local/bin/prometheus
sudo chown prometheus:prometheus /usr/local/bin/promtool


  • Copy the consoles and console_libraries directories to /etc/prometheus.
sudo cp -r prometheus-2.0.0.linux-amd64/consoles /etc/prometheus
sudo cp -r prometheus-2.0.0.linux-amd64/console_libraries /etc/prometheus


  • Set the user and group ownership on the directories to the prometheus user. Using the -R flag will ensure that ownership is set on the files inside the directory as well.
sudo chown -R prometheus:prometheus /etc/prometheus/consoles
sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries


  • Lastly, remove the leftover files from your home directory as they are no longer needed.
rm -rf prometheus-2.0.0.linux-amd64.tar.gz prometheus-2.0.0.linux-amd64


Related terms[edit]


See also[edit]


Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Source: wikiversity

Advertising: