Turn from: http://hi.baidu.com/zwfec/item/3cfecfabafda3a258819d38b
Today, look at the server, found that Mongod start not up, prompted
Sun June 2 12:27:02 error:couldn ' t connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
Error
Look up the solution on the Internet, most people say set up dbpath, this is to solve the problem, but not to find the root cause of the problem,
The root of the prob
MongoDB is the log server. The most common way to write logs at www.2cto.com is to write a plain text file, and then install the date to split the file and press the wrong old file. This log is very convenient for anyone who understands shell and perl. For programmers, they prefer to write logs to database servers and then use SQL statements to query logs.
MongoDB
DescribeCurrently to do is a number of servers on the program log (such as the order journal, the transaction log, the interface is successful, etc.) summarized to 1 MongoDB server, daily about 100 million of the volume, and then a real-time chart display, and report display log informationAttention:Did not put all the logs into 1 tables, because log insertion is often caused by the lock table, and the seco
Tags: c Using data server problem testingAt the outset, to save the server, MongoDB and Redis are placed on a server. Every peak of the website special card, also often appear 502. For a long time to find the reason, found that hard disk writing data is very large, IOPS is also very high, troubleshooting a number of re
-master.zip to mongo-php. Then enter the mongo-php directory.
Unzip-q mongo-php-driver-legacy-master.zip
mv mongo-php-driver-legacy-master mongo-php
CD mongo-php
Phpize
./configure make all make
install
If there are no problems with the installation process, the PHP driver directory will appear after make install, for example:
Installing shared extensions: /usr/lib64/php/modules/
To load the extension at PHP startup, add the following code to the/etc/php.ini:
has been using a five-machine MongoDB cluster (192.168.40.80 ~ 84), 5 Shard, divided by 3 shards. has been running normally, the recent period of discovery service is very unstable, show db old hint Shard 4 error, and sometimes the machine will be too high load and downtime.
Today, I accidentally look at the MongoDB logs and found that several machines related to Shard 4 are reporting the same error:
[Rshe
Tags: io ar using SP file data on problem CTINote: This solution to this problem is premised on the previous open MongoDB, once again use the time can not connect (using Mongod and MONGO are not correct)Gossip: It's annoying to have this kind of problem, so say Sun's beach, okay ~ coolBusiness:The errors you may encounter are as follows:MongoDB Shell version:2.4.9Connecting To:testMon Mar 3 23:45:09.491 error:couldn ' t connect to
; Db.runcommand ({"Removeshard": "localhost:20002"}); {"Assertion": "Can ' t find Shard for:localhost:20002","Assertioncode": 13129,"ErrMsg": "DB assertion Failure","OK": 0}View CodeAfter the final removal, when we call Db.runcommand again ({"Removeshard": "localhost:20002"}), the system will error, we have notified that there is no 20002 this port of the Shard Server, Because it has been removed.>Use testswitched to DB test>db.users_2.stats () {"Shar
table status to verify the new Shard Server>Use testswitched to DB test>db.users_2.stats () {"Sharded":true,"NS": "Test.users_2",......"shard0002": {--the new Shard Server already has data"NS": "Test.users_2","Count": 21848,"Size": 2097408,"Avgobjsize": 96,"Storagesize": 2793472,"Numextents": 5,"Nindexes": 1,"Lastextentsize": 2097152,"Paddingfactor": 1,"Flags": 1,"Totalindexsize": 1277952,"Indexsizes" : {"
be resolved as such. It's pretty detailed.http://lingqi1818.iteye.com/blog/1317433However, if these items are not linked, it means that some of the ports on the server are not open causing the connection to be non-connected.Workaround first Configure the IP table to open some ports, and then restart server.Root enters serverVi/etc/sysconfig/iptablesAdd to-A input-m state--state new-m tcp-p TCP--dport 10002-j ACCEPT (the port opened here is 10002)Save
reasons can be solved. It's pretty specific.http://lingqi1818.iteye.com/blog/1317433But assuming that these things are not linked, it means that some ports on the server are not open and cannot be connected.Workaround to first configure the IP table to open some ports, and then restart server.Root enters serverVi/etc/sysconfig/iptablesJoin-A input-m state--state new-m tcp-p TCP--dport 10002-j ACCEPT (the port opened here is 10002)Save exitService Ipt
For data security, in the MongoDB configuration file, the default port of 27017 is typically changed to a custom port number, and then the allowed IP is set to 127.0.0.1 (that is, the host itself). However, this can cause trouble when the development process looks at the data, and it must go to the server side or call the API interface deployed on the server to b
/data/dbback/foo/bar Recovering multiple collections mongorestore–h 127.0.0.1:30000–d foo–c foo.bar,foo.infi–dir/data/dbback/foo/cols 1.3 Backup Replica set Backup directly using the copy data file , which does not require any modification when backing up the replica set. 1.4 backing up a shard cluster First step: Turn off the equalizer, Step Two: Connect MONGOs perform Mongodump backup Step three: Enable the Equalizer, If you restore a backup, use Mongorestore to connect to a MONGOs to execut
Title, this problem also Baidu for a long time, Baidu is still quite to force, but did not solve the problem, later in the Great God (forgive I do not know what the great God called) under the guidance, finally set a successful, special sharing under the setup process.MongoDB setting up the database I will not say ... Amount: Forget, or tidy up, oneself also review again. Since I am downloading the installation package, EXE is installed directly:1. After the installation is complete, my default
threads, but some databases on multi-core CPU requirements are not very strict, such as: Mongodb,mongodb memory requirements are very high! MySQL InnoDB engine CPU utilization ratio is high, as far as possible choose the strong point cpu!
System Selection
1. The system must be 64-bit system, can be Linux can also be unix,linux have a lot of choices, commonly used is CentOS Ubuntu aulympic, Unix can choos
["MSG"] = "Hello world!";
Inserts this document object into the collection
Mongocollection.insert (DOC);
To find a Document object in the collection where the key value pair is id=1
Document docfind = Mongocollection.findone (new Document {{"ID", 1}});
Outputs the value of the key "MSG" in the document object that is found, and outputs
Console.WriteLine (Convert.ToString (docfind["MSG"));
}
Finally
{
Close link
Mongo. Disconnect ();
}
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.