3

i have this issue with laravel project use mongoDB

ConnectionTimeoutException in Collection.php line 192:
No suitable servers found (`serverSelectionTryOnce` set): [connection
timeout calling ismaster on '10.0.0.106:27017']

i did

 service ngnix restart 

but its not work still same i dont know how solve it

flower
  • 989
  • 4
  • 16
  • 34

3 Answers3

2

the reason is mongod server not support ipv6 by default, but the systemOS used ipv6. you can delete the ipv6 on system: remove this line

::1 localhost' from /etc/hosts

or, enable the mongod ipv6 support ! eg:

./bin/mongod --filePermissions 0777 --ipv6
georoot
  • 3,557
  • 1
  • 30
  • 59
Grave
  • 21
  • 1
0

I had this issue when I changed php version. The solution for me was to add mongo extension to php.ini file of the new php version. My php.ini on mac

/usr/local/etc/php/7.1/php.ini

Just add

;extension=mongodb.so
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
STIKO
  • 1,995
  • 1
  • 10
  • 9
0

Reason for this is there are too many open connection requests to database. Please check if u have any ajax calls running in ur application. you can login to cloudmongo where you have hosted the database cluster and see the number of collections going beyond 100.You might be having too many dbs in the same cluster. I suggest you move few dbs to another cluster.

Hope it helps.

Codex
  • 155
  • 6