Update README.md

This commit is contained in:
Kris Sekula 2019-01-23 16:26:56 +01:00 committed by GitHub
parent cad8bec17d
commit c99db1b7bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 48 additions and 51 deletions

View File

@ -33,13 +33,13 @@ Here is an example of thos the graphs look like:
sudo chown prometheus:prometheus /etc/prometheus
sudo chown prometheus:prometheus /var/lib/prometheus
```
- download and extract:
```
* download and extract:
```
curl -LO https://github.com/prometheus/prometheus/releases/download/v2.6.1/prometheus-2.6.1.linux-amd64.tar.gz
tar xvf prometheus-2.6.1.linux-amd64.tar.gz
```
- copy files and change premissions:
```
```
* copy files and change premissions:
```
sudo cp prometheus-2.6.1.linux-amd64/prometheus /usr/local/bin/
sudo cp prometheus-2.6.1.linux-amd64/promtool /usr/local/bin/
sudo chown prometheus:prometheus /usr/local/bin/prometheus
@ -48,11 +48,11 @@ Here is an example of thos the graphs look like:
sudo cp -r prometheus-2.6.1.linux-amd64/console_libraries /etc/prometheus
sudo chown -R prometheus:prometheus /etc/prometheus/consoles
sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries
```
- configure prometheus:
```
```
* configure prometheus:
```
sudo vim /etc/prometheus/prometheus.yml
```
```
**Note:** watch out for formatting this is YAML, no TABs allowed, use two spaces instead.
```yaml
@ -70,21 +70,19 @@ scrape_configs:
labels:
service_name: hx_read_write_stats
```
- try to start prometheus:
* try to start prometheus:
```
sudo -u prometheus /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
- verfiy if it works:
```
* verfiy if it works:
http://localhost:9090/status
- if all good stop it:
* if all good stop it:
CTRL+C
- create prometheus service:
* create prometheus service:
```
sudo vim /etc/systemd/system/prometheus.service
```
@ -107,20 +105,19 @@ ExecStart=/usr/local/bin/prometheus \
[Install]
WantedBy=multi-user.target
```
- reload services:
* reload services:
```
sudo systemctl daemon-reload
```
- start Prometheus using the following command:
* start Prometheus using the following command:
```
sudo systemctl start prometheus
```
- check if Prometheus is running, check the service.s status.
* check if Prometheus is running, check the service.s status.
```
sudo systemctl status prometheus
```
- enable service:
* enable service:
```
sudo systemctl enable prometheus
```