KEMBAR78
오픈소스 모니터링 알아보기(Learn about opensource monitoring) | PDF
오픈소스 모니터링 알아보기
- Grafana w/Prometheus, Graphite
Any Cloud. One Experience.
© 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
2020-03-30
NetApp Korea / Technology and Solutions Group
SeungYong Baek
Agenda
1. 테스트 환경 구성
2. Grafana, Graphite, Prometheus?
3. 구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus
4. 구성 2 – Kubernetes 클러스터 모니터링 with Grafana, Prometheus
5. 구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
© 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
테스트 환경 구성
VMware Workstation 구성
3 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
구분 서버 1 서버 2 스토리지
공통
▪ VM on VMWare Workstation
▪ IP: 192.168.232.130
▪ OS: Ubuntu 18.04
▪ hostname: ubuntu-osm
▪ VM on VMWare Workstation
▪ IP: 192.168.232.131
▪ OS: Ubuntu 18.04
▪ hostname: ubuntu-k8s
▪ VM on VMWare Workstation
▪ IP: 192.168.232.129
▪ OS: ONTAP 9.6
▪ Cluster: ONTAP96
구성 1 – 노드 ▪ Role: Grafana, Prometheus ▪ Role: Prometheus - Node Exporter ▪ Role: N/A
구성 2 – Kubernetes ▪ Role: N/A
▪ Role: Grafana, Prometheus in K8S
▪ K8S on MiniKube
▪ Role: N/A
구성 3 – 넷앱 스토리지 ▪ Role: Grafana, Graphite, Harvest ▪ Role: N/A ▪ Role: Storage
Grafana, Graphite, Prometheus?
4 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
IT Technology Trend?
정말 많은 기술들이 정말 빠르게 다가오고 있다.
5 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
Smart City, Smart Home, Smart Car,
Smart Factory, Smart Something...
IoT, AI, Edge AI, 5G, Cloud, …
Hyper-Scale, Hyper-Speed, Hyper-Connected
디지털 환경과 데이터의 변화
디지털 환경의 데이터와 복잡성은 급격히 증가
6 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
▪ 서로 간에 상호 연결이 가능한 IoT와 Non-IoT 디바이스의 수와 시장은 급격히 팽창하고 있다.
▪ 2022년 부터는 IoT 디바이스의 수가 Non-IoT 디바이스의 수보다 많아질 것이다.
▪ 그리고, Non-IoT 디바이스는 점점 더 가상화 되고 세분화 되고 복잡해 지고 있다.
▪ 결론적으로, IoT 또는 Non-IoT 디바이스의 구분이 없이, Hyper-Connected 디지털 환경은, 더 복잡해지고 데이터는 더욱 더 많아진다.
디지털 환경과 데이터의 변화
디지털 환경과 데이터의 변화 사례
7 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
반도체 생산 공정
▪ 센서/장비: 200~700개
▪ 장비/생산라인: 1,000대
▪ 센서 데이터/초: 1건
▪ 센서/장비: 500개 가정
▪ 센서 데이터/초: 50만 건
▪ 센서 데이터/달: 1.3조 건
만약,
▪ 센서 데이터/ 0.1초: 1건
▪ 보관일: 90일
▪ 센서 데이터/달: 38.8조 건
Fleet Management
▪ 보잉 737/년: 2.5 ZB * 100대 = ???
▪ 자율주행 자동차/일: 4TB * 100만대 = ???
▪ 자율주행 자동차/일: 17TB * 100만대 = ???
20TB * 2 엔진 * ? * ? * 1년 = 2.5ZB / 보잉 737
디지털 환경과 데이터의 변화
디지털 환경과 데이터의 변화 사례
8 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
Kubernetes Cluster
▪ Node/Cluster: 5
▪ Metrics/CPU: 80
▪ CPU/Node: 16
▪ Metrics/Memory: 51
▪ Metrics/FileSystem: 135
▪ Metrics/Networking: 320
▪ Metrics/VirtualMemory: 136
▪ Metrics/Socket, Timer: 32
▪ ……..
Container in Cluster
▪ Metrics/Cluster: 1,186
▪ Metrics/Containers: ???
▪ Metrics/Applications: ???
▪ ……..
노드 데이터/일: 66,528,000 건
컨테이너 데이터/일: 20,494,080 건
DBMS 트렌드 – DB-Engines.com
디지털 데이터의 변화
지속적인 데이터 관리 패러다임의 변화
9 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
Relational DBMS * 검색 엔진 / 분산 처리 NoSQL * Time Series DBMS *
정형 데이터 비정형, 반정형 데이터 시계열 데이터
* : Grafana 연동 가능
모니터링 구성 및 데모
10 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus
Prometheus 아키텍처
11 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus
구성 수순 #1
12 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
1. Grafana 설치
* Debian/Ubuntu - OSS release
* 설치 참고 사이트
https://grafana.com/grafana/download
https://grafana.com/docs/grafana/latest/installation/debian/
* Docker, 바이너리 패키지(.deb, .rpm), .tar.gz 버전도 있음
ubuntu-osm$ sudo apt install -y apt-transport-https
ubuntu-osm$ sudo apt install -y software-properties-common wget
ubuntu-osm$ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
ubuntu-osm$ sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
ubuntu-osm$ sudo apt update
ubuntu-osm$ sudo apt install grafana
2. Grafana 활성화 및 실행
ubuntu-osm$ sudo systemctl daemon-reload
ubuntu-osm$ sudo systemctl start grafana-server
ubuntu-osm$ sudo systemctl status grafana-server
ubuntu-osm$ sudo systemctl enable grafana-server.service
3. Grafana 접속 및 확인
* Getting Started
https://grafana.com/docs/grafana/latest/guides/getting_started/
* 웹 GUI 접속
http://192.168.232.130:3000/
구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus
구성 수순 #2
13 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
4. Prometheus 설치
* Ubuntu 18.04 리파지터리에서 제공
ubuntu-osm$ sudo apt install prometheus
* 서비스 활성화 확인
ubuntu-osm$ sudo systemctl status prometheus
ubuntu-osm$ sudo systemctl is-enabled prometheus.service
5. Prometheus 접속 및 확인
* 웹 GUI 접속
http://192.168.232.130:9090/
* 기본으로 등록된 prometheus 타겟 확인
* prometheus가 설치된 노드가 추가 되어 있음
http://192.168.232.130:9090/targets
* prometheus가 설치된 노드에서 모니터링 가능한 메트릭 확인
http://192.168.232.130:9090/metrics
구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus
구성 수순 #3
14 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
6. 기본 그래프 그려 보기
* 그래프 창에 아래의 쿼리를 입력하여 그래프가 잘 그려지는지 확인
rate(node_cpu{mode="system"}[1m])
7. Prometheus와 Grafana 연결
* Grafana에서 데이터 소스 추가
8. 대시보드 임포트 및 확인
* 초기 대시보드를 자체적으로 만드는 것은 조금 어려움
* Grafana 사이트 가입하고 메트릭에 맞는 대시보드 검색
* 적절한 대시보드 json 파일 다운로드 또는 ID를 입력
* node-exporter 버전에 따라 대시보드 호환성 확인 필요
https://grafana.com/grafana/dashboards
* Grafana에서 제공되는 기본 대시보드를 임포트해 사용
* 다운로드 받은 json을 업로드
http://192.168.232.130:3000/dashboard/import
구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus
구성 수순 #3
15 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
6. 기본 그래프 그려 보기
* 그래프 창에 아래의 쿼리를 입력하여 그래프가 잘 그려지는지 확인
rate(node_cpu{mode="system"}[1m])
7. Prometheus와 Grafana 연결
* Grafana에서 데이터 소스 추가
8. 대시보드 임포트 및 확인
* 초기 대시보드를 자체적으로 만드는 것은 조금 어려움
* Grafana 사이트 가입하고 메트릭에 맞는 대시보드 검색
* 적절한 대시보드 json 파일 다운로드 또는 ID를 입력
* node-exporter 버전에 따라 대시보드 호환성 확인 필요
https://grafana.com/grafana/dashboards
* Grafana에서 제공되는 기본 대시보드를 임포트해 사용
* 다운로드 받은 json을 업로드
http://192.168.232.130:3000/dashboard/import
구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus
구성 수순 #4
16 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
9. 추가 관리 대상 호스트 추가
* node-exporter 설치, node-exporter는 관리 대상인 호스트에서 데이터를 보내주는 모듈
* 관리 대상 호스트에는 모두 설치해야 하며, 이 데모는 minikube가 설치된 호스트를 타겟으로 함
ubuntu-k8s$ sudo apt install prometheus-node-exporter
ubuntu-osm$ sudo vi /etc/prometheus/prometheus.yml
* 아래 노드 메트릭 수정 - 노드 추가
* /etc/prometheus/prometheus.yml
----------------------------------------------------------------------------
- job_name: node
# If prometheus-node-exporter is installed, grab stats about the local
# machine by default.
static_configs:
- targets: ['localhost:9100', '192.168.232.131:9100']
----------------------------------------------------------------------------
* prometheus 서비스 재 로드
ubuntu-osm$ sudo systemctl reload prometheus.service
* grafana 대시보드에서 추가된 노드 모니터링 확인
http://192.168.232.130:3000/
구성 2 – Kubernetes 클러스터 모니터링 with Grafana, Prometheus
Prometheus and Grafana in Kubernetes
17 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
▪ Kubernetes 클러스터 모니터링은 아래의 2가지로 가능
▪ Grafana와 Prometheus를 K8S 클러스터 내에 구성 또는 Federation을 이용한 외부의 Prometheus 연동
▪ K8S 클러스터에 설치하는 것이 가장 쉬우며, Federation의 가장 복잡한 부분은 네트워크의 연동
구성 2 – Kubernetes 클러스터 모니터링 with Grafana, Prometheus
구성 수순 #1
18 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
1. kubectl 및 minikube 업그레이드
* minikue 설치 또는 업그레이드가 필요하며, 이 데모는 기존 버전 업그레이드로 진행
ubuntu-k8s$ sudo minikube stop
ubuntu-k8s$ sudo minikube delete
ubuntu-k8s$ sudo kubectl version
ubuntu-k8s$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
ubuntu-k8s$ chmod +x ./kubectl
ubuntu-k8s$ sudo mv ./kubectl /usr/local/bin/
ubuntu-k8s$ sudo kubectl version
ubuntu-k8s$ sudo minikube version
ubuntu-k8s$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-
linux-amd64
ubuntu-k8s$ chmod +x minikube
ubuntu-k8s$ sudo mv ./minikube /usr/local/bin/
ubuntu-k8s$ sudo minikube version
ubuntu-k8s$ sudo minikube start --vm-driver=none
ubuntu-k8s$ sudo chown -R $USER $HOME/.kube $HOME/.minikube
2. HELM 설치
* HELM 다운로드 및 설치
https://github.com/helm/helm/releases
https://helm.sh/docs/intro/quickstart/
ubuntu-k8s$ tar xvzf helm-v3.0.3-linux-amd64.tar.gz
ubuntu-k8s$ sudo mv helm /usr/local/bin/
ubuntu-k8s$ sudo helm repo add stable https://kubernetes-charts.storage.googleapis.com/
ubuntu-k8s$ sudo helm search repo stable
* HELM 챠트 다운로드
ubuntu-k8s$ git clone https://github.com/helm/charts.git
구성 2 – Kubernetes 클러스터 모니터링 with Grafana, Prometheus
구성 수순 #2
19 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
3. Prometheus 설치 in minikube
* 노드에 설치된 node-exporter 때문에, K8S내의 exporter에서 이슈가 발생함
* 노드에 설치된 exporter는 삭제 해 줌
ubuntu-k8s$ sudo apt purge prometheus-node-exporter
ubuntu-k8s$ sudo kubectl create namespace prometheus
ubuntu-k8s$ cd charts/stable/prometheus
ubuntu-k8s$ sudo helm install prometheus stable/prometheus -f values.yaml --namespace
prometheus
* 파드에 구성이 되었기 때문에, K8S 클러스터 네트워크로 접속이 가능
* prometheus-server 서비스의 IP를 확인하고 웹 브라우저로 접속
ubuntu-k8s$ sudo kubectl get service --all-namespaces
* 클러스터 네트워크를 사용하지 않을 경우 포트 포워딩하여 로컬 호스트에서 접근
ubuntu-k8s$ export POD_NAME=$(kubectl get pods --namespace prometheus -l
"app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")
ubuntu-k8s$ sudo kubectl --namespace prometheus port-forward $POD_NAME 9090
* 하기의 에러 메시지 발생 시에는 패키지 추가 설치
E0214 11:43:21.906268 51591 portforward.go:400] an error occurred forwarding 9090 -> 9090:
error forwarding port 9090 to pod
a1d83b392a0806385a92619f9354446122e6adc86ba0e3afc578eb01bfb5d73b, uid : unable to do
port forwarding: socat not found
ubuntu-k8s$ sudo apt install socat
* 웹 브라우저로 확인
http://xxx.xxx.xxxx.xxx → prometheus-server 서비스의 IP
구성 2 – Kubernetes 클러스터 모니터링 with Grafana, Prometheus
구성 수순 #3
20 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
4. Grafana 설치 in minikube
ubuntu-k8s$ sudo kubectl create namespace grafana
ubuntu-k8s$ cd charts/stable/grafana
* 설치하기 전에, values.yaml 파일에서 adminPassword 비밀번호 설정
ubuntu-k8s$ sudo helm install grafana stable/grafana -f values.yaml --namespace grafana
* 클러스터 네트워크 확인
ubuntu-k8s$ sudo kubectl get service --all-namespaces
* 웹 브라우저로 접근 및 대시보드 확인
* 노드 모니터링 환경에서 했던 것과 동일하게 구성 및 내용 확인
* 데이터 소스 추가, 대시 보드 임포트
http://xxx.xxx.xxxx.xxx → Grafana 서비스의 IP
* K8S로 생성된 컨테이너의 쉘 접근 하기
ubuntu-k8s$ sudo kubectl exec -it prometheus-server-746dd86648-9xj4r -n prometheus -- sh
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
NetApp Harvest 아키텍처
21 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #1
22 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
* Grafana, Graphite를 통해서는 성능만 모니터링 가능하며 용량은 OnCommand 필요
* NetApp Harvest, NMSDK(NetApp Manageability SDK) 다운로드 및 호스트 업로드
- https://mysupport.netapp.com/tools/index.html
- https://mysupport.netapp.com/NOW/cgi-bin/software/
* NetApp Harvest Installation and Administration Guide 1.6 참고 필요
1. 넷앱 패키지 설치
ubuntu-osm$ sudo apt -y install unzip perl libjson-perl libwww-perl
ubuntu-osm$ sudo apt -y install libxml-parser-perl
ubuntu-osm$ sudo apt -y install liblwp-protocol-https-perl
ubuntu-osm$ sudo apt -y install libexcel-writer-xlsx-perl
* harvest 설치
ubuntu-osm$ unzip netapp-harvest_1.6.zip
ubuntu-osm$ sudo dpkg -i netapp-harvest_1.6_all.deb
* NMSDK 설치
ubuntu-osm$ sudo unzip -j netapp-manageability-sdk-9.6.zip netapp-manageability-sdk-
9.6/lib/perl/NetApp/* -d /opt/netapp-harvest/lib
ubuntu-osm$ sudo systemctl daemon-reload
ubuntu-osm$ sudo systemctl enable netapp-harvest
2. ONTAP 구성
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname
"version"
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname
"cluster identity show"
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname
"cluster show"
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname
"system node show"
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname
"statistics"
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "lun
show"
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname
"network interface show"
ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "qos
workload show"
ONTAP96> security login create -user-or-group-name netapp-harvest -application ontapi -role
netapp-harvest-role -authmethod password
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #2
23 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
3. Graphite 설치
* 도커 기반 설치
ubuntu-osm$ sudo apt install docker.io
ubuntu-osm$ sudo docker run -d 
--name graphite 
--restart=always 
-p 80:80 
-p 2003-2004:2003-2004 
-p 2023-2024:2023-2024 
-p 8125:8125/udp 
-p 8126:8126 
graphiteapp/graphite-statsd
ubuntu-osm$ sudo docker ps -a
* graphite 웹 접속 및 확인
http://192.168.232.130
* 기타 docker 관련 명령어
* 아래 처럼 중지, 시작을 해도 도커에 구성된 config는 유지됨
ubuntu-osm$ sudo docker stop graphite → 컨테이너 중지
ubuntu-osm$ sudo docker start graphite → 컨테이너 시작
* 컨테이너 삭제하고 다시 run 하면 config도 다시 해야 함
ubuntu-osm$ sudo docker rm graphite → 컨테이너 삭제
* 컨테이너에 구성한 config를 유지하고 싶으면 새로운 이미지 생성 필요
ubuntu-osm$ sudo docker commit
또는 Dockerfile 사용
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #3
24 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
4. Harvest 환경 설정
* harvest.conf 수정
ubuntu-osm$ sudo cd /opt/netapp-harvest
ubuntu-osm$ sudo cp netapp-harvest.conf.example netapp-harvest.conf
ubuntu-osm$ sudo chown netapp-harvest:netapp-harvest netapp-harvest.conf
ubuntu-osm$ sudo vi netapp-harvest.conf
* 아래의 사항 수정
* [default] 수정 및 [ONTAP96] 모니터링 대상 수정 - [global] API 키는 추후에 등록 예정
* /opt/netapp-harvest/netapp-harvest.conf
----------------------------------------------------------------------------
##
[global]
grafana_api_key =
eyJrIjoibzVJa1k4dnBZTG03d0JMa1pJZmpWaEtsTFlDRDAzT3IiLCJuIjoibmV0YXBwLWhhcnZlc3
QiLCJpZCI6MX0=
grafana_url = http://localhost:3000
##
#### Default section to set defaults for any user created poller section
##
[default]
graphite_server = 192.168.232.130
username = netapp-harvest
password = mypassword
##
#### Poller sections; Add one section for each cDOT cluster, 7-mode node, or OCUM server
#### If any keys are different from those in default duplicate them in the poller section to override.
##
#
[INSERT_CLUSTER_OR_CONTROLLER_NAME_HERE_EXACTLY_AS_SHOWN_FROM_CLI_P
ROMPT]
[ONTAP96]
hostname = 192.168.232.129
group = ONTAP9
----------------------------------------------------------------------------
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #4
25 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
5. Graphite 환경 설정
* 컨테이너로 만들었기 때문에, 컨테이너 쉘 접근 필요
ubuntu-osm$ sudo docker exec -it graphite sh
* storage-schemas.conf 수정
docker/ # vi /opt/graphite/conf/storage-schemas.conf
* netapp_perf 항목 추가, /opt/graphite/conf/storage-schemas.conf
----------------------------------------------------------------------------
[carbon]
pattern = ^carbon.
retentions = 10s:6h,1m:90d
[netapp_perf]
pattern = ^netapp(.poller)?.perf7?.
retentions = 1m:35d,5m:100d,15m:395d,1h:5y
[default_1min_for_1day]
pattern = .*
retentions = 10s:6h,1m:6d,10m:1800d
----------------------------------------------------------------------------
* carbon.conf 수정
docker/ # vi /opt/graphite/conf/carbon.conf
* 아래 옵션으로 수정 - 50 → 600
* /opt/graphite/conf/carbon.conf
----------------------------------------------------------------------------
MAX_CREATES_PER_MINUTE = 600
----------------------------------------------------------------------------
* 서비스 재시작을 위해서 컨테이너 재기동
ubuntu-osm$ sudo docker stop graphite
ubuntu-osm$ sudo docker start graphite
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #5
26 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
6. Grafana에서 API Key 생성 및 등록
* Grafana에서 키 생성 및 등록
* "4. Harvest 환경 설정"과 같이 netapp-harvest.conf에 등록
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #6
27 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
7. Harvest 기동
* 아래의 netapp-manager, netapp-worker 수동으로 시작하는 것은 최초 설치시 한번만 함
* 설치 완료 후에는 systemd에 의해서 netapp-harvest라는 서비스로 자동으로 시작 됨
* netapp-manager, netapp-worker 기동
ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -status
ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -start
ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -status
* 결과 로그
----------------------------------------------------------------------------
STATUS POLLER GROUP
############### #################### ##################
[RUNNING] ONTAP96 ONTAP9
----------------------------------------------------------------------------
ubuntu-osm$ sudo /opt/netapp-harvest/netapp-worker -poller ONTAP96 &
* 결과 로그
----------------------------------------------------------------------------
[2020-02-19 11:08:51] [NORMAL ] WORKER STARTED [Version: 1.6] [Conf: netapp-harvest.conf]
[Poller: ONTAP96]
[2020-02-19 11:08:51] [NORMAL ] [main] Poller will monitor a [FILER] at [192.168.232.129:443]
[2020-02-19 11:08:51] [NORMAL ] [main] Poller will use [password] authentication with username
[netapp-harvest] and password [**********]
---- 중략 ----
[2020-02-19 11:08:52] [NORMAL ] [main] Startup complete. Polling for new data every [60]
seconds.
----------------------------------------------------------------------------
* netapp-harvest 서비스 시작 및 중지
ubuntu-osm$ sudo systemctl stop netapp-harvest
ubuntu-osm$ sudo systemctl start netapp-harvest
* 로그 파일 위치 - 에러 발생시 확인
/opt/netapp-harvest/log
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #7
28 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
8. Graphite 데이터 수집 확인
* 기본 값이 최근 24시간 이므로, 30분이나 1시간 정도로 줄여서 데이터 수집이 되는지 확인
* graphite 웹 접속 및 확인
http://192.168.232.130
9. Grafana 에서 Graphite 데이터 소스 추가
* 노드 모니터링 참고
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
구성 수순 #8
29 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
10. Grafana 대시보드 임포트 및 확인
ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -import
* 결과 로그
----------------------------------------------------------------------------
[OK ] Will import dashboards to [http://localhost:3000]
[OK ] Dashboard directory is [/opt/netapp-harvest/grafana]
---- 중략 ----
[OK ] Imported dashboard [db_netapp-detail-7-mode-volume.json] successfully
[OK ] Imported dashboard [db_netapp-dashboard-node.json] successfully
----------------------------------------------------------------------------
11. Grafana 대시 보드 확인
* Grafana 웹 접속 및 확인
http://192.168.232.130:3000
* 만약, ONTAP 스토리지의 대시 보드가 표시되지 않을 경우에, Grafana의 기본(Default) 데이터
소스를 Prometheus에서 Graphite로 변경해서 다시 확인 필요
* 기본 데이터 소스 설정의 오류로 넷앱 대시 보드가 표시되지 않는 경우도 있음
구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite
NABox – https://nabox.org/
30 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
▪ NABox
▪ 넷앱 TAM – Yann Bizeul
▪ OVA로 배포되는 사전 설치된 Graphite, Grafana
▪ Harvest, NMSDK는 별도로 설치해야 함
▪ 현재 2.6.3 (2020-05-05) 버전
31
Thank You
© 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only

오픈소스 모니터링 알아보기(Learn about opensource monitoring)

  • 1.
    오픈소스 모니터링 알아보기 -Grafana w/Prometheus, Graphite Any Cloud. One Experience. © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 2020-03-30 NetApp Korea / Technology and Solutions Group SeungYong Baek
  • 2.
    Agenda 1. 테스트 환경구성 2. Grafana, Graphite, Prometheus? 3. 구성 1 – 노드(서버) 모니터링 with Grafana, Prometheus 4. 구성 2 – Kubernetes 클러스터 모니터링 with Grafana, Prometheus 5. 구성 3 – 넷앱 스토리지 성능 모니터링 with Grafana, Graphite © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
  • 3.
    테스트 환경 구성 VMwareWorkstation 구성 3 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 구분 서버 1 서버 2 스토리지 공통 ▪ VM on VMWare Workstation ▪ IP: 192.168.232.130 ▪ OS: Ubuntu 18.04 ▪ hostname: ubuntu-osm ▪ VM on VMWare Workstation ▪ IP: 192.168.232.131 ▪ OS: Ubuntu 18.04 ▪ hostname: ubuntu-k8s ▪ VM on VMWare Workstation ▪ IP: 192.168.232.129 ▪ OS: ONTAP 9.6 ▪ Cluster: ONTAP96 구성 1 – 노드 ▪ Role: Grafana, Prometheus ▪ Role: Prometheus - Node Exporter ▪ Role: N/A 구성 2 – Kubernetes ▪ Role: N/A ▪ Role: Grafana, Prometheus in K8S ▪ K8S on MiniKube ▪ Role: N/A 구성 3 – 넷앱 스토리지 ▪ Role: Grafana, Graphite, Harvest ▪ Role: N/A ▪ Role: Storage
  • 4.
    Grafana, Graphite, Prometheus? 4© 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
  • 5.
    IT Technology Trend? 정말많은 기술들이 정말 빠르게 다가오고 있다. 5 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only Smart City, Smart Home, Smart Car, Smart Factory, Smart Something... IoT, AI, Edge AI, 5G, Cloud, … Hyper-Scale, Hyper-Speed, Hyper-Connected
  • 6.
    디지털 환경과 데이터의변화 디지털 환경의 데이터와 복잡성은 급격히 증가 6 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only ▪ 서로 간에 상호 연결이 가능한 IoT와 Non-IoT 디바이스의 수와 시장은 급격히 팽창하고 있다. ▪ 2022년 부터는 IoT 디바이스의 수가 Non-IoT 디바이스의 수보다 많아질 것이다. ▪ 그리고, Non-IoT 디바이스는 점점 더 가상화 되고 세분화 되고 복잡해 지고 있다. ▪ 결론적으로, IoT 또는 Non-IoT 디바이스의 구분이 없이, Hyper-Connected 디지털 환경은, 더 복잡해지고 데이터는 더욱 더 많아진다.
  • 7.
    디지털 환경과 데이터의변화 디지털 환경과 데이터의 변화 사례 7 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 반도체 생산 공정 ▪ 센서/장비: 200~700개 ▪ 장비/생산라인: 1,000대 ▪ 센서 데이터/초: 1건 ▪ 센서/장비: 500개 가정 ▪ 센서 데이터/초: 50만 건 ▪ 센서 데이터/달: 1.3조 건 만약, ▪ 센서 데이터/ 0.1초: 1건 ▪ 보관일: 90일 ▪ 센서 데이터/달: 38.8조 건 Fleet Management ▪ 보잉 737/년: 2.5 ZB * 100대 = ??? ▪ 자율주행 자동차/일: 4TB * 100만대 = ??? ▪ 자율주행 자동차/일: 17TB * 100만대 = ??? 20TB * 2 엔진 * ? * ? * 1년 = 2.5ZB / 보잉 737
  • 8.
    디지털 환경과 데이터의변화 디지털 환경과 데이터의 변화 사례 8 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only Kubernetes Cluster ▪ Node/Cluster: 5 ▪ Metrics/CPU: 80 ▪ CPU/Node: 16 ▪ Metrics/Memory: 51 ▪ Metrics/FileSystem: 135 ▪ Metrics/Networking: 320 ▪ Metrics/VirtualMemory: 136 ▪ Metrics/Socket, Timer: 32 ▪ …….. Container in Cluster ▪ Metrics/Cluster: 1,186 ▪ Metrics/Containers: ??? ▪ Metrics/Applications: ??? ▪ …….. 노드 데이터/일: 66,528,000 건 컨테이너 데이터/일: 20,494,080 건 DBMS 트렌드 – DB-Engines.com
  • 9.
    디지털 데이터의 변화 지속적인데이터 관리 패러다임의 변화 9 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only Relational DBMS * 검색 엔진 / 분산 처리 NoSQL * Time Series DBMS * 정형 데이터 비정형, 반정형 데이터 시계열 데이터 * : Grafana 연동 가능
  • 10.
    모니터링 구성 및데모 10 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
  • 11.
    구성 1 –노드(서버) 모니터링 with Grafana, Prometheus Prometheus 아키텍처 11 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
  • 12.
    구성 1 –노드(서버) 모니터링 with Grafana, Prometheus 구성 수순 #1 12 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 1. Grafana 설치 * Debian/Ubuntu - OSS release * 설치 참고 사이트 https://grafana.com/grafana/download https://grafana.com/docs/grafana/latest/installation/debian/ * Docker, 바이너리 패키지(.deb, .rpm), .tar.gz 버전도 있음 ubuntu-osm$ sudo apt install -y apt-transport-https ubuntu-osm$ sudo apt install -y software-properties-common wget ubuntu-osm$ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - ubuntu-osm$ sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" ubuntu-osm$ sudo apt update ubuntu-osm$ sudo apt install grafana 2. Grafana 활성화 및 실행 ubuntu-osm$ sudo systemctl daemon-reload ubuntu-osm$ sudo systemctl start grafana-server ubuntu-osm$ sudo systemctl status grafana-server ubuntu-osm$ sudo systemctl enable grafana-server.service 3. Grafana 접속 및 확인 * Getting Started https://grafana.com/docs/grafana/latest/guides/getting_started/ * 웹 GUI 접속 http://192.168.232.130:3000/
  • 13.
    구성 1 –노드(서버) 모니터링 with Grafana, Prometheus 구성 수순 #2 13 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 4. Prometheus 설치 * Ubuntu 18.04 리파지터리에서 제공 ubuntu-osm$ sudo apt install prometheus * 서비스 활성화 확인 ubuntu-osm$ sudo systemctl status prometheus ubuntu-osm$ sudo systemctl is-enabled prometheus.service 5. Prometheus 접속 및 확인 * 웹 GUI 접속 http://192.168.232.130:9090/ * 기본으로 등록된 prometheus 타겟 확인 * prometheus가 설치된 노드가 추가 되어 있음 http://192.168.232.130:9090/targets * prometheus가 설치된 노드에서 모니터링 가능한 메트릭 확인 http://192.168.232.130:9090/metrics
  • 14.
    구성 1 –노드(서버) 모니터링 with Grafana, Prometheus 구성 수순 #3 14 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 6. 기본 그래프 그려 보기 * 그래프 창에 아래의 쿼리를 입력하여 그래프가 잘 그려지는지 확인 rate(node_cpu{mode="system"}[1m]) 7. Prometheus와 Grafana 연결 * Grafana에서 데이터 소스 추가 8. 대시보드 임포트 및 확인 * 초기 대시보드를 자체적으로 만드는 것은 조금 어려움 * Grafana 사이트 가입하고 메트릭에 맞는 대시보드 검색 * 적절한 대시보드 json 파일 다운로드 또는 ID를 입력 * node-exporter 버전에 따라 대시보드 호환성 확인 필요 https://grafana.com/grafana/dashboards * Grafana에서 제공되는 기본 대시보드를 임포트해 사용 * 다운로드 받은 json을 업로드 http://192.168.232.130:3000/dashboard/import
  • 15.
    구성 1 –노드(서버) 모니터링 with Grafana, Prometheus 구성 수순 #3 15 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 6. 기본 그래프 그려 보기 * 그래프 창에 아래의 쿼리를 입력하여 그래프가 잘 그려지는지 확인 rate(node_cpu{mode="system"}[1m]) 7. Prometheus와 Grafana 연결 * Grafana에서 데이터 소스 추가 8. 대시보드 임포트 및 확인 * 초기 대시보드를 자체적으로 만드는 것은 조금 어려움 * Grafana 사이트 가입하고 메트릭에 맞는 대시보드 검색 * 적절한 대시보드 json 파일 다운로드 또는 ID를 입력 * node-exporter 버전에 따라 대시보드 호환성 확인 필요 https://grafana.com/grafana/dashboards * Grafana에서 제공되는 기본 대시보드를 임포트해 사용 * 다운로드 받은 json을 업로드 http://192.168.232.130:3000/dashboard/import
  • 16.
    구성 1 –노드(서버) 모니터링 with Grafana, Prometheus 구성 수순 #4 16 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 9. 추가 관리 대상 호스트 추가 * node-exporter 설치, node-exporter는 관리 대상인 호스트에서 데이터를 보내주는 모듈 * 관리 대상 호스트에는 모두 설치해야 하며, 이 데모는 minikube가 설치된 호스트를 타겟으로 함 ubuntu-k8s$ sudo apt install prometheus-node-exporter ubuntu-osm$ sudo vi /etc/prometheus/prometheus.yml * 아래 노드 메트릭 수정 - 노드 추가 * /etc/prometheus/prometheus.yml ---------------------------------------------------------------------------- - job_name: node # If prometheus-node-exporter is installed, grab stats about the local # machine by default. static_configs: - targets: ['localhost:9100', '192.168.232.131:9100'] ---------------------------------------------------------------------------- * prometheus 서비스 재 로드 ubuntu-osm$ sudo systemctl reload prometheus.service * grafana 대시보드에서 추가된 노드 모니터링 확인 http://192.168.232.130:3000/
  • 17.
    구성 2 –Kubernetes 클러스터 모니터링 with Grafana, Prometheus Prometheus and Grafana in Kubernetes 17 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only ▪ Kubernetes 클러스터 모니터링은 아래의 2가지로 가능 ▪ Grafana와 Prometheus를 K8S 클러스터 내에 구성 또는 Federation을 이용한 외부의 Prometheus 연동 ▪ K8S 클러스터에 설치하는 것이 가장 쉬우며, Federation의 가장 복잡한 부분은 네트워크의 연동
  • 18.
    구성 2 –Kubernetes 클러스터 모니터링 with Grafana, Prometheus 구성 수순 #1 18 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 1. kubectl 및 minikube 업그레이드 * minikue 설치 또는 업그레이드가 필요하며, 이 데모는 기존 버전 업그레이드로 진행 ubuntu-k8s$ sudo minikube stop ubuntu-k8s$ sudo minikube delete ubuntu-k8s$ sudo kubectl version ubuntu-k8s$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl ubuntu-k8s$ chmod +x ./kubectl ubuntu-k8s$ sudo mv ./kubectl /usr/local/bin/ ubuntu-k8s$ sudo kubectl version ubuntu-k8s$ sudo minikube version ubuntu-k8s$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube- linux-amd64 ubuntu-k8s$ chmod +x minikube ubuntu-k8s$ sudo mv ./minikube /usr/local/bin/ ubuntu-k8s$ sudo minikube version ubuntu-k8s$ sudo minikube start --vm-driver=none ubuntu-k8s$ sudo chown -R $USER $HOME/.kube $HOME/.minikube 2. HELM 설치 * HELM 다운로드 및 설치 https://github.com/helm/helm/releases https://helm.sh/docs/intro/quickstart/ ubuntu-k8s$ tar xvzf helm-v3.0.3-linux-amd64.tar.gz ubuntu-k8s$ sudo mv helm /usr/local/bin/ ubuntu-k8s$ sudo helm repo add stable https://kubernetes-charts.storage.googleapis.com/ ubuntu-k8s$ sudo helm search repo stable * HELM 챠트 다운로드 ubuntu-k8s$ git clone https://github.com/helm/charts.git
  • 19.
    구성 2 –Kubernetes 클러스터 모니터링 with Grafana, Prometheus 구성 수순 #2 19 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 3. Prometheus 설치 in minikube * 노드에 설치된 node-exporter 때문에, K8S내의 exporter에서 이슈가 발생함 * 노드에 설치된 exporter는 삭제 해 줌 ubuntu-k8s$ sudo apt purge prometheus-node-exporter ubuntu-k8s$ sudo kubectl create namespace prometheus ubuntu-k8s$ cd charts/stable/prometheus ubuntu-k8s$ sudo helm install prometheus stable/prometheus -f values.yaml --namespace prometheus * 파드에 구성이 되었기 때문에, K8S 클러스터 네트워크로 접속이 가능 * prometheus-server 서비스의 IP를 확인하고 웹 브라우저로 접속 ubuntu-k8s$ sudo kubectl get service --all-namespaces * 클러스터 네트워크를 사용하지 않을 경우 포트 포워딩하여 로컬 호스트에서 접근 ubuntu-k8s$ export POD_NAME=$(kubectl get pods --namespace prometheus -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}") ubuntu-k8s$ sudo kubectl --namespace prometheus port-forward $POD_NAME 9090 * 하기의 에러 메시지 발생 시에는 패키지 추가 설치 E0214 11:43:21.906268 51591 portforward.go:400] an error occurred forwarding 9090 -> 9090: error forwarding port 9090 to pod a1d83b392a0806385a92619f9354446122e6adc86ba0e3afc578eb01bfb5d73b, uid : unable to do port forwarding: socat not found ubuntu-k8s$ sudo apt install socat * 웹 브라우저로 확인 http://xxx.xxx.xxxx.xxx → prometheus-server 서비스의 IP
  • 20.
    구성 2 –Kubernetes 클러스터 모니터링 with Grafana, Prometheus 구성 수순 #3 20 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 4. Grafana 설치 in minikube ubuntu-k8s$ sudo kubectl create namespace grafana ubuntu-k8s$ cd charts/stable/grafana * 설치하기 전에, values.yaml 파일에서 adminPassword 비밀번호 설정 ubuntu-k8s$ sudo helm install grafana stable/grafana -f values.yaml --namespace grafana * 클러스터 네트워크 확인 ubuntu-k8s$ sudo kubectl get service --all-namespaces * 웹 브라우저로 접근 및 대시보드 확인 * 노드 모니터링 환경에서 했던 것과 동일하게 구성 및 내용 확인 * 데이터 소스 추가, 대시 보드 임포트 http://xxx.xxx.xxxx.xxx → Grafana 서비스의 IP * K8S로 생성된 컨테이너의 쉘 접근 하기 ubuntu-k8s$ sudo kubectl exec -it prometheus-server-746dd86648-9xj4r -n prometheus -- sh
  • 21.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite NetApp Harvest 아키텍처 21 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only
  • 22.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #1 22 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only * Grafana, Graphite를 통해서는 성능만 모니터링 가능하며 용량은 OnCommand 필요 * NetApp Harvest, NMSDK(NetApp Manageability SDK) 다운로드 및 호스트 업로드 - https://mysupport.netapp.com/tools/index.html - https://mysupport.netapp.com/NOW/cgi-bin/software/ * NetApp Harvest Installation and Administration Guide 1.6 참고 필요 1. 넷앱 패키지 설치 ubuntu-osm$ sudo apt -y install unzip perl libjson-perl libwww-perl ubuntu-osm$ sudo apt -y install libxml-parser-perl ubuntu-osm$ sudo apt -y install liblwp-protocol-https-perl ubuntu-osm$ sudo apt -y install libexcel-writer-xlsx-perl * harvest 설치 ubuntu-osm$ unzip netapp-harvest_1.6.zip ubuntu-osm$ sudo dpkg -i netapp-harvest_1.6_all.deb * NMSDK 설치 ubuntu-osm$ sudo unzip -j netapp-manageability-sdk-9.6.zip netapp-manageability-sdk- 9.6/lib/perl/NetApp/* -d /opt/netapp-harvest/lib ubuntu-osm$ sudo systemctl daemon-reload ubuntu-osm$ sudo systemctl enable netapp-harvest 2. ONTAP 구성 ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "version" ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "cluster identity show" ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "cluster show" ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "system node show" ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "statistics" ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "lun show" ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "network interface show" ONTAP96> security login role create -role netapp-harvest-role -access readonly -cmddirname "qos workload show" ONTAP96> security login create -user-or-group-name netapp-harvest -application ontapi -role netapp-harvest-role -authmethod password
  • 23.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #2 23 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 3. Graphite 설치 * 도커 기반 설치 ubuntu-osm$ sudo apt install docker.io ubuntu-osm$ sudo docker run -d --name graphite --restart=always -p 80:80 -p 2003-2004:2003-2004 -p 2023-2024:2023-2024 -p 8125:8125/udp -p 8126:8126 graphiteapp/graphite-statsd ubuntu-osm$ sudo docker ps -a * graphite 웹 접속 및 확인 http://192.168.232.130 * 기타 docker 관련 명령어 * 아래 처럼 중지, 시작을 해도 도커에 구성된 config는 유지됨 ubuntu-osm$ sudo docker stop graphite → 컨테이너 중지 ubuntu-osm$ sudo docker start graphite → 컨테이너 시작 * 컨테이너 삭제하고 다시 run 하면 config도 다시 해야 함 ubuntu-osm$ sudo docker rm graphite → 컨테이너 삭제 * 컨테이너에 구성한 config를 유지하고 싶으면 새로운 이미지 생성 필요 ubuntu-osm$ sudo docker commit 또는 Dockerfile 사용
  • 24.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #3 24 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 4. Harvest 환경 설정 * harvest.conf 수정 ubuntu-osm$ sudo cd /opt/netapp-harvest ubuntu-osm$ sudo cp netapp-harvest.conf.example netapp-harvest.conf ubuntu-osm$ sudo chown netapp-harvest:netapp-harvest netapp-harvest.conf ubuntu-osm$ sudo vi netapp-harvest.conf * 아래의 사항 수정 * [default] 수정 및 [ONTAP96] 모니터링 대상 수정 - [global] API 키는 추후에 등록 예정 * /opt/netapp-harvest/netapp-harvest.conf ---------------------------------------------------------------------------- ## [global] grafana_api_key = eyJrIjoibzVJa1k4dnBZTG03d0JMa1pJZmpWaEtsTFlDRDAzT3IiLCJuIjoibmV0YXBwLWhhcnZlc3 QiLCJpZCI6MX0= grafana_url = http://localhost:3000 ## #### Default section to set defaults for any user created poller section ## [default] graphite_server = 192.168.232.130 username = netapp-harvest password = mypassword ## #### Poller sections; Add one section for each cDOT cluster, 7-mode node, or OCUM server #### If any keys are different from those in default duplicate them in the poller section to override. ## # [INSERT_CLUSTER_OR_CONTROLLER_NAME_HERE_EXACTLY_AS_SHOWN_FROM_CLI_P ROMPT] [ONTAP96] hostname = 192.168.232.129 group = ONTAP9 ----------------------------------------------------------------------------
  • 25.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #4 25 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 5. Graphite 환경 설정 * 컨테이너로 만들었기 때문에, 컨테이너 쉘 접근 필요 ubuntu-osm$ sudo docker exec -it graphite sh * storage-schemas.conf 수정 docker/ # vi /opt/graphite/conf/storage-schemas.conf * netapp_perf 항목 추가, /opt/graphite/conf/storage-schemas.conf ---------------------------------------------------------------------------- [carbon] pattern = ^carbon. retentions = 10s:6h,1m:90d [netapp_perf] pattern = ^netapp(.poller)?.perf7?. retentions = 1m:35d,5m:100d,15m:395d,1h:5y [default_1min_for_1day] pattern = .* retentions = 10s:6h,1m:6d,10m:1800d ---------------------------------------------------------------------------- * carbon.conf 수정 docker/ # vi /opt/graphite/conf/carbon.conf * 아래 옵션으로 수정 - 50 → 600 * /opt/graphite/conf/carbon.conf ---------------------------------------------------------------------------- MAX_CREATES_PER_MINUTE = 600 ---------------------------------------------------------------------------- * 서비스 재시작을 위해서 컨테이너 재기동 ubuntu-osm$ sudo docker stop graphite ubuntu-osm$ sudo docker start graphite
  • 26.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #5 26 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 6. Grafana에서 API Key 생성 및 등록 * Grafana에서 키 생성 및 등록 * "4. Harvest 환경 설정"과 같이 netapp-harvest.conf에 등록
  • 27.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #6 27 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 7. Harvest 기동 * 아래의 netapp-manager, netapp-worker 수동으로 시작하는 것은 최초 설치시 한번만 함 * 설치 완료 후에는 systemd에 의해서 netapp-harvest라는 서비스로 자동으로 시작 됨 * netapp-manager, netapp-worker 기동 ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -status ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -start ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -status * 결과 로그 ---------------------------------------------------------------------------- STATUS POLLER GROUP ############### #################### ################## [RUNNING] ONTAP96 ONTAP9 ---------------------------------------------------------------------------- ubuntu-osm$ sudo /opt/netapp-harvest/netapp-worker -poller ONTAP96 & * 결과 로그 ---------------------------------------------------------------------------- [2020-02-19 11:08:51] [NORMAL ] WORKER STARTED [Version: 1.6] [Conf: netapp-harvest.conf] [Poller: ONTAP96] [2020-02-19 11:08:51] [NORMAL ] [main] Poller will monitor a [FILER] at [192.168.232.129:443] [2020-02-19 11:08:51] [NORMAL ] [main] Poller will use [password] authentication with username [netapp-harvest] and password [**********] ---- 중략 ---- [2020-02-19 11:08:52] [NORMAL ] [main] Startup complete. Polling for new data every [60] seconds. ---------------------------------------------------------------------------- * netapp-harvest 서비스 시작 및 중지 ubuntu-osm$ sudo systemctl stop netapp-harvest ubuntu-osm$ sudo systemctl start netapp-harvest * 로그 파일 위치 - 에러 발생시 확인 /opt/netapp-harvest/log
  • 28.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #7 28 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 8. Graphite 데이터 수집 확인 * 기본 값이 최근 24시간 이므로, 30분이나 1시간 정도로 줄여서 데이터 수집이 되는지 확인 * graphite 웹 접속 및 확인 http://192.168.232.130 9. Grafana 에서 Graphite 데이터 소스 추가 * 노드 모니터링 참고
  • 29.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite 구성 수순 #8 29 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only 10. Grafana 대시보드 임포트 및 확인 ubuntu-osm$ sudo /opt/netapp-harvest/netapp-manager -import * 결과 로그 ---------------------------------------------------------------------------- [OK ] Will import dashboards to [http://localhost:3000] [OK ] Dashboard directory is [/opt/netapp-harvest/grafana] ---- 중략 ---- [OK ] Imported dashboard [db_netapp-detail-7-mode-volume.json] successfully [OK ] Imported dashboard [db_netapp-dashboard-node.json] successfully ---------------------------------------------------------------------------- 11. Grafana 대시 보드 확인 * Grafana 웹 접속 및 확인 http://192.168.232.130:3000 * 만약, ONTAP 스토리지의 대시 보드가 표시되지 않을 경우에, Grafana의 기본(Default) 데이터 소스를 Prometheus에서 Graphite로 변경해서 다시 확인 필요 * 기본 데이터 소스 설정의 오류로 넷앱 대시 보드가 표시되지 않는 경우도 있음
  • 30.
    구성 3 –넷앱 스토리지 성능 모니터링 with Grafana, Graphite NABox – https://nabox.org/ 30 © 2019 NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only ▪ NABox ▪ 넷앱 TAM – Yann Bizeul ▪ OVA로 배포되는 사전 설치된 Graphite, Grafana ▪ Harvest, NMSDK는 별도로 설치해야 함 ▪ 현재 2.6.3 (2020-05-05) 버전
  • 31.
    31 Thank You © 2019NetApp, Inc. All rights reserved. — NETAPP CONFIDENTIAL — Limited Use Only