GRAFANA_USER=grafana GRAFANA_GROUP=grafana GRAFANA_HOME=/usr/local/grafana LOG_DIR=/var/log/grafana DATA_DIR=/var/lib/grafana MAX_OPEN_FILES=10000 CONF_DIR=/etc/grafana CONF_FILE=/etc/grafana/grafana.ini RESTART_ON_UPGRADE=true PLUGINS_DIR=/var/lib/grafana/plugins PROVISIONING_CFG_DIR=/etc/grafana/provisioning # Only used on systemd systems PID_FILE_DIR=/var/run/grafana
1.8 systemd 管理脚本
vim /usr/lib/systemd/system/grafana-server.service
# Define Prometheus home and its version ARGPROMETHEUS_HOME=/opt/prometheus ARGPROMETHEUS_VERSION=2.47.0
# Define TAR & folder names, as well as download URL for easier use ARGPROMETHEUS_TAR_MAYOR=prometheus-${PROMETHEUS_VERSION}.linux-amd64 ARGPROMETHEUS_TAR_FULLNAME=${PROMETHEUS_TAR_MAYOR}.tar.gz ARGPROMETHEUS_URL=https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/${PROMETHEUS_TAR_FULLNAME}
# Untar the file and rename it to "prometheus" RUNtarxvfz${PROMETHEUS_TAR_FULLNAME}-C/opt&&\ mv/opt/${PROMETHEUS_TAR_MAYOR}/opt/prometheus&&\ rm-rf/opt/prometheus/prometheus.yml
# tar file and rename to "prometheus" RUNmkdir-p${PROMETHEUS_HOME} RUNtar-xzvf/opt/prometheus-2.49.0-rc.2.linux-amd64.tar.gz-C/usr/local/prometheus--strip-components=1