1

Stackdriver 모니터링과 모니터링 에이전트로 Google Dataproc 클러스터를 설정할 때마다 Dataproc이 작업을 수행 할 때마다 Stackdriver가 연결을 잃어 버렸습니다. 스택 드라이버 UI에서 대기 시간 값은 대부분의 경우 2 분보다 길어서는 안됩니다. 이 값은 내가 일을 제출 한 후 (종종 수 시간이 걸렸을뿐) Compute Engine 웹 페이지에서 볼 수없는 측정 항목이없는 단순한 시간입니다.Google Stackdriver가 Dataproc에 연결되지 않음

dataproc에서 스택 드라이버 모니터링을 사용할 수있는 방법이 있습니까? 가능한 경우 내 작업의 RAM 사용을 모니터 할 수 있기를 원합니다.

Stackdriver 모니터링은 조직에서 실행 및 설정했지만 모든 기능에 대한 액세스 권한이있는 것으로 보입니다. 우리는 HTTP 프록시를 사용하지 않습니다. 모니터링 에이전트는 Google's documentation에있는 명령을 사용하여 설정됩니다. 인 gsutil 복사 명령 지나지 않는다 "다른 초기화 거즈"

#!/bin/bash 
cd /tmp 
curl -O "https://repo.stackdriver.com/stack-install.sh" 
bash stack-install.sh --write-gcm 
# ... other initialization stuffs 

편집 : I는 다음과 같습니다 마스터와 근로자 모두에 대해 실행되는 시작 스크립트 (--initialization - 액션 플래그)가 차이가 나는 경우 로컬 컴퓨터에 일부 리소스 파일을 가져옵니다.

나는 다른 명령 다음에 에이전트 설치를 이동하려고 시도했지만 Google은 파일을 복사 할 때 절대 경로를 사용할 것을 권장하기 때문에/tmp만을 사용합니다 (문서가 어디에 있는지 잊어 버렸지만 이전에 도움이되었습니다).

다음은 stackdriver에서 무엇을보고 있는지 요청한 스크린 샷입니다. CPU 사용을 제외한 모든 메트릭이 수직선에서 어떻게 멈추는 지 확인하십시오. grep stackdriver-agent /var/logs/syslog

Stackdriver screenshot

결과 :

Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: Starting Stackdriver metrics collection agent: stackdriver-agentoption = Hostname; value = 3431688934917455875; 
Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: option = Interval; value = 60.000000; 
Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: Created new plugin context. 
Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: option = PIDFile; value = /var/run/stackdriver-agent.pid; 
Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: option = Hostname; value = 3431688934917455875; 
Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: option = Interval; value = 60.000000; 
Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: Created new plugin context. 
Sep 2 13:31:53 <cluster-name>-m stackdriver-agent[3609]: . 
Sep 2 13:31:56 <cluster-name>-m stackdriver-agent[3823]: Stopping Stackdriver metrics collection agent: stackdriver-agent. 
Sep 2 13:31:56 <cluster-name>-m stackdriver-agent[3842]: Starting Stackdriver metrics collection agent: stackdriver-agentoption = Interval; value = 60.000000; 
Sep 2 13:31:56 <cluster-name>-m stackdriver-agent[3842]: Created new plugin context. 
Sep 2 13:31:56 <cluster-name>-m stackdriver-agent[3842]: option = PIDFile; value = /var/run/stackdriver-agent.pid; 
Sep 2 13:31:56 <cluster-name>-m stackdriver-agent[3842]: option = Interval; value = 60.000000; 
Sep 2 13:31:56 <cluster-name>-m stackdriver-agent[3842]: Created new plugin context. 
Sep 2 13:31:56 <cluster-name>-m stackdriver-agent[3842]: . 

편집 : 전체 클러스터 생성 명령은 다음과 같습니다

gcloud dataproc clusters create <cluster-name> --master-machine-type n1-highmem-2 --worker-machine-type n1-highmem-2 --initialization-actions <path-to-script> --master-boot-disk-size 50GB --worker-boot-disk-size 50GB --num-workers 16 --network internal --zone us-east1-c --scopes https://www.googleapis.com/auth/cloud-platform --project <project-name> --tags dataproc 

dataproc 태그가 열립니다 작업이 오늘 촉발 제출 된 때이다 내 조직의 모든 포트에 방화벽을 설치하십시오. sudo ps wwaux | grep stackdriver-agent

stackdriver-agent.service  active running 
LSB: start and stop Stackdriver Agent 

결과 :

root  3851 0.0 0.0 1004704 9096 ?  Ssl 12:50 0:00 /opt/stackdriver/collectd/sbin/stackdriver-collectd -C 
/opt/stackdriver/collectd/etc/collectd.conf -P /var/run/stackdriver-agent.pid 
7053 0.0 0.0 12732 2068 pts/0 S+ 13:14 0:00 grep stackdriver-agent 
+0

어떻게 당신이 모니터링 스택 드라이버를 설정 : 플러스 https://www.googleapis.com/auth/monitoring.write는 작업 제출 등을 통해 내 테스트 프로젝트에서 일 당신의 모니터링 에이전트? UI에서보고있는 스크린 샷을 공유 할 수있는 기회가 있습니까? –

+0

더 많은 정보가 필요하다면 원래의 글을 편집 해주세요. – jbird

+0

클러스터를 계속 사용하게되면'grep stackdriver-agent/var/log/syslog'를 확인할 수 있습니까? –

답변

0

내가 당신의 단계 중 일부를 repro'd, 내가 수 없지만 internal 네트워크는 sudo systemctl | grep stackdriver-agent의보다 나은 default

결과 일 밝혀졌다 당신이 직업을 제출할 때까지 모니터가 "작동"하는 것처럼 보일지도 모른다고 말하십시오. 이것이 Dataproc의 내부를 디버깅하지 않고 지침을 적용하려고 할 때 가장 먼저 한 일이기 때문에, Stackdriver-agent가 메트릭을 API에 쓸 수있게하려면 Dataproc 클러스터에 올바른 범위를 지정해야합니다. 즉, 다음은 같은 초기화 조치를 유지, 날 위해 일하는 것 같았다 :

gcloud dataproc clusters create dhuo-stackdriver \ 
    --initialization-actions gs://<my-bucket>/install_stackdriver.sh \ 
    --scopes https://www.googleapis.com/auth/monitoring.write 

을 양자 택일로, 당신은 더 넓은 cloud-platform 범위로 Stackdriver documentation에 나와있는 다른 범위를 사용할 수 있습니다.

#!/bin/bash 
cd /tmp 
curl -O "https://repo.stackdriver.com/stack-install.sh" 
bash stack-install.sh --write-gcm 

:는 init 작업으로 당신의 조각과

https://www.googleapis.com/auth/bigquery 
https://www.googleapis.com/auth/bigtable.admin.table 
https://www.googleapis.com/auth/bigtable.data 
https://www.googleapis.com/auth/devstorage.full_control 

내 로컬 테스트 :이 더 사용자 지정 범위를 사용하지 않는 경우 일반적으로 추가 된 다른 기본 범위의 유지 mixin을 오버라이드 (override) 할 수 있습니다

Stackdriver page for Dataproc cluster

+0

필자는'--scopes https : // www.googleapis.com/auth/cloud-platform'을 사용하여 클러스터를 생성해야한다고 언급 했어야합니다. 명시 적으로 쓰기 권한을 정의하는 것이 도움이된다고 생각하지 않는 한 이미 있어야합니다. – jbird