
⦁ prometheus 유저 생성 및 로그인
useradd -m -s /bin/bash prometheus
su - prometheus
⦁ wget으로 prometheus 설치 및 압축 해제, 폴더명 변경
wget https://github.com/prometheus/prometheus/releases/download/v2.36.1/prometheus-2.36.1.linux-amd64.tar.gz
tar -xvf prometheus-2.36.1.linux-amd64.tar.gz
mv prometheus-2.36.1.linux-amd64/ prometheus
⦁ 서비스 파일생성 및 시작
vi /etc/systemd/system/prometheus.service
- prometheus.service
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network-online.target
[Service]
User=prometheus
Restart=on-failure
ExecStart=/home/prometheus/prometheus/prometheus
--config.file=/home/prometheus/prometheus/prometheus.yml
--storage.tsdb.path=/home/prometheus/prometheus/data
[Install]
WantedBy=multi-user.target
⦁ 서비스 시작 및 enable
systemctl daemon-reload
systemctl start prometheus
systemctl status prometheus
systemctl enable prometheuset
⦁ 방화벽 설정// prometheus 포트 9090
firewall-cmd --permanent --zone=public --add-port=9090/tcp
firewall-cmd --reload
###오류
[root@2-prometheus-server prometheus]# systemctl start prometheus
[root@2-prometheus-server prometheus]# systemctl status prometheus
● prometheus.service - Prometheus Server
Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Mon 2024-05-13 08:32:59 GMT; 3s ago
Docs: https://prometheus.io/docs/introduction/overview/
Process: 20163 ExecStart=/home/prometheus/prometheus/prometheus (code=exited, status=2)
Main PID: 20163 (code=exited, status=2)
May 13 08:32:58 2-prometheus-server systemd[1]: Unit prometheus.service entered failed state.
May 13 08:32:58 2-prometheus-server systemd[1]: prometheus.service failed.
May 13 08:32:59 2-prometheus-server systemd[1]: prometheus.service holdoff time over, scheduling restart.
May 13 08:32:59 2-prometheus-server systemd[1]: Stopped Prometheus Server.
May 13 08:32:59 2-prometheus-server systemd[1]: start request repeated too quickly for prometheus.service
May 13 08:32:59 2-prometheus-server systemd[1]: Failed to start Prometheus Server.
May 13 08:32:59 2-prometheus-server systemd[1]: Unit prometheus.service entered failed state.
May 13 08:32:59 2-prometheus-server systemd[1]: prometheus.service failed.
나는 자꾸 에러가나서
설치폴더로 가서 직접 실행했다.
### 실행화면
'국비지원교육 > 클라우드' 카테고리의 다른 글
alertmanager 설치 후 슬랙 연동 (0) | 2024.05.13 |
---|---|
redmine에 node_exporter 설치 (0) | 2024.05.13 |
redmine 설치, mariaDB연동 (0) | 2024.05.13 |
mariaDB 설치 (0) | 2024.05.13 |
Redmine과 오픈소스 모니터링 연동 (0) | 2024.05.13 |