edx---Mongo,could not connect to localhost:27017:

错误:pymongo.errors.ConnectionFailure: could not connect to localhost:27017: [Errno 111] Connection refused

原因:所有者/组群不正确定,将root修改为monogodb,权限更改为可读写

###root@precise64:/edx/var/mongo/mongodb# ls -la

total 2555936
drwxr-xr-x 2 mongodb mongodb       4096 Jun 24 05:45 .
drwxr-xr-x 3 mongodb mongodb       4096 Jun 27  2014 ..
-rw------- 1 mongodb nogroup   67108864 Sep  1  2014 admin.0
-rw------- 1 mongodb nogroup  134217728 Sep  1  2014 admin.1
-rw------- 1 mongodb nogroup   16777216 Sep  1  2014 admin.ns
-rw------- 1 mongodb nogroup   67108864 Oct 14  2014 cs_comments_service_development.0
-rw------- 1 mongodb nogroup  134217728 Oct 11  2014 cs_comments_service_development.1
-rw------- 1 mongodb nogroup   16777216 Oct 14  2014 cs_comments_service_development.ns
-rw-r--r-- 1 root    root      67108864 Jun 24 03:40 edxapp.0
-rw-r--r-- 1 root    root     134217728 Jun 24 03:40 edxapp.1
-rw-r--r-- 1 root    root     268435456 Jun 24 03:40 edxapp.2
-rw-r--r-- 1 root    root     536870912 Jun 24 03:41 edxapp.3
-rw-r--r-- 1 root    root    1073741824 Jun 24 03:41 edxapp.4
-rw-r--r-- 1 root    root      16777216 Jun 24 03:41 edxapp.ns
-rw------- 1 mongodb nogroup   67108864 Jun 24 03:35 local.0
-rw------- 1 mongodb nogroup   16777216 Jun 24 03:35 local.ns
###root@precise64:/edx/var/mongo/mongodb# chown -R -f mongodb:nogroup *
###root@precise64:/edx/var/mongo/mongodb# chmod -R -f 777 *
###root@precise64:/edx/var/mongo/mongodb# ls -la
total 2555936
drwxr-xr-x 2 mongodb mongodb       4096 Jun 24 05:45 .
drwxr-xr-x 3 mongodb mongodb       4096 Jun 27  2014 ..
-rwxrwxrwx 1 mongodb nogroup   67108864 Sep  1  2014 admin.0
-rwxrwxrwx 1 mongodb nogroup  134217728 Sep  1  2014 admin.1
-rwxrwxrwx 1 mongodb nogroup   16777216 Sep  1  2014 admin.ns
-rwxrwxrwx 1 mongodb nogroup   67108864 Oct 14  2014 cs_comments_service_development.0
-rwxrwxrwx 1 mongodb nogroup  134217728 Oct 11  2014 cs_comments_service_development.1
-rwxrwxrwx 1 mongodb nogroup   16777216 Oct 14  2014 cs_comments_service_development.ns
-rwxrwxrwx 1 mongodb nogroup   67108864 Jun 24 03:40 edxapp.0
-rwxrwxrwx 1 mongodb nogroup  134217728 Jun 24 03:40 edxapp.1
-rwxrwxrwx 1 mongodb nogroup  268435456 Jun 24 03:40 edxapp.2
-rwxrwxrwx 1 mongodb nogroup  536870912 Jun 24 03:41 edxapp.3
-rwxrwxrwx 1 mongodb nogroup 1073741824 Jun 24 03:41 edxapp.4
-rwxrwxrwx 1 mongodb nogroup   16777216 Jun 24 03:41 edxapp.ns
-rwxrwxrwx 1 mongodb nogroup   67108864 Jun 24 03:35 local.0
-rwxrwxrwx 1 mongodb nogroup   16777216 Jun 24 03:35 local.ns

###root@precise64:/edx/var/mongo/mongodb# mongo
MongoDB shell version: 2.4.7
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
###> use edxapp;
switched to db edxapp
###> db.repairDatabase()

你可能感兴趣的:(edx---Mongo,could not connect to localhost:27017:)