MongoDB running but can't connect using shell

前端 未结 17 1706
甜味超标
甜味超标 2020-12-23 16:45

CentOS 5.x Linux with MongoDB 2.0.1 (tried main and legacy-static)

MongoDB is running:

root     31664  1.5  1.4  81848 11148 ?        Sl   18:40   0:         


        
17条回答
  •  时光取名叫无心
    2020-12-23 17:25

    By default, mongodb is configured to listen only to localhost. Excerpt from mongodb default config file :

    # Listen to local interface only. Comment out to listen on all interfaces.
    bind_ip=127.0.0.1
    

    One needs to comment the bind_ip to listen from external entities.

    You wont be able to add shards unless you start listening on non-local interfaces.

    HTH,

    Abhay Dandekar

提交回复
热议问题