Connecting to MongoDB remotely and getting ServerSelectioinTimeoutError
Question: New to MongoDB here and I'm having some trouble connecting to the server. I
get the error ServerSelectionTimeoutError: xxx.xxx.xxx.xxx:27017:timed out

I'm using PyMongo 2.8 on OSX 10.10.

    
    
    import sys
    sys.path.append('/usr/local/lib/python2.7/site-packages')
    
    from pymongo import MongoClient
    client = MongoClient('mongodb://dba:[password]@xxx.xxx.xxx.xxx:27017/Admin') #the real password has the square brackets
    db = client['MyDB']
    x=[]
    userData = db.users.find()
    for user in userData:
        x.append(user)
    print x
    


Answer: I was using an internal ip address in the client string. External ip fixed it.

