iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 23
1
自我挑戰組

谷哥 Google Cloud Platform 勇者的試煉系列 第 23

GCP 監控分析紀錄不求人,StackDriver 前傳

前面做的GCP服務慢慢越來越多,越來越難管理...都不知道每個服務到底是生是死的..有沒有個好工具最好是All-in-One統一介面可以監看全部搞定的呢?

有有有,Google在兩年前GCP NEXT 2016就發佈了一個Stackdriver,號稱監控,警告,log紀錄分析,追蹤,錯誤回報及環境除錯六大類的超強工具....重點除了自家雲之外連AWS都一起管了,看起來這麼厲害的東西當然是要拿來用嘍!

不過這服務也不是吃素了..這幾類個別有不同單位的計價可以先評估一下
https://ithelp.ithome.com.tw/upload/images/20181023/200254819OI4c93NIW.png

找到StackDriver選擇監控
https://ithelp.ithome.com.tw/upload/images/20181023/20025481x4yDWnGp9u.png

點選後會轉跳新的網頁選擇你要監控的專案
https://ithelp.ithome.com.tw/upload/images/20181023/200254817wI7b4tKl9.png

如果要更多一同納入監視就視需求勾選,我是只有一個
https://ithelp.ithome.com.tw/upload/images/20181023/20025481bPnOKVIeZH.png

下一步後會問是否要把AWS也一同納入管理,不過有它特定的ID需要AWS上設置,先確認自己的管理帳號ID
https://ithelp.ithome.com.tw/upload/images/20181023/2002548118RcdnaALz.png

來新增Roles
https://ithelp.ithome.com.tw/upload/images/20181023/20025481rHciQUNapV.png

模式選擇其他AWS帳戶類型並把剛剛的ID輸入進來
https://ithelp.ithome.com.tw/upload/images/20181023/200254816pywn43SRP.png

選擇唯讀存取權限範本
https://ithelp.ithome.com.tw/upload/images/20181023/20025481zZrNYG2gOx.png

自訂Roles名稱
https://ithelp.ithome.com.tw/upload/images/20181023/20025481vnpigk3pNB.png

Roles建立完成,在最後一筆要再點選進去
https://ithelp.ithome.com.tw/upload/images/20181023/20025481NPNslYPDgS.png

沒錯,就是它啦!Roles ARN ID,把他Copy下來
https://ithelp.ithome.com.tw/upload/images/20181023/20025481XweW5g3yJC.png

在回到StackDriver就可以把此ID貼上後沒有錯誤就可以新增帳戶進來
https://ithelp.ithome.com.tw/upload/images/20181023/20025481QZKi9ivBrW.png

已經建立好與AWS帳戶的關聯
https://ithelp.ithome.com.tw/upload/images/20181023/20025481D7ckbd0F2W.png

接下來是在展示StackDriver監控所需要安裝的Agent步驟,不過直接下一步就完成,後面都是自動背景執行安裝
https://ithelp.ithome.com.tw/upload/images/20181023/20025481JPmR14Fptv.png

預設郵件發送每日/週的監控報告
https://ithelp.ithome.com.tw/upload/images/20181023/20025481dPnpGaCAJT.png

設定完成就可以執行StackDriver
https://ithelp.ithome.com.tw/upload/images/20181023/20025481BHOE6bU4Mk.png

這就是StackDriver一開始的儀表板統一監看呈現預設頁面
https://ithelp.ithome.com.tw/upload/images/20181023/20025481mzUWaYbk16.png

目前其實顯示都是沒有資料的需要不少時間....先來做個uptime監視設定
https://ithelp.ithome.com.tw/upload/images/20181023/20025481BbxgxWoLHi.png

我先拿監看GAE的URL作為示範(選擇哪種協定,網站FQDN,Check時間都請依需求自訂)
https://ithelp.ithome.com.tw/upload/images/20181023/20025481eFGA7UyS8Z.png

進階就是對各區的監視以及網站標頭(請填完整FQDN),另外我是走https故為443
https://ithelp.ithome.com.tw/upload/images/20181023/200254812exm5OIt0U.png

健康狀態監視我設定每60秒確認一次,另外驗證帳密直接預設,下面有個TEST可以來自測一下回應200 OK就是正常
https://ithelp.ithome.com.tw/upload/images/20181023/20025481BrXRne3CJS.png

接著對這一條GAE的uptime check Policy設立主動警示郵件回報機制
https://ithelp.ithome.com.tw/upload/images/20181023/20025481HinzqZC1dz.png

上面就是預設的對比條件,下面設定自己要接收Alert的E-Mail信箱
https://ithelp.ithome.com.tw/upload/images/20181023/20025481Z9AxGFn5RW.png

這文件的意思其實就是註解啦!可以當作公告或文件連結可以方便檢視管理並自訂Policy名稱
https://ithelp.ithome.com.tw/upload/images/20181023/20025481OAaAOE10IS.png

設定完成後可以從Alert檢視一下Policy List
https://ithelp.ithome.com.tw/upload/images/20181023/20025481TZ2FsxjLCg.png

確實是剛剛設立的Policy
https://ithelp.ithome.com.tw/upload/images/20181023/20025481kjRdKDoV4j.png

已經綠燈生效,另外剛剛設定的技術支援提醒公告顯示也能方便讓人管理
https://ithelp.ithome.com.tw/upload/images/20181023/200254810JTiMSfeyo.png

最後來看一下uptime check檢視剛剛設定的GAE WebSite
https://ithelp.ithome.com.tw/upload/images/20181023/20025481XOtlAbaRAj.png

經過十幾分鐘的時間對個區域的狀態已經Ready顯示綠燈
https://ithelp.ithome.com.tw/upload/images/20181023/20025481SWBwiGnZiZ.png

已經可以針對這監控的GAE標的開始產生對應的資訊可以方便做近一步的判讀
https://ithelp.ithome.com.tw/upload/images/20181023/20025481xgmKIvp1vy.png

因為資訊量還不多,今天多半是一開始如何入手的示範後續還要更多進階的展示.
今天就先這樣嘍!大家81...../images/emoticon/emoticon34.gif


上一篇
讓資料庫喘息的好幫手,GCP MemoryStore
下一篇
GCP 監控分析紀錄不求人,StackDriver 資源檢視
系列文
谷哥 Google Cloud Platform 勇者的試煉30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言