Architecture diagram: 1. Prepare the machine, the IP is set to 192.168.1.201192.168.1.202192.168.1.203 2. Download MongoDB on each machine 3. Create a mongos.config,shard1,shard2.shard3 Five folder on each machine MONGOs: Ingress of DB cluster
Simple annotation: MONGOs routing process, application access MONGOs query to specific fragmentation, listening port default 27017 config Server routing table service, each with all chunk routing information shard for data storage fragmentation,
1 . ShardsWhat is a shard? Sharding is the storage of data on multiple machines. When the data set exceeds the capacity of a single server, the server's memory and disk IO are problematic, exceeding the performance bottleneck of a single server. At
We left two questions in the last section that haven't been solved yet:
From each node above the data are all copies of the database, from the node pressure will not be too large?
Data pressure is large enough to automatically expand
MongoDB Shard
In MongoDB there is another cluster, that is, the Shard technology, can meet the requirements of a large number of MONGODB data volume growth.
When MongoDB stores massive amounts of data, a machine may not be enough
MongoDb Replica set solves the problem of fault tolerance and single point of failure, but the storage and withstanding capacity of a single machine is limited, and sharding is generated for mass storage and dynamic expansion. This has the replica
If MongoDB is just a document-type database, there is no bright spot, however MongoDB's greatest advantage is read-extended, hot-backup, failback, and Auto-sharding (write extension). This section of the series to the end of the introduction of
In the following example, two shared services, one Configuration Service and one mongos service, are enabled. All these services are tested on the same server.
In the following example, two shared services, one Configuration Service and one mongos
MongoDB Security authentication is not the same in the case of single instance and replica set, the single instance is relatively simple, as long as the--auth parameter is added at startup, but the replica set needs to be keyfile.One, single
This article describes how to build a shard Cluster service based on MongoDB 4.0, as shown in the following table:1. Create related catalogueCreate the following directories in three separate points:[[email protected] ~]# mkdir -p
Recently pumped time to build a simple MongoDB shard, the whole process is quite smooth, but in the user authentication this piece encountered some problems, fortunately finally fix.first, the server construction process:1, install four mongodb: one
1. Sharding
What a shard is. Sharding is the storage of data on multiple machines. When the data set exceeds the capacity of a single server, the server's memory and disk IO are problematic, exceeding the performance bottleneck of a single server.
Overview of deploying MongoDB Shard cluster shardsHigh data volume and throughput of the database application of the performance of a single machine will be more pressure, large query volume will be a single CPU exhausted, large amount of data on
Basic Environment:Due to resource constraints, only 3 VMs have a relationship, only two replicaset, each machine configuration is as follows:10.10.1.55 This machine installs Primary1,configserver1, Arbiter110.10.1.56 installation
MongoDB has another cluster technology, that is, MongoDB's sharding technology. I. MongoDB sharding MongoDB is a solution that splits a set and then distributes the split data to different slices. Next let's take a look at the structure: Face:
What is a shardHigh data volume and throughput of the database application will be more pressure on the performance of the single machine, large query volume will be a single CPU exhausted, large amount of data on the single-machine storage pressure,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.