$30 off During Our Annual Pro Sale. View Details »

災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recover...

災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery, 20200108)

Avatar for Rick Hwang

Rick Hwang

January 10, 2020
Tweet

More Decks by Rick Hwang

Other Decks in Programming

Transcript

  1. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Sr. Manager / 91APP 義工 / SRE Taiwan 不是你選擇那一刻,而是那一刻選擇你 災難演練 @ AWS 實戰分享 Rick Hwang 2 2020/01/08
  2. • Sr. Manager @ 91APP • 經營管理 • Cloud /

    AWS • DevOps / SRE • Distributed Systems • 音樂 吉他 鍵盤 編曲 • 哲學 科幻 金庸 喇賽 • Complete Think、喝咖啡聊音樂、 譯著:分散式系統設計 4 Rick Hwang
  3. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 讓團隊動起來 Top to Down 6 計 畫 準備 準備 再準備 執行
  4. 2019 重大異常事件 06/03 An update on Sunday’s service disruption 07/02

    Cloudflare outage caused by bad software deploy 07/29 Issues with messages sending and slow performance 08/23 Summary of the Amazon EC2 and Amazon EBS Service Event in the Tokyo Region 09/04 虛擬主機供應商捕夢網驚傳磁碟陣列故障,造成用戶網站服務中斷 10/31 Google Compute Engine Incident #19008 7
  5. • 六小時 內把 核心業務系統 從 東京 遷移到 奧勒岡 • 核心業務:

    ◦ Mobile APP 及 客戶官網 可正常瀏覽 ◦ 確認 首頁、商品頁、分類頁 ◦ 確認 會員、購物車、完成結帳、成立訂單 ◦ 確認 登入後台、查詢到該筆訂單 災難演練 業務目標 10
  6. 成 本 復原時間 低 高 長 短 Backup & Restore

    Pilot Light Warm Standby Multi Sites DB Replication or Batch Single APP Server Standby Single Stack Set Standby Full Stack Set Standby 災難還原策略的 成本結構與 復原時間 https://rickhw.github.io/ 13
  7. 17

  8. Team, 上週五 08/23 (五) AWS 東京機房炸鍋了,影響了公司系統的服務,過程相信大家都映像深刻。雖 然我們撐過了,我們也學到了,但是系統炸鍋總是會發生的,Google 的 SRE (Site

    Reliability Engineering) 説: Things break; that life. 告訴我們,系統是隨時會有狀況的,也就是大家要知道一件事: 不是我們選擇那一刻,而是那一刻選擇了我們。 我們唯一能做的,就是做好準備。 反脆弱 (Antifragile) 從來不是口號,而是動詞,而且是平常就該準備好的。 因此,今年年底 將舉辦 災難還原演練 (Disaster Recovery) ,模擬哥吉拉登入東京,把機房的鍋弄翻了,藉 由這樣的演練模擬,目的就是希望事先發現我們缺什麼、要做什麼準備、系統的脆弱點 在哪裡。 這是個需要大家一起來努力的任務,但在開始之前,先邀清大家來了解,包含現況、以及目標 ,請各 團隊派代表出席,感謝。 18
  9. • 向上溝通 • 演練目標 • 時程規劃 • 進度掌握 • 團隊溝通

    • 各系統負責人訪談 • 確認各系統還原方式 • 擬定各系統還原計畫 • 盤點與執行演練前置作業 • 確認還原方式 • 確認當天流程 • 確認資源需求 • 演練費用評估 2019/08 2019/09 2019/10 2019/11 2019/12 • 站立會議 • 執行預演 • 執行演練 • 報告整理 19 計畫 準備 準備 再準備 執行 準備雙十一 年度計畫 成立工作小組,擬訂執行計畫 雙十一 雙十二
  10. 20

  11. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 系統與團隊 Conway’s Law 21 • 向上溝通 • 確認演練目標 • 團隊溝通 • 時程規劃 • 各系統負責人訪談 • 確認各系統還原方式 • 擬定各系統還原計畫 • 盤點與執行演練前置作業 • 確認還原方式 • 確認當天流程 • 確認資源需求 • 演練費用評估 2019/08 2019/09 2019/10 2019/11 2019/12 • 站立會議 • 執行預演 • 執行演練 • 報告整理 計畫 準備 準備 再準備 執行
  12. 23

  13. 24 WebStore Data:Database、DynamoDB、S3 OSM Kubernetes Cluster、Message Queue Config、Artifact Management、Gitlab Batch

    Ingress: Proxy、API Gateway、CloudFront、ELB Payment Infra Data APPs ERP Networking (VPC)、AAA、DC Search CMS Loyalty Compute VM Provisioning、Container Images
  14. 服務依賴與邊界 25 K8s Platform ERP WebStore OSM Batch Ingress API

    Gateway Proxy Load Balancers Tracking CMS Search Engine Notification Service Search API Loyalty Payment iOS Android Desktop Jenkins GitLab Message Queue / AM / CM
  15. 26 App Images with Semantic Versioning Hardware / OS Version

    Linux Tools Windows Features 服務縱深與分工 - VM Based (Windows / Linux) VM Provisioning Infra Team App 部署 - 各服務的團隊 Artifact Repository Config Config
  16. 27 Container Images Hardware Kubernetes Platform 服務縱深與分工 - Container-Based VM

    Provisioning Infra Team App 部署 - 各服務的團隊 Artifact Repository Config Config
  17. 訪談:找團隊 (服務) 的痛點 • 協助釐清系統架構 • 釐清服務邊界、服務依賴, 重疊的怎麼辦? • 找到執行的痛點,不外乎:配

    置、資料、建置、部署 • 建立溝通默契與方式,讓成 員更知道彼此 • 找到 DoD,如何測試? 28
  18. 30 09:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 Infra

    Applications UAT 新聞報導:哥吉拉登陸日本 東京,造成所有網路與服務 中斷。 目標:事故發生 後,六小時還原 系統。
  19. 31

  20. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 全面啟動 Bottom up 32 • 向上溝通 • 確認演練目標 • 團隊溝通 • 時程規劃 • 各系統負責人訪談 • 確認各系統還原方式 • 擬定各系統還原計畫 • 盤點與執行演練前置作業 • 確認還原方式 • 確認當天流程 • 確認資源需求 • 演練費用評估 2019/08 2019/09 2019/10 2019/11 2019/12 • 站立會議 • 執行預演 • 執行演練 • 報告整理 計畫 準備 準備 再準備 執行
  21. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 37 08:00 09:00 10:00 11:00 12:00 13:00 14:00 15:00 Infra Applications UAT 新聞報導:哥吉拉登陸日本 東京,造成所有網路與服務 中斷。 下午 15:05 完成系 統還原。
  22. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 38 - 現場指揮官 - 整點站立 - 進度跟蹤 - 各服務驗證 - 問題回報 演練當天
  23. • 六小時 內把 核心業務系統 從 東京 遷移到 奧勒岡 • 核心業務:

    Mobile APP 及 客戶官網 可正常瀏覽 確認 首頁、商品頁、分類頁 確認 會員、購物車、完成結帳、成立訂單 確認 登入後台、查詢到該筆訂單 災難演練 業務目標 39
  24. 40

  25. 46 Source Build Artifact Repository Programmers Continuous Integration Continuous Deployment

    Production Test R&D Deploy WebAPI v2.1.0 WebAPI v2.1.0 Test: Function, Regression, Performance Go Production Build, Pack Code Quality, Unit Test Source WebAPI 20190323_v2.1.0 重新看見 CI / CD 全貌 Config Infrastructure Provisioning Source: https://rickhw.github.io/2019/03/28/DevOps/DevOpsTaiwan-Meetup-Beginning-in-Artifacts-Management/
  26. 47 Software Delivery Pipeline (Installation, Deployment) Artifacts (Version, Build, Packing)

    Infrastructure (OS, Network, Security) Provisioning / Orchestration Configurations (Profile, Settings, Keys) 軟體交付的四大支柱 Source: https://rickhw.github.io/2019/04/04/DevOps/Four-Pillars-of-Software-Delivery/
  27. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 不是我們選擇那一刻,而是那一刻選擇了我們 You don’t choose the moment, the moment chooses you! 我們唯一能做的,就是做好準備 You only choose how prepared you are when it does. Mike Burtch Fire Chief source: https://blog.codecentric.de/en/2018/07/chaos-engineering/ 48
  28. Thank you! © 2020, Amazon Web Services, Inc. or its

    affiliates. All rights reserved. 49 Sr. Manager / 91APP 義工 / SRE Taiwan Rick Hwang 2020/01/08
  29. 50

  30. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 怎樣的情境,要 啟動 DR Plan? 51
  31. © 2020, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 事件管理 佈局 指揮體系 分工 52