Previously designed a label system based on Lucene, in the case of a small amount of data and the amount of concurrency can be used reluctantly, more than 1 million of the query will be more than 1 seconds, ranking is affecting a lot of performance,
requirements, MySQL table, a log table, the average record of statistical data cycle, in practice to learn, with MySQL may be more trouble, then use just contact with the MongoDB bar, but also with the study of Hadoop last year stained point, and
MySQL users have most of the auto increment complex, but MongoDB default is not implemented, so need to simulate, programming language in PHP for example, the code is as follows:
1,
' Step ' => 1,
);
$instance = new Mongo ();
First need to install Pymongo module, module download address
https://pypi.python.org/pypi/pymongo/#downloads
Select the appropriate version, to install, after the installation is completed, you can link your mongodb.
pymongodb-2.3.tar.gz Download:
First, the application scene: Find MongoDB news name is not "", also not NULL news name, and according to the Heat rankings:
$map [' title '] = Array (' $not ' =>array (' $in ' =>array ("", null));
$news = $this->where ($map)->order (' Value desc ')-
MongoDB cluster refactoring, freeing up disk space
Since MongoDB deletes part of the data, it does not reclaim the disk space, so it frees up disk space by rebuilding the data directory. an experimental environment
A replica set is configured that
One: Problem description
I enter MongoDB's machine IP and port number in the browser: http://192.168.6.70:27017/
Page appears:
It looks like your are trying to access MongoDB over HTTP on the native driver port.
As shown in figure:
Two:
http://blog.csdn.net/sandysong28/article/details/6455926
Recently has been thinking about the architecture of things, there is a problem still bothering us to do business systems, that is, log and log statistics. The general question is as follows:
Some time ago accidentally closed MongoDB, ready to restart but found no, error message is as follows: Tue Apr 11:13:30 www.2cto.com Tue Apr 11:13:30 War Ning:32-bit servers don ' t has journaling enabled by default. Please use the--journal if
Start Configsvr
1. Ensure that the configsvr of the MONGDB is started in service mode, that is, from the script under/ETC/INIT.D, and that the user is mongod.
2. Ensure that the Mongod configuration files are identical.
3. Ensure that all keyfile
https://docs.mongodb.org/manual/reference/method/db.collection.mapReduce/#mapreduce-OUT-MTD
The following is a description of the MapReduce output
Output to a Collection with an Action
This option was only available when passing a collection the
Recently has been thinking about the architecture of things, there is a problem still bothering us to do business systems, that is, log and log statistics. The general question is as follows: We have a lot of modules, although the log format is
With yesterday's smooth, today is more confident, today to do is to obtain the number of interval records, for the foreground statistics chart preparation data, for example, the effect is,
In 1 days, there are xx times, within 2 days of XX times,
Millions of of the data in the database, processing may be slow, so it is simple to build a smaller structure of similar tables, test data
/* 0 */
{
"_id": ObjectId ("54fe73e36e26d21dc4391bdb"),
"Create_date": Isodate ("2014-07-26t13:57:18z"),
Start real actual combat, table data about 100w, today first to solve the first demand, that is, to find the average record time, directly run "Combat 2" has been written mapreduce. An exception, no results, as long as the {sort}, there is no result,
OK, continue to complete the second demand, to find the number of records in a day statistics, directly run the "Combat 4" prepared MapReduce, the exception is not a number Nan, through the analysis of the results, found the reason, the reason
An example of modeling a customer and its multiple address relationships
Use normalized ( referenced ) and non-normalized ( inline ) storage, respectively:
1, standardized storage:
(In a normalized data model, the address document contains a
Overview of MongoDB Replication Sets
A replica set is an additional copy of the data that is the process of synchronizing data across multiple servers, and the replication set provides the sink to add data availability, and the benefits of
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