• English日本語한국어
  • 로그인지금 시작하기

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

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하십시오.

문제 신고

아파치 플링크 통합

Apache Flink 대시보드를 사용하면 로그를 쉽게 추적하고 계측 소스를 주시하고 모든 애플리케이션 인스턴스의 가동 시간 및 가동 중지 시간에 대한 개요를 얻을 수 있습니다. 인프라 에이전트와 Prometheus OpenMetrics 통합으로 구축된 Flink OpenMetrics 엔드포인트 스크래핑을 활용하여 가장 중요한 모든 데이터를 한 곳에서 볼 수 있습니다.

Flink를 New Relic으로 설정하면 데이터가 이와 같은 대시보드에 바로 표시됩니다.

인프라 에이전트 설치

Flink 데이터를 New Relic으로 가져오기 전에 먼저 인프라 에이전트를 설치한 다음 Prometheus OpenMetrics를 설치하여 메트릭을 노출하십시오.

인프라 에이전트를 설치하는 방법에는 두 가지가 있습니다.

구성된 포트에서 메트릭을 노출하려면 Apache Flink prometheus jar 파일이 필요합니다. 이상적으로는 Apache Flink를 다운로드할 때 flink-metrics-prometheus-VERSION.jar 라는 파일이 아래 경로에 배치됩니다.

파일 경로: FLINK-DIRECTORY/plugins/metrics-prometheus/

flink 구성 파일을 업데이트하여 포트 9250-9260에서 메트릭을 노출합니다.

Apache Flink 구성 파일 경로: FLINK-DIRECTORY/conf/flink-conf.yaml

metrics.reporters: prom
metrics.reporter.prom.class: org.apache.flink.metrics.prometheus.PrometheusReporter
metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
metrics.reporter.prom.host: localhost
metrics.reporter.prom.port: 9250-9260

아래 명령에 따라 Apache Flink 클러스터를 시작합니다.

bash
$
./bin/start-cluster.sh

이제 아래 URL에서 측정항목을 볼 수 있습니다.

  • 작업 관리자 지표
http://YOUR_DOMAIN:9250
  • 작업 관리자 메트릭
http://YOUR_DOMAIN:9251

아래 명령을 실행하여 PC에서 실행 중인 다른 작업 관리자 포트가 있는지 교차 확인할 수도 있습니다.

sudo lsof -i -P -n | grep LISTEN

Apache Flink용 nri-prometheus 구성

먼저 아래 경로에 nri-prometheus-config.yml 이라는 파일을 생성합니다.

길: /etc/newrelic-infra/integrations.d

이제 아래 나열된 필드를 업데이트합니다.

  • Cluster_name: "YOUR_DESIRED_CLUSTER_NAME", 예: cluster_name: "apache_flink"
  • URL: ["http://YOUR_DOMAIN:9250", "http://YOUR_DOMAIN:9251"], 예: urls: ["http://localhost:9250", "http://localhost:9251"]

nri-prometheus-config.yml 파일은 다음과 같아야 합니다.

integrations:
- name: nri-prometheus
config:
standalone: false
# Defaults to true. When standalone is set to `false`, `nri-prometheus` requires an infrastructure agent to send data.
emitters: infra-sdk
# When running with infrastructure agent emitters will have to include infra-sdk
cluster_name: "YOUR_DESIRED_CLUSTER_NAME"
# Match the name of your cluster with the name seen in New Relic.
targets:
- description: "YOUR_DESIRED_DESCRIPTION_HERE"
urls: ["http://YOUR_DOMAIN:9250", "http://YOUR_DOMAIN:9251"]
# tls_config:
# ca_file_path: "/etc/etcd/etcd-client-ca.crt"
# cert_file_path: "/etc/etcd/etcd-client.crt"
# key_file_path: "/etc/etcd/etcd-client.key"
verbose: false
# Defaults to false. This determines whether or not the integration should run in verbose mode.
audit: false
# Defaults to false and does not include verbose mode. Audit mode logs the uncompressed data sent to New Relic and can lead to a high log volume.
# scrape_timeout: "YOUR_TIMEOUT_DURATION"
# `scrape_timeout` is not a mandatory configuration and defaults to 30s. The HTTP client timeout when fetching data from endpoints.
scrape_duration: "5s"
# worker_threads: 4
# `worker_threads` is not a mandatory configuration and defaults to `4` for clusters with more than 400 endpoints. Slowly increase the worker thread until scrape time falls between the desired `scrape_duration`. Note: Increasing this value too much results in huge memory consumption if too many metrics are scraped at once.
insecure_skip_verify: false
# Defaults to false. Determins if the integration should skip TLS verification or not.
timeout: 10s

수동으로 로그 전달 설정

로그 전달 문서를 사용하여 애플리케이션별 로그를 New Relic에 전달할 수 있습니다.

Linux 머신에 인프라 에이전트를 설치할 때 이름이 logging.yml 인 로그 파일이 /etc/newrelic-infra/logging.d/경로에 있어야 합니다.

위의 경로에서 로그 파일이 보이지 않으면 위의 로그 전달 문서에 따라 로그 파일을 생성해야 합니다.

다음은 아래와 유사한 로그 이름의 예입니다.

- name: flink-u1-taskexecutor-0-u1-VirtualBox.log

logging.yml 파일에 아래 스크립트를 추가하여 New Relic에 Apache Flink 로그를 보냅니다.

logs:
- name: flink-<REST_OF_THE_FILE_NAME>.log
file: <FLINK-DIRECTORY>/log/flink-<REST_OF_THE_FILE_NAME>.log
attributes:
logtype: flink_logs

New Relic 인프라 에이전트 다시 시작

데이터 읽기를 시작하기 전에 인프라 에이전트를 다시 시작하십시오.

Apache Flink라는 사전 빌드된 대시보드 템플릿을 사용하여 Apache Flink 지표를 모니터링하려면 다음 단계를 따르십시오.

  1. one.newrelic.com 으로 이동하여 + Add Data [+ 데이터 추가를]클릭합니다.
  2. 대시보드 탭을 클릭합니다.
  3. 검색 상자에서 Apache Flink 를검색합니다.
  4. Apache Flink 대시보드를 클릭하여 계정에 설치합니다.

위의 단계에 따라 애플리케이션이 통합되면 대시보드에 메트릭이 반영되어야 합니다.

Apache Flink 빠른 시작을 계측하고 메트릭 및 경고를 보려면 지금 설치 버튼을 클릭하여 Apache Flink Install now [빠른 시작] 페이지를 따를 수도 있습니다.

NRQL을 사용하여 데이터 쿼리

NRQL을 사용하여 데이터를 쿼리할 수 있습니다. 예를 들어 New Relic의 쿼리 빌더에서 완료된 총 체크포인트 수를 보려면 다음 NRQL 쿼리를 사용하십시오.

FROM Metric SELECT latest(flink_jobmanager_job_numberOfCompletedCheckpoints) AS 'Number of Completed Checkpoints'

다음은 뭐지?

Apache Flink 대시보드를 추가로 사용자 정의하려면 NRQL 쿼리 작성 및 관리에 대해 자세히 알아볼 수 있습니다. New Relic UI에서:

Copyright © 2024 New Relic Inc.

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