MongoDB Gridfs File System
Practical Exercises
1. View the mongofile help document with the –help option
2. Put {FileName} through mongofile-h {Ip:port}-d {CollectionName}
where the-h option specifies the host name and the port number, the-d
Http://www.mongodb.org/downloads website Download address can be down to the latest MongoDB.
There is a full English installation instructions above.
Here a brief introduction, supply to see E-wen headache students.
There are two ways to start after
configuration of the cluster(This test is placed on the same machine for configuration, so the IP address, if it is on a different server to replace the IP can be)
1, directory structure copy two MongoDB to/home/scotte.ye/mongo1
1, download the latest MongoDB from the official website, choose Linux, and then according to their own Linux system to choose the appropriate version.
2, unzip the download of the MongoDB tar bag
After decompression, the main running scripts are
First step. Start the appropriate Mongod process
Mongod--fork--slave --port 27017--replset myset--rest--dbpath/data/dbmongo/shard11--logpath/data/dbmongo/ Shard11.log
mongod--fork--slave--port 27018--replset myset--rest--dbpath/data/dbmongo/shard12
As shown in the figure, a,b,c three collection are associated with each other. Where the number is the value of the document.
A primer on Dbref can be seen in http://blog.csdn.net/crazyjixiang/article/details/6616678 this article.
Let's build a
Overview
The MONGODB environment mainly includes standalone,replication and sharding. StandAlone: Stand-alone environment, the general development of the test when used. Replication: Master-slave structure, a primary, multiple secondary, there may
Mycat as a database middleware also has some problems, in the use of the process will inevitably encounter a variety of problems, based on this we will be related to the issue of a record for the FAQ to view. The following questions are proposed for
Today in the project encountered about MongoDB nested query, has not been contacted before, query the relevant data to record the results.
The data in the MongoDB are as follows:
> Db.customer.findOne ()
{
"_id": ObjectId ("57636c8e35defe02996210
Replication Cluster Configuration
1. Install the MongoDB databaseInstall MongoDB on both the master node and from the node
# RPM-IVH mongo-10gen-2.4.6-mongodb_1.x86_64.rpm mongo-10gen-server-2.4.6-mongodb_1.x86_64.rpm
2. Configuration
In addition to the basic query capabilities, MONGODB provides powerful aggregation capabilities. This is mainly about count, distinct, and group.1. Count:--In an empty collection, Count returns a number of 0.> Db.test.count ()0--Test the return
the concept of a replica set
The replica set (also known as the replica set Replica set) is the master-slave cluster with automatic failure recovery.
The most obvious difference between the traditional master-slave structure and the replication
One, the establishment of play of a project
Add a MongoDB jar package and create a tool class
Using a single case pattern
Third, create a test object
IV. CRUD
Implementation in Mongoutil
Routing control:
Test:
Recently there is a need to deal with a large number of unstructured data , the original use of the MySQL database has gradually a little satisfied with the need, by comparing the various databases (MySQL, Redis, MongoDB, hbase, etc.) after the pros
MongoDB is a kind of nosql data, how can realize the group function in relational database.
Group
note:currently one must use Map/reduce instead the group () in Sharded MongoDB.
Group returns an array of grouped items. The command is similar to
Construct some data with a Python script and then show how to use the
#coding =utf-8 ' Created on 2015-12-28 @author: kwsy ' ' Import pymongo client = Pymongo. Mongoclient ("localhost", 27017) db = client.testaggregate coll = db.teacher t1 = {'
Http://www.07net01.com/2016/11/1722629.html
This article describes the content of MongoDB remote access configuration, the following words do not say, directly to see the detailed steps.
1, first modify the MongoDB configuration file to listen to
MongoDB remote connection with configuration, divided into the following 4 steps.1. Add admin account?
1 2 3
> Use admin switched to DB admin > Db.adduser (' Tank ', ' test ');
2, configure mongodb.conf?
1 2
1, download the corresponding jar package, here use Springboot to create the project, so the corresponding jar package will be loaded automatically2, connect the client, do not use authentication when the server starts up: /* connect the
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.