Difference between Chubby and Zookeeper Consensus Algorithm: Chubby: Using Paxos consensus algorithm Zookeeper: Using ZAB (which is a modified algorithm of Paxos) Access Path: Chubby: Must through leader, follower don’t accept any command directly. Zookeeper: Can accept any command from all follower, but will go back to leader. Data Out-Of-Date: Chubby: No rish on out-of-date, because all data fro Leader. Zookeeper: Will get out-of-date data, if read without sync command. Sync command will force ask follower ask Leader first before return result to client. The tolerance of Quorum-Backup and Primary-Backup: Majority Quorums: For Paxos or ZAB, A leader election need meet majority quorum ( n/2 +1 ) . It means if n=2f at most the service can tolerance f service failed at the same time. ( Quorum-Backup Replica ). Primary-Backup All data must confirm by all follower confirmed. Much slower than “Quorum-Backup”. Kafka ISR (In-Sync Replica) In-Sync Replica is a...
miniKube 單機版的 Kubernetes miniKube 是 Google 發布可以在單機上面跑 Kubernetes 的工具,安裝跟使用都相當簡單.由於會在本地跑一個 VM ,所以也不用擔心會被 Google Cloud 不小心付費的問題. 安裝 curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.6.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ 啟動 minikube start 連接進該 VM minikube ssh 打開並且顯示 minikube 的 dashboard minikube dashboard 接下來,安裝 Kubernetes 安裝 Google Cloud SDK curl https://sdk.cloud.google.com | bash 安裝好之後,會有 gcloud, gsutil 但是還需要安裝 kubectl 透過 Google Cloud SDK 安裝 Kubernetes gcloud components install kubectl 簡單 Tutorial # Startup miniKube minikube start # Create a deployment kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080 # Expose it kubectl expose deployment hello-minikube --type=NodePort # Check pod kubectl get pod # Scale kubectl scale deployment hello-minikube --replicas=4 # Direct link to hello-minikube curl $(minikube service hello-minikube --url) How to Rolling Update on Kubernetes kubectl edit deployment hello-minikube Update your service version and apply it (save it back). You can also update this file via minikube dashboard Edit “deployment” Update “spec”->”spec”-> “image” version. Kubernetes 與...