当前位置:网站首页>Systemctl start Prometheus + grafana environment
Systemctl start Prometheus + grafana environment
2022-04-23 03:02:00 【Yang Linwei】
01 The configuration file
stay /usr/lib/systemd/system New directory 4 Configuration files , Respectively :
① pushgateway.service file , The contents are as follows :
[Unit]
Description=Prometheus Push Gateway
After=network.target
[Service]
ExecStart=/opt/prometheus_env/pushgateway-1.4.2.linux-amd64/pushgateway
User=root
[Install]
WantedBy=multi-user.target
② node_exporter.service file , The contents are as follows :
[Unit]
Description=Prometheus Node Exporter
After=network.target
[Service]
ExecStart=/opt/prometheus_env/node_exporter-1.3.1.linux-amd64/node_exporter
User=root
[Install]
WantedBy=multi-user.target
③ prometheus.service file , The contents are as follows :
[Unit]
Description=Prometheus Service
After=network.target
[Service]
ExecStart=/opt/prometheus_env/prometheus-2.34.0.linux-amd64/prometheus \
--config.file=/opt/prometheus_env/prometheus-2.34.0.linux-amd64/prometheus.yml \
--web.read-timeout=5m \
--web.max-connections=10 \
--storage.tsdb.retention=15d \
--storage.tsdb.path=/prometheus/data \
--query.max-concurrency=20 \
--query.timeout=2m
User=root
[Install]
WantedBy=multi-user.target
④ grafana.service file , The contents are as follows :
[Unit]
Description=Grafana
After=network.target
[Service]
ExecStart=/opt/prometheus_env/grafana-8.4.7/bin/grafana-server \
--config=/opt/prometheus_env/grafana-8.4.7/conf/defaults.ini \
--homepath=/opt/prometheus_env/grafana-8.4.7
[Install]
WantedBy=multi-user.target
02 systemctl command
Overload configuration :
systemctl daemon-reload
Opening service :
systemctl start pushgateway
systemctl start node_exporter
systemctl start prometheus
systemctl start grafana
Set boot up :
systemctl enable pushgateway
systemctl enable node_exporter
systemctl enable prometheus
systemctl enable grafana
View service status :
systemctl status pushgateway
03 Other commands
Open port , Can be accessed by browser ( For example, turn on :3000)
firewall-cmd --zone=public --add-port=3000/tcp --permanent
service iptables restart :
firewall-cmd --reload
版权声明
本文为[Yang Linwei]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220632523315.html
边栏推荐
- Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (8)
- Get together to watch (detailed version) eat a few cents a day
- Assembly learning Chapter III of assembly language (Third Edition) written by Wang Shuang
- Winsock programming interface experiment: Ping
- The space between the left and right of the movie ticket seats is empty and cannot be selected
- 樹莓派開發筆記(十二):入手研華ADVANTECH工控樹莓派UNO-220套件(一):介紹和運行系統
- SQL statement - DDL
- Golden nine silver ten interview season, you are welcome to take away the interview questions (with detailed answer analysis)
- Introduction to ACM [TSP problem]
- Cherno_ Game engine series tutorial (5): 101~
猜你喜欢

The way to conquer C language

微软是如何解决 PC 端程序多开问题的——内部实现

JS learning notes

ele之Table表格的封装

Opencv fills the rectangle with a transparent color

Introduction and use of openfeign component

Dynamic sequence table + OJ

Development notes of raspberry pie (12): start Advantech industrial control raspberry pie uno-220 Kit (I): introduction and operation of the system

Deep q-network (dqn)

Source code and some understanding of employee management system based on polymorphism
随机推荐
Q-Learning & Sarsa
Opencv fills the rectangle with a transparent color
Onenet connection process
tf. keras. layers. Embedding function
Shell script learning notes - regular expressions
JSON data text
Array and collection types passed by openfeign parameters
Introduction to ACM [TSP problem]
JS relearning
Shell learning notes -- shell processing of output stream awk
最通俗易懂的依赖注入之生命周期
Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (9)
Source code and some understanding of employee management system based on polymorphism
HLS / chisel uses CORDIC hyperbolic system to realize square root calculation
Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (10)
最通俗易懂的依赖注入之服务容器与作用域
eventBus
Encapsulation of ele table
Winsock programming interface experiment: implementation of ipconfig
BLDC double closed loop (speed PI + current PI) Simulink simulation model