Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ MongoDB slice simple example     - Linux System Getting Started Learning: On Linux how to convert text files to PDF (Linux)

- CentOS6.5 install SVN & visual management tools iF.SVNAdmin (Server)

- Json data with double backslashes to a single backslash Json data processing (Programming)

- MySQL loose index scan (Database)

- Linux Command Tutorial: Ubuntu apt-get command (Linux)

- Linux user status query, and to unlock locked user (Linux)

- Linux administrator should command: sed and awk (Linux)

- How to troubleshoot Windows and Ubuntu dual system time is not synchronized (Linux)

- Postgres-X2 deployment steps (Database)

- error 1819 (HY000): your password does not satisfy the current policy requirements (Database)

- Set multiple IP addresses for a single network card on Ubuntu 15.10 (Linux)

- Windows SmartGit installation (Linux)

- System Security: Build Linux with LIDS steel castle (Linux)

- Four levels to deal with Linux server attacks (Linux)

- Manually generate AWR reports (Database)

- How to Check notebook CPU temperature in Ubuntu (Linux)

- Java object serialization (Programming)

- in no backup ex: error: Xin Tourou ah backup child process has Singles DAT / US person / bin / in no backup ex (Database)

- CentOS5 installation Nodejs (Linux)

- Linux command line to put on your coat GUI (Linux)

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

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
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})
- Oracle LONG RAW BLOB CLOB type of presentation (Database)
- XtraBackup achieve non-stop use of master-slave synchronization service (Database)
- Ubuntu download install and configure Plank Dock (Linux)
- Vim configuration instructions (Linux)
- MySQL5.6 based GTID master-slave replication (Database)
- Swift acquaintance of values and references, the circular reference, Agent Precautions (Programming)
- Oracle 11g maintenance partitions - Adding Partitions (Database)
- Linux package manager - yum (Linux)
- Household use Linux Security (Linux)
- Detailed PHP code optimization [section] (explain reasons) (Programming)
- To convert into a binary search tree sorted doubly linked list (Programming)
- Install Rubinius testing Ubuntu 14.04 native threads (Linux)
- Deployment Kubernetes manage Docker example cluster on Ubuntu (Server)
- Ubuntu users to install Gnome-Pie 0.6.5 (Linux)
- Ubuntu / openSUSE users to install Veusz 1.21.1 (Linux)
- Linux operating system boot manager -GRUB (Linux)
- Figlet use (Linux)
- Oracle user lock how to know what causes (Database)
- Experience CoreCLR stack unwinding characteristics of initial implementation on Linux / Mac (Linux)
- CentOS 6.5 installation using a data recovery software extundelete (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.