發表文章

目前顯示的是 2018的文章

利用 Keepalived 提供 VIP

Keepalived 是一種基於 VRRP 協定實現的高可靠 Web 服務方案,用於防止單點故障問題。因此一個 Web 服務運作至少會擁有兩台伺服器執行 Keepalived,一台作為 master,一台作為 backup,並提供一個虛擬 IP(VIP),master 會定期發送特定訊息給 backup 伺服器,當 backup 沒收到 master 訊息時,表示 master 已故障,這時候 backup 會接管 VIP,繼續提供服務,來確保服務的高可靠性。 VRRP VRRP(Virtual Router Redundancy Protocol,虛擬路由器備援協定),是一個提供備援路由器來解決單點故障問題的協定,該協定有兩個重要概念: * VRRP 路由器與虛擬路由器:VRRP 路由器是表示運作 VRRP 的路由器,是一個實體裝置,而虛擬路由器是指由 VRRP 建立的邏輯路由器。一組 VRRP 路由器協同運作,並一起構成一台虛擬路由器,該虛擬路由對外提供一個唯一固定的 IP 與 MAC 位址的邏輯路由器。 * 主控制路由器(master)與備援路由器(backup):主要是在一組 VRRP 中的兩種互斥角色。一個 VRRP 群組中只能擁有一台是 master,但可以有多個 backup 路由器。 VRRP 協定使用選擇策略從路由器群組挑選一台作為 master 來負責 ARP 與轉送 IP 封包,群組中其他路由器則作為 backup 的角色處理等待狀態。當由於某種原因造成 master 故障時,backup 會在幾秒內成為 master 繼續提供服務,該階段不用改變任何 IP 與 MAC 位址。 Keepalived 節點配置 IP ADDRESS ROLE 172.16.1.101 vip 172.16.1.102 master 172.16.1.103 backup 安裝與設定 這 ubuntu 14.04 LTS Server 中已經內建了 Keepalived 可以透過 apt-get 來安裝: $ sudo apt-get install -y keepalived 也可以透過 source code 進行安裝,流程如下: $ sudo apt-get install build-essential libssl-dev $ wge

Kubernetes Autoscaling 101: Cluster Autoscaler, Horizontal Pod Autoscaler, and Vertical Pod Autoscaler

圖片
Kubernetes at its core is a resources management and orchestration tool. It is ok to focus day-1 operations to explore and play around with its cool features to deploy, monitor and control your pods. However, you need to think of day-2 operations as well. You need to focus on questions like: How am I going to scale pods and applications? How can I keep containers running in a healthy state and running efficiently? With the on-going changes in my code and my users’ workloads, how can I keep up with such changes? I’m providing in this post a high-level overview of different scalability mechanisms inside Kubernetes and best ways to make them serve your needs. Remember, to truly master Kubernetes, you need to master different ways to manage the scale of cluster resources, that’s  the core of promise of Kubernetes . Configuring Kubernetes clusters to balance resources and performance can be challenging, and requires expert knowledge of the inner workings of Kubernetes. Just becau

GitFlow with SourceTree

圖片
寫文章 註冊 登錄 首頁 下載App GitFlow with SourceTree   Thresh0ld   關注 2017.05.27 14:58*  字數2775  閱讀968  評論0  喜歡6 網上關於Git-Flow的教程一大堆,哎呀,命令行太多記不住啊。 還好有SourceTree,但是好像功能還挺多,不知道什麼時候選擇什麼功能,新版的SourceTree和網上的教程的截圖貌似對應不上。 正好我最近也在學習Git-Flow,好記性不如爛筆頭啊,光說不練假把式,我們開始吧。 參考 教程 一. 首先配置環境 前往 SourceTree 下載這個免費強大的Git GUI工具。 安裝過程略,你需要註冊個SourceTree的賬號。 本文基於SourceTree 2.5.1 mac版,Windows界面差不多。 SourceTree.png 如果你的電腦還未安裝Git的話,首先得安裝 Git ,同樣安裝過程略。 mac用戶建議使用HomeBrew來安裝Git。 Windows用戶建議使用安裝包來安裝Git,這樣會自動將git加入到環境變量中。 二. GitFlow 創建本地和遠程倉庫 創建倉庫.png image.png 創建好了會自動打開操作窗口 image.png 做第一次提交(確保至少提交一次到本地倉庫,這樣才會創建master分支) 如果不提交一次的話,GitFlow就無法初始化,因為其不知道以哪為基線(因為master分支尚未創建)。 這裡我就在本地的Test文件夾創建個文件,然後在SourceTree的文件狀態裡對這個文件加入索引,再點擊提交。 image.png image.png 提交後就會發現分支有個master分支了: image.png 如果需要重命名則點擊菜單的“移動”選項 image.png 初始化GitFlow 注意:初始化操作需要在團隊每位成員電腦上均進行一次,各配置需保持一致.應由倉庫管理員創建倉庫 按快捷鍵Command+Option+F或