- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 217字
- 2021-06-24 16:54:02
Running clustered solutions inside containers
MongoDB is a free and open source cross-platform, document-oriented database program that can run in cluster mode (using shards and ReplicaSets). In this example, we will run a three-node MongoDB ReplicaSet as that is much easier to configure than a full sharded cluster and is sufficient to demonstrate the principle of storing container state data persistently.
Our MongoDB ReplicaSet architecture will look as follows:
The primary node is responsible for managing all write operations, and there can only be one primary in a ReplicaSet. The secondary nodes are only replicating the primary's oplog and apply the data operations so that their datasets reflect the dataset of the primary. The main benefits of such a MongoDB deployment are as follows:
- Automatic failover: If the primary becomes unavailable, the rest of the secondary nodes will perform new leader election and resume cluster functionality.
- Possibility to use secondaries to read data: You can specify read preference so that clients offload the primary for read operations. However, you have to take note of the fact that asynchronous replication may result in secondaries being slightly off-sync with the primary node.
Now, let's create our MongoDB ReplicaSet!
- Vue.js 3.x快速入門
- GeoServer Cookbook
- Docker進階與實戰
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- Nginx Essentials
- C#程序設計基礎:教程、實驗、習題
- 高級語言程序設計(C語言版):基于計算思維能力培養
- Flutter跨平臺開發入門與實戰
- 單片機C語言程序設計實訓100例
- Vue.js 2 Web Development Projects
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- INSTANT JQuery Flot Visual Data Analysis
- Java EE 7 Development with WildFly
- Splunk Essentials
- ASP.NET本質論