[Tutor] No connection could be made because the target machine actively refused it (despite mongod running) and unable to insert data into MongoDB

Alan Gauld alan.gauld at btinternet.com
Fri Jan 22 04:54:45 EST 2016


On 21/01/16 22:06, Arjun Srivatsa wrote:
> Hello everyone,
> 
> I have been trying to insert data (a 'hello world' string) from PLC into
> MongoDB using Python API (which pulls the data from PLC and pushes it into
> MongoDB). I have been getting the error message '*line 222, in meth  return
> getattr(self._sock,name)(*args) error: [Errno 10061] No connection could be
> made because the target machine actively refused it*' despite having mongod
> running in the Services background for the code I have written below. Also,
> the server IP address on which MongoDB is present is 10.52.124.186 and
> address of PLC (which I am using it on my PC) is 10.52.124.135. I am have
> tried almost everything to sort it out and yet I haven't got a clue as to
> how to get past it. Where am I going wrong?

This looks more like a MongoDB issue than a Python one.

Can you connect from the same machine using the Mongo
command line tools and options?

You might have more success asking on a Mongo support forum/list.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list