- 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!
- Linux C/C++服務(wù)器開發(fā)實踐
- VSTO開發(fā)入門教程
- Unity 5.x By Example
- Learning Python by Building Games
- 可解釋機器學(xué)習(xí):模型、方法與實踐
- JavaCAPS基礎(chǔ)、應(yīng)用與案例
- 機器學(xué)習(xí)與R語言實戰(zhàn)
- OpenCV 4計算機視覺項目實戰(zhàn)(原書第2版)
- Learning YARN
- Visual Basic程序設(shè)計(第三版)
- C++程序設(shè)計教程(第2版)
- 創(chuàng)意UI Photoshop玩轉(zhuǎn)移動UI設(shè)計
- Angular Design Patterns
- 征服C指針(第2版)
- Google Adsense優(yōu)化實戰(zhàn)