Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MongoDB slice simple example     - Binary tree and some basic operations with binary list (Programming)

- RedHat 6.5 installation and deployment Openfire (Server)

- Copy Recovery using RMAN repository development environment (Database)

- Java, on the dfile.encoding Systemproperty (Programming)

- grub boot error resolution examples (Linux)

- Talk about Java EE Learning (Programming)

- Python2 ---- function using dictionaries (Programming)

- Custom Android UI template Comments (Programming)

- SecureCRT 7.0 Log Ubuntu 12.04 server via SSH service under Vmware (Server)

- The YUM package management under Linux (Linux)

- Ease of use "Explain Shell" script to understand Shell command (Linux)

- Linux, modify / etc / profile file (Linux)

- Selection sort, insertion sort, and Shell sort (Programming)

- Sublime Text 3 shortcuts summary (Linux)

- [Android] Eclipse does not update the Android SDK Manager solution [using GoAgent] (Programming)

- Mass data storage application of MongoDB database (Database)

- CentOS install Java 1.8 (Linux)

- RHEL / CentOS / Fedora Install Nagios 4.0.1 (Linux)

- Android project and coding specifications (Programming)

- OpenStack / Dev stack with neutron on Ubuntu 14.04 (Server)

 
         
  MongoDB slice simple example
     
  Add Date : 2018-11-21      
         
         
         
  Fragmentation

There is another cluster Mongodb within, slicing technology, a large amount of data to meet the growing demand for MongoDB.

When MongoDB to store vast amounts of data, a machine may be insufficient to store the data is sufficient to provide an acceptable read and write throughput. At this point, we can split the data on multiple machines, so that the database system can store and process more data.

Why slice

Copy all write operations to the primary node
Delay sensitive data in the master query
A single copy set is limited to 12 nodes
When the huge volume of requests will appear when the memory.
Local disk shortage
Vertical expansion is expensive

MongoDB slice
Shard:
Used to store the actual data block, the actual production environment, a shard server role can set a few machines relica set a commitment to prevent the host single point of failure

Config Server:
mongod instance, stores the entire ClusterMetadata, including the chunk information.

Query Routers:
The front end of the route, whereby the client access, and the whole cluster look like a single database front-end applications can transparently use.

Specific examples

Three shard using a configuration service

1. First start the database server port three are: 55555,55556,55557, host: localhost.

./mongod --port 55555 --dbpath = data / share1 --logpath = data / share1 / logs / s1.log --logappend --fork

./mongod --port 555556 - dbpath = data / share2 --logpath = data / share2 / logs / s2.log --logappend --fork

./mongod --port 55557 --dbpath = data / share3 --logpath = data / share3 / logs / s3.log --logappend --fork



2. Launch configuration server

./mongod --port 55558 --dbpath = data / config --logpath = data / config / logs / cnf.log --logappend --fork



3. Start routing services.

                   ./mongos --port 55554 --dbpath = data / share --logpath = data / share / logs / route.log --logappend --fork --configdb localhost: 55558 --chunkSize 500

Wherein chunkSize to slice the size, configuration, services are mainly stored routing information



4. Add shard

use admin

db.runCommand ({addshard: "localhost: 55555"})

db.runCommand ({addshard: "localhost: 55556"})

db.runCommand ({addshard: "localhost: 55557"})

db.runCommand ({enablesharding: "test"}) // database test partakers sheet capacity

db.runCommand ({shardcollection: "test.log", key: {id: 1, time: 1}}) // specified document in the corresponding database table through what fragmentation. Here is a test based on the log table id and time slicing.



5. See fragment status

db.runCommand ({listshards: 1})
     
         
         
         
  More:      
 
- JavaScript file loader LABjs API Explanation (Programming)
- Ruby and Python simple comparison (Programming)
- Linux find command to find files (Linux)
- Linux system security check method (Linux)
- Linux keyboard recording script (Linux)
- When RHEL7 use fdisk partition, all partitions can not be used (Linux)
- Effect MongoDB plan cache (Database)
- Python maketrans () method (Programming)
- Binder began to talk about inter-process communication mechanism from Android AIDL (Programming)
- Java recognize simple codes (Programming)
- How to install Hadoop on CentOS7 (Server)
- Oracle Data File Management (Database)
- Install RAID 6 (Striping double distributed parity) (Linux)
- Linux system started to learn: Teaches you install Fedora 22 on VirtualBox (Linux)
- Install and manage Java under mac (Linux)
- linux server security (Linux)
- Camouflage Nginx Web server version to prevent invasion (Linux)
- CentOS6 install Redis (Database)
- MySQL Tutorial: Philosophical Reflections on the unauthenticated user (Database)
- Docker: installation under Ubuntu (Server)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.