The background,

Grafana was installed on a Mac system to monitor the data.

Two, installation steps

1. Install via Home Brew

Brew services start grafanaCopy the code

2. Install using binary packages

1, download

# downloadWget HTTP: / / https://dl.grafana.com/oss/release/grafana-7.4.3.darwin-amd64.tar.gz# decompressionThe tar - ZXVF grafana - 7.4.3. Darwin - amd64. Tar. GzCopy the code

Grafana configuration file path

The default configuration file is in $WORKING_DIR/conf/defaults.ini. Do not modify the content in this file. Our custom configuration file is in $WORKING_DIR/conf/custom.ini. 3, our custom configuration file can be used to specify the loading path through –config. 4, if we are on a Linux system by deb or RPM package installation, the default configuration file path in the/etc/grafana/grafana. Ini, and custom. The ini file

Modify grafana configuration

cp `$WORKING_DIR/conf/sample.ini` `$WORKING_DIR/conf/custom.ini`
Copy the code

1. Change the default port 3000

 http_port = 9099
Copy the code

2. Change the data storage directory and log file path

[paths]
Directory for storing temporary data
data = /var/lib/grafana
# Temporary file save time
temp_data_lifetime = 24h
# Directory for saving log files
logs = /var/log/grafana
Plugin save directory
plugins = /var/lib/grafana/plugins
Copy the code

3. Cancel the registration function on the page

[users]
# disable user signup / registration
allow_sign_up = false
Copy the code

4. Start grafana

#! /usr/binNohup/Users/huan/soft/Prometheus/grafana - 7.4.3 / bin/grafana - server \ - config"/ Users/huan/soft/Prometheus/grafana - 7.4.3 / conf/custom. Ini" \
-homepath "/ Users/huan/soft/Prometheus/grafana - 7.4.3" \
-pidfile "/ Users/huan/soft/Prometheus/grafana 7.4.3 / pid" web \
> logs/grafana.out 2>&1 &

Copy the code

1. Specify the path of the customized configuration file. 2, specify the path of homepath, otherwise the program will not start. 3. Specify the pid file path.

5. Visit Grafana

The default user name and password are admin and admin.

Display the Node-Exporter chart on Grafana

1. Create a data source

Import the Chart for Node-Exporter

1. Search for grafana

Open grafana.com/grafana/das…

2. Copy the chart ID

Grafana import chart

4. Look at charts

4. Reference links

Grafana download address 4. Search for graphs on Grafana