MongoDB---一些常见错误总结
来源:互联网 发布:java 调用maven 编辑:程序博客网 时间:2024/06/05 12:14
创建主从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---一些常见错误总结
- MongoDB常见错误总结
- FreeMarker一些常见错误的总结
- xCode常见的一些错误总结
- MongoDb常见错误
- 工作中一些常见错误总结(不断总结)
- MongoDB常见错误解决方式
- 一些常见错误
- hibernate一些常见错误
- JSF常见错误总结
- JSF常见错误总结
- JSF常见错误总结
- Oracle常见错误总结
- java常见错误总结
- HTTP常见错误总结
- oracle常见错误总结
- html 常见错误总结
- Hadoop常见错误总结
- FMDB
- Choose a destination with a supported architecture in order to run on this device
- iOS---------CMTimeMake和CMTimeMakeWithSeconds 详解
- ubuntu下安装opencv 1.0【加额外库】
- Android NDK开发入门实例
- MongoDB---一些常见错误总结
- POJ 1770 Special Experiment
- 宝马汽车520i热车启动困难的故障现象
- rman自动备份脚本
- Android 点击事件分发、捕获
- Permission denied (publickey).
- 开发者保护应用安全的5大技巧
- Java(concurrency)
- Linux环境编程之同步(三):读写锁