MongoDB add replica and modify priority1. Add replica set#在primary节点上执行>rs.add ({host: "192.168.1.11:27017", priority:0})#host: Specify the IP and port of the MongoDB server to be added#priority: Specify permissions for the replica set2. Adding the
Mongdb is a non-relational distributed storage database based on C + +, which describes how MongoDB is started:1. If you shut down normally during the last use, you can double-click the Mongod.exe in the bin directory to enable the MongoDB server
1. Common commands
show DBS Show all databases
use dbname into dbname database, if not present,
db View database
show collections displays the collection in the database--equivalent to the table in MySQL!
MapReduceMapreduce: The set of targets to manipulateMap : Map function (generate key-value pair sequence as reduce function parameter)//incoming group key and value to be countedReduce: Statistical functions//Format the returned Parameter
What is node. js? node. JS is a JAVASCRIPT runtime environment based on the Chrome V8 engine. node. JS uses an event-driven, non-blocking I/O model to make it lightweight and efficient. node. JS is developed by C + + and is actually a JS runtime
MongoDB IndexPS: About half a month the wood has been updated because of the previous phase of the business trip and these days suddenly come to the project. Causes the net time to reduce sharply, really is sorry, later anticipates will be
We left a few questions in the last chapter.
1 whether the primary node can actively switch connections on its own ?
Need to switch manually now
2 master node read and write pressure too big how to solve
3 each of the above data from the
With multi-threading, the biggest problem is Redis and MongoDB's dirty data problem1, Upsert's dirty data problemMultithreading to the same collect Upsert operation, will raise the concurrency of dirty data problems, the first solution is to use the
The basic concept in MongoDB is a document, a collection, a databaseWith an example, some concepts in MONGO are more visually understood:Show DBS shows a list of all dataDB is the display of the current database object or collectionUse test to
First, the index base:MongoDB's index is almost identical to the traditional relational database, which includes some basic optimization techniques. Here is the command to create the index:> Db.test.ensureIndex ({"username": 1})You can see whether
1. Official website: https://docs.mongodb.org/manual/tutorial/deploy-replica-set-for-testing/2, Replica set Introduction: https://docs.mongodb.org/manual/core/replica-set-members/3. Briefly describe what is replica Set:If we use a single MongoDB
Hibernate (Object-Oriented Database Operations)JPA, java persistance api, java persistence layer interface, that is, some interfaces dealing with databases. The implementation is handed over to various vendors for implementation.
ORM,
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service