• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

문제 신고

노드 내보내기 통합

Linux 서버의 하드웨어 및 커널 지표를 모니터링하시겠습니까? 블루렐릭 원격 쓰기 통합과 Prometheus 노드 내보내기를 사용하면 이 작업을 수행할 수 있습니다. 이 두 프로그램을 Prometheus 모니터링 시스템과 결합하면 뉴렐릭으로 데이터를 보내 문제 해결, 해결에 사용할 수 있습니다.

여기에 나와 있는 지침은 Prometheus 가이드 노드 내보내기를 사용하여 Linux 호스트 메트릭 모니터링 을 기반으로 합니다. 해당 정보 중 일부를 반복하고 귀하의 데이터를 뉴렐릭으로 보내는 데 도움이 되는 단계로 확장하겠습니다.

전제 조건

시작하는 데 필요한 사항은 다음과 같습니다.

  • 리뷰하고 싶은 Linux 호스트를 결정하세요. 아래에서는 EC2, GCP 및 Azure 인스턴스의 Linux 서버에 대한 예를 보여줍니다.
  • Prometheus 모니터링 시스템을 설치했는지 확인하세요. 아직 다운로드하지 않았다면 Prometheus 사이트 에서 다운로드할 수 있습니다.

노드 내보내기 다운로드 및 시작

다음을 완료:

  1. 아래 명령을 사용하여 Node Importer를 다운로드하고 시작하세요. wget URL을 Prometheus 다운로드 페이지의 최신 URL로 바꾸세요.

    bash
    $
    # Note that <VERSION>, <OS>, and <ARCH> are placeholders.
    $
    wget https://github.com/prometheus/node_exporter/releases/download/v<VERSION>/node_exporter-<VERSION>.<OS>-<ARCH>.tar.gz
    $
    tar xvfz node_exporter-*.*-amd64.tar.gz
    $
    cd node_exporter-*.*-amd64
    $
    ./node_exporter
  2. 키보드 명령 CONTROL + zbg 사용하여 노드 내보내기가 백그라운드에서 실행되도록 설정합니다. 운영 환경에서는 이를 서비스로 설정하려고 합니다(예: systemd).

구성

Prometheus를 시작하기 전에 기본 prometheus.yml 설정 파일을 일부 변경해야 합니다. 아래의 기본 prometheus.yml 예제로 시작하여 나머지 섹션에 설정을 추가하겠습니다. 이러한 예제를 복사하여 설정 파일에 붙여넣을 수 있습니다.

job_namenode 로 설정됩니다.

# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: node

프로메테우스를 뉴렐릭에 연결하세요

prometheus.yml 에 아래 예의 remote_write 스니펫을 삽입합니다. 다음 사항에 유의하세요.

  • 이는 Prometheus v2.26 이상에 대한 스니펫입니다. 이전 버전을 사용하는 경우 기본 원격 쓰기 지침을 참조하세요.
  • YOUR_LICENSE_KEY 원하는 값으로 바꿔야 합니다.
  • global 섹션과 동일한 들여쓰기 수준으로 설정 파일 하단에 이를 삽입할 수 있습니다.
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: node
remote_write:
- url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=NodeExporter
authorization:
credentials: YOUR_LICENSE_KEY

Set up 목표, 목표

static_configs 트리거를 통해 정적으로 목표를 구성하거나 지원되는 서비스 검색 메커니즘 중 하나를 사용하여 동적 검색을 사용할 수 있습니다.

정적, 목표

새 주석 # Target setup 아래에서 정적 구성을 설정할 수 있습니다.

다이나믹한 목표, 목표

정적, 목표를 구성하는 대신 서비스 검색을 구성할 수 있습니다.

호스트와 APM 관계 설정

이 Linux 서버에서 APM 에이전트를 사용하여 앱을 모니터링하는 경우 뉴렐릭에서 관계 기능을 활성화하기 위한 몇 가지 추가 설정을 해야 합니다. 이러한 기능은 호스트와 앱 간의 관계에 따라 달라집니다.

관계에는 Prometheus에서 기본적으로 삭제되는 속성이 필요합니다. 이 문제를 해결하려면 구성 파일의 relabel_configs 스탠자를 통해 이를 포함할 수 있습니다.

Prometheus 설정 페이지의 해당 sd_config 아래에서 사용 가능한 모든 메타 속성을 볼 수 있습니다.

아래 예에서는 동적 검색과 라벨의 조합을 보여줍니다. 정적 타격, 목표를 사용하는 경우 위에 표시된 정적 타격, 목표를 삽입하면 됩니다.

프로메테우스 시작

이제 Prometheus 스크레이퍼를 시작할 수 있습니다.

  1. 다음을 실행합니다.

    ./prometheus --config.file=./prometheus.yml
  2. 키보드 명령 CONTROL + zbg 사용하여 스크레이퍼가 백그라운드에서 실행되도록 설정합니다. 환경에서는 이를 서비스로 설정하려고 합니다(예: systemd).

  3. one.newrelic.com > Infrastructure > Hosts 로으로 이동하여 뉴렐릭 UI에서 데이터를 확인하세요.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.