PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 2, 2022

[FIXED] MongoDB "Connection refused" error

 January 02, 2022     mongodb, ubuntu, yii     No comments   

Issue

I wanted to know what is the actual reason behind MongoDB "connection refused " error and How can we prevent this from happening.I am using ubuntu server.

I found that we can solve the problem after it has occured by:

sudo -u mongodb mongod --repair -dbpath /var/lib/mongodb
sudo start mongodb

I would like to know the way how can we stop it from occurring rather than solving it after it has occurred

The scenario is:

Mongodb is running well but after sometime I get this error .What I am doing in that span of time is I am continuously inserting data to that mongodb database in an interval of 1 minute.

I am using yii's yiiMongoDbsuite extension.The actual error thrown is.

EMongoDB failed to open connection: Failed to connect to: xx.xxx.xxx.xx:27017:
Connection refused

I would really appreciate if somebody helps me in this case.Thanks.


Solution

You might want to look if Journaling is turned on in your settings, for more information, please refer to this previously answered question

Restarting / Autorepairing Mongodb in Production



Answered By - DarkMukke
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing