我启动并运行了MongoDB - 我可以通过SSH登录到我的VPS并执行mongo
命令。在Dreamhost VPS上配置MongoDB的问题
这里是我遇到问题的地方。下面是一些测试命令及其输出:
[*******]$ mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> db
test
> db.test.save({a:1});
unauthorized
下面是测试输入和输出的另一个例子:
[*******]$ mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> use admin
switched to db admin
> db.addUser({ user: "drew", pwd: "myPassword", roles: [ "userAdminAnyDatabase" ] })
Thu Apr 25 16:34:37 JS Error: uncaught exception: error {
"$err" : "unauthorized db:admin lock type:-1 client:127.0.0.1",
"code" : 10057
}
unauthorized db:admin lock type:-1 client:127.0.0.1
所以我有点卡住 - 我不知道这是否会帮助或没有,但这里是一些示例代码和输出使用PHP类以及时:
脚本
<?php
$dbHost = $dbHost = 'mongodb://*******.dreamhostps.com';;
$m = new Mongo($dbHost);
var_dump($m);
?>
个
输出
object(Mongo)#2 (4) { ["connected"]=> bool(true) ["status"]=> NULL ["server":protected]=> string(33) "mongodb://ps93785.dreamhostps.com" ["persistent":protected]=> NULL }
其他注意事项
服务器位置被节录 - 我没有实际使用星号。
更新 - 从fsyncUnlock()
[*******]$ mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> db.fsyncUnlock()
Thu Apr 25 17:36:40 JS Error: TypeError: db.fsyncUnlock is not a function (shell):0
文档如果您有任何疑问或需要我们有提供24/7的科技股的任何援助,我们保证在一个开放的车票24个小时的响应。我们也有实时聊天功能!这里是[联系支持](https://panel.dreamhost.com/index.cgi)的链接。 – 2013-05-01 13:07:53
@DeeJ - 我从你们那里得到的最后一封电子邮件中说,你无法升级我的MongoDB安装 - 是最终答案,还是我可以直接与你联系? – drewwyatt 2013-05-01 13:46:51