dpb42021 2013-04-25 23:40
浏览 63
已采纳

在Dreamhost VPS上配置MongoDB的问题

I have MongoDB up and running - I am able to sign into my VPS via SSH and execute the mongo command.

Here is where I run into a problem. Here are some test commands and their output:

[*******]$ mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> db
test
> db.test.save({a:1});
unauthorized

Here is another example of test input and its output:

[*******]$ 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

So I'm a bit stuck - I don't know if this will help or not, but here is some sample code and output when using the PHP class as well:

Script

<?php
$dbHost = $dbHost = 'mongodb://*******.dreamhostps.com';;
$m = new Mongo($dbHost);
var_dump($m);
?>

Output

object(Mongo)#2 (4) { ["connected"]=> bool(true) ["status"]=> NULL ["server":protected]=> string(33) "mongodb://ps93785.dreamhostps.com" ["persistent":protected]=> NULL }

Other Notes

Server location was redacted - I am not actually using asterisks.

Update - output from 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
  • 写回答

1条回答 默认 最新

  • dsf12123 2013-04-25 23:44
    关注

    Try something such as db.fsyncUnlock() in Mongo Shell to test if the fsync lock is active and try to repeat the save of any info.

    Here is the documentation of the db.fsyncUnlock

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计
  • ¥20 用keil,写代码解决两个问题,用库函数
  • ¥50 ID中开关量采样信号通道、以及程序流程的设计
  • ¥15 U-Mamba/nnunetv2固定随机数种子
  • ¥15 vba使用jmail发送邮件正文里面怎么加图片
  • ¥15 vb6.0如何向数据库中添加自动生成的字段数据。