geth - 모니터링 붙이기

00_8_3·2023년 7월 20일
0

geth

목록 보기
2/3
post-thumbnail

필수

  • geth 설치.
  • 도커 설치

1 influxdb

문서에는 influxDB 1.x 버전으로 작성되어 있다.

2.x 버전은 기본적으로 gui가 제공된다. 나중에 바꾸자

version: "3.7"
services:
  influxdb:
    image: influxdb:1.8
    # image: bitnami/influxdb:2.0.7
    container_name: influxdb
    ports:
      - 8086:8086
      - 8085:8088
    environment:
      - INFLUXDB_ADMIN_USER_PASSWORD=admin
      - INFLUXDB_ADMIN_USER_TOKEN=admintoken123
      - INFLUXDB_USER=geth
      - INFLUXDB_USER_PASSWORD=geth1234gethgeth
      - INFLUXDB_HTTP_AUTH_ENABLED=false
      - INFLUXDB_DB=my_database
    volumes:
      - influxdb_data:/bitnami/influxdb
 
volumes:
  influxdb_data:

2 grafana

version: '3'

services:
  grafana:
    image: grafana/grafana
    ports:
      - 3000:3000
    volumes:
      - ./data:/var/lib/grafana
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=admin
    user: "${UID}:${GID}" // 설정 안하면 권한 문제로 내부 디렉토리가 mount 안됨.

3 prometheus

  • docker
version: '3'

services:
  prometheus:
    image: prom/prometheus
    ports:
      - 9090:9090
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
  • prometheus.yml
  global:
    scrape_interval: 15s
    evaluation_interval: 15s

  # Load and evaluate rules in this file every 'evaluation_interval' seconds.
  rule_files:
    - 'record.geth.rules.yml'

  # A scrape configuration containing exactly one endpoint to scrape.
  scrape_configs:
    - job_name: 'go-ethereum'
      scrape_interval: 10s
      metrics_path: /debug/metrics/prometheus
      static_configs:
        - targets:
            - '127.0.0.1:6060'
          labels:
            chain: ethereum

시작

위 도커 셋다 실행 후 프로메테우스 포트로 접근하면 gui 페이지 확인 가능.
초기 아이디 비밀번호는 admin

프로메테우스에서 제공하는 geth 대시보드를 import 해서 사용하자.

https://grafana.com/grafana/dashboards/13877-single-geth-dashboard/

알림도 된다고 한다. 나중에 해본다.

https://grafana.com/docs/grafana/latest/alerting/

참고

https://geth.ethereum.org/docs/monitoring/dashboards

1개의 댓글

comment-user-thumbnail
2023년 7월 20일

덕분에 좋은 정보 얻어갑니다, 감사합니다.

답글 달기