MongoDB---一些常见错误总结
2014-06-06 14:49
543 查看
1.
在 王文龙 所写的 《MongoDB 实战》 中,写到:
创建主从key 文件,用于标识集群的私钥的完整路径,如果各个实例的key file 内容不一 致,程序将不能正常用。
我误以为 –keyFile 是各个节点之间的认证方式。其实不是的。各个节点之间的确认关系参数是 –replSet。只要此参数后面的内容一致。Replica Set 就可以创建成功。
在官方文档中提到:
You do not need to use the –auth option, too (although there’s no harm in doing so), –keyFile implies –auth. –auth does not imply –keyFile.
也就是说keyFile 其实包含了auth 的作用。
而当你加了 –keyFile 参数后,如果你要添加Shard,则会收到报错:
need to login
这和加了auth 的报错一致。
2.
route 启动的时候,连接config 不可以以localhost 为地址链接。不然会遇到以下错误:
“errmsg”: “can’t use localhost as a shard since all shards need to communicate. either use all shards and configdbs in localhost or all in actual IPs host: 172.16.5.104:20000
isLocalHost:0″
3.
如果不以localhost 为地址链接,那么config 启动的时候不能加 –auth 选项,不然会在log文件中遇到以下错误:
ERROR: config servers not in sync! not authorized, did you start with –keyFile?
此时进程无法启动
4.
在route 和config 准备完毕后,通过route 以远程IP 为地址添加shard,则报错:(有 –auth 参数)
db.runCommand({addshard:’a1:28010′})
{
“ok” : 0,
“errmsg”: “failed listing a1:28010′s databases:{ errmsg: \”need to login\”, ok: 0.0 }”
}
5. 依旧保留 –auth 参数,添加用户后,再添加shard。报错:
“errmsg” : “couldn’t connect to new shard DBClientBase::findN: transport error: a1:28010 query: { getlasterror: 1 }”
在 王文龙 所写的 《MongoDB 实战》 中,写到:
创建主从key 文件,用于标识集群的私钥的完整路径,如果各个实例的key file 内容不一 致,程序将不能正常用。
我误以为 –keyFile 是各个节点之间的认证方式。其实不是的。各个节点之间的确认关系参数是 –replSet。只要此参数后面的内容一致。Replica Set 就可以创建成功。
在官方文档中提到:
You do not need to use the –auth option, too (although there’s no harm in doing so), –keyFile implies –auth. –auth does not imply –keyFile.
也就是说keyFile 其实包含了auth 的作用。
而当你加了 –keyFile 参数后,如果你要添加Shard,则会收到报错:
need to login
这和加了auth 的报错一致。
2.
route 启动的时候,连接config 不可以以localhost 为地址链接。不然会遇到以下错误:
“errmsg”: “can’t use localhost as a shard since all shards need to communicate. either use all shards and configdbs in localhost or all in actual IPs host: 172.16.5.104:20000
isLocalHost:0″
3.
如果不以localhost 为地址链接,那么config 启动的时候不能加 –auth 选项,不然会在log文件中遇到以下错误:
ERROR: config servers not in sync! not authorized, did you start with –keyFile?
此时进程无法启动
4.
在route 和config 准备完毕后,通过route 以远程IP 为地址添加shard,则报错:(有 –auth 参数)
db.runCommand({addshard:’a1:28010′})
{
“ok” : 0,
“errmsg”: “failed listing a1:28010′s databases:{ errmsg: \”need to login\”, ok: 0.0 }”
}
5. 依旧保留 –auth 参数,添加用户后,再添加shard。报错:
“errmsg” : “couldn’t connect to new shard DBClientBase::findN: transport error: a1:28010 query: { getlasterror: 1 }”
相关文章推荐
- mysql Access denied for user \'root\'@\'localhost\'”解决办法总结,下面我们对常见的出现的一些错误代码进行分析并给出解决办法,有需要的朋友可参考一下。
- Java8中Optional的一些常见错误用法总结
- xCode常见的一些错误总结
- 关于Mongodb参数说明与常见错误处理的总结
- 工作中一些常见错误总结(不断总结)
- MongoDB 常见的登录错误总结
- PHP 中使用ajax时一些常见错误总结整理
- FreeMarker一些常见错误的总结
- Python学习笔记——一些常用函数、常见错误总结
- 最近工作中犯的一些错误,以及总结的体会
- JSF常见错误总结
- Unix C 常见编译错误总结(持续更新)
- asp.net最常见的错误总结!
- JSF常见错误总结
- 【转】SQL SERVER中一些常见性能问题的总结
- 关于LNK2001错误的一些总结
- SQL SERVER中一些常见性能问题的总结
- 指针与字符串操作的一些常见错误
- 文摘:关于LNK2001错误的一些总结
- SQL SERVER中一些常见性能问题的总结