python_note
  • Introduction
  • My Python
    • Anaconda
    • argparse
    • datetime
    • json
    • logging
    • numpy
    • open
    • openCC
    • pandas & csv
    • Socket & SocketServer
    • re
    • yaml
    • smtp
    • 物件操作
    • unittest
    • 線程
    • prettytable
    • IO
    • pycurl
    • sys
    • pickle
    • auto-python-to-exe
    • cython
    • nuitka
  • Crawler
    • Urllib & Requests
      • User-agent
      • Percent-Encoding
      • mail code
    • Selenium
    • TCP & UDP
    • 控制字符(control character)
  • Web Development
    • Flask
      • RESTful api
      • Template
      • blueprint
    • Django
      • 環境佈署(windows)
    • 檢查Port
    • Apache
    • 使用者行為
    • jQuery
    • 壓力測試
    • DataTable
    • Bootstrap
    • CSS
    • JavaScript
    • Chart.js
  • Deep Learning
    • Keras 設定
    • RNN
    • LSTM
  • Test
    • T-Test
  • 資料結構
    • Hash
    • 時間複雜度
  • NLP
    • N-gram
    • CKIP
    • 中文轉數字
    • CRF
    • Mutual Information
    • 模糊比對
  • Linebot
    • Heroku
    • 圖文選單
    • channel
  • Linux
    • 常用指令
    • shell script
    • sshfs
    • ssh
    • nodejs & npm
    • debug
  • GCP
    • app engine
    • ssh(gcp)
    • gsutil
    • brabrabra
    • Load Balancer
    • k8s
  • Database
    • mysql
    • elasticsearch
      • Query
      • Backup and Restore
      • elasticdump
      • es2csv
      • ELK
    • mongodb
      • install
      • authentication
      • pymongo
    • sql server
  • go
    • Swarm
  • Docker
    • Kitematic
    • Dockerfile
    • Swarm
  • Git
  • 其他
    • USB軟體保護
    • Windows效能監視器
  • Blockchain
Powered by GitBook
On this page

Was this helpful?

  1. GCP

Load Balancer

PreviousbrabrabraNextk8s

Last updated 5 years ago

Was this helpful?

  1. 先到VPC 網路 --> 外部 IP 位址

設定固定ip給lb用

  1. 準備lb所需要的vm

若沒有vm則需新建執行個體

  1. 建立執行個體群組

將vm組成群組,群組性質分為可代管或非代管,就算只有一台也算群組

如果是server運算處理需求則要額外設定範本,負擔大時才能自動擴充

如果只是放個簡單網頁可直接選現有的vm即可

其中"通訊埠名稱對應"表示當lb轉入流量至vm時的窗口

假設我的網站是7710 port,此時的"通訊埠編號"就必須設為7710,這樣lb才會將流量導入到7710 port

  1. 設定lb

通訊協定看個人需求,以架設https網站為例

先設定後端服務

已命名通訊埠與執行個體群組設定有關

若協定選擇http,表示lb接收到流量後以http方式轉流量到vm

健康檢查設定要小心,如:檢查路徑、協定方式等,若設定有錯會導致lb無法偵測到狀態良好的vm,導流失敗

設定主機與路徑規則還沒試過,都沒動過

設定前端服務

設定https,ip使用前面vpc網路設定的固定ip

憑證沒用過google的,godaddy的憑證可共用,可有多個子網路,在dns管理畫面可設定,無法即時更新要等一下

  1. 測試

直接用lb的網址或憑證網域網址測看看

有時gcp的顯示會怪怪ㄉ

https://kejyuntw.gitbooks.io/google-cloud-platform-learning-notes/google-compute-engine/load-balancer/load-balancer-README.html
https://www.kilait.com/2017/08/15/gcp-server-%E5%8A%A0%E5%85%A5http-%E8%B2%A0%E8%BC%89%E5%B9%B3%E8%A1%A1/