MongoDB can ' t call something problem solving method

Source: Internet
Author: User
Tags mongodb
Java Connection MongoDB problem, the program ran for two days to throw this exception:
Exception in thread "main" Com.mongodb.mongoexception$network:can ' t call something:/10.108.x.x:27017/datamining
Solutions for searching on the internet http://lingqi1818.iteye.com/blog/1317433
Add Mongooptions
Mongo mg = new Mongo (host);
Mongooptions options=mg.getmongooptions ();
options.sockettimeout=2000;


But because the program ran so long before the anomaly, there is no test method well, do a record here.


Update: Settings like the one above will still be problematic, this time changing the order of the settings, as the link in the article said.
Mongooptions options=new mongooptions ();
options.sockettimeout=2000;
Mongo mg = new Mongo (new ServerAddress (host,27017), options);




In addition in execution dbcursor cursor = Usercollection.find (). batchsize (100);
It is better to add batchsize (100); this sentence, otherwise it will be abnormal.


The following issues were encountered in the process of updating the database while performing the update:
Com.mongodb.mongoexception$network:can ' t say something
The following options have been added: options.socketkeepalive=true
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.