-
[ Prometheus ] Install Prometheus on Amazon Linux 2Open Source 2022. 2. 19. 16:28
1. 서비스 계정용도로 Prometheus 계정 생성
sudo useradd --no-create-home --shell /bin/false prometheus
--no-create-home : 홈디렉토리를 생성하지 않는다.
--shell SHELL : 로그인 셀 지정2. configuration file과 libraries 디렉토리를 만들고, Prometheus 권한부여
sudo mkdir /etc/prometheus sudo mkdir /var/lib/prometheus sudo chown prometheus:prometheus /var/lib/prometheus
3. Prometheus 다운로드 ( 다운로드 )
cd /tmp/ wget https://github.com/prometheus/prometheus/releases/download/v2.33.3/prometheus-2.33.3.linux-amd64.tar.gz
* 버전을 확인 후 최신버전으로 다운로드
tar -xvf prometheus-2.33.3.linux-amd64.tar.gz cd prometheus-2.33.3.linux-amd64
4. configuration과 binaries File을 디렉토리 이동
sudo mv console* /etc/prometheus sudo mv prometheus.yml /etc/prometheus sudo chown -R prometheus:prometheus /etc/prometheus sudo mv prometheus /usr/local/bin/ sudo chown prometheus:prometheus /usr/local/bin/prometheus
5. Prometheus 서비스 등록 및 기동
sudo nano /etc/systemd/system/prometheus.service
아래와 같이 입력하고 ctrl + o 으로 저장 후 ctrl + x 로 종료
[Unit] Description=Prometheus Wants=network-online.target After=network-online.target [Service] User=prometheus Group=prometheus Type=simple ExecStart=/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 [Install] WantedBy=multi-user.target
sudo systemctl daemon-reload sudo systemctl enable prometheus sudo systemctl start prometheus
6. 서비스 접속
http://ip:9090
'Open Source' 카테고리의 다른 글
[ Zabbix ] Nginx Monitoring (0) 2022.10.21 [ Prometheus ] Install jmx_exporter on Amazon Linux 2 (0) 2022.03.05 [ Prometheus ] Install node_exporter on Amazon Linux 2 (systemctl) (0) 2022.02.20 [ BI Tool ] Apache superset install (docker) (0) 2021.11.30 [ Zabbix 5.0 ] Template DB MSSQL by ODBC Monitoring (0) 2021.04.05 [ Zabbix 5.0 ] Elasticsearch Cluster Monitoring (0) 2021.03.26 [ grafana ] https 접속을 위한 보안인증서 적용 (0) 2020.10.08 [ Zabbix ] Zabbix server is not running : the infomation displayed may not be current Problem (0) 2020.06.15