Mongo脚本连接Replica-set

来源:未知 责任编辑:责任编辑 发表时间:2013-12-18 11:37 点击:

现在已经支持直接自动连接到replica-set,并登录primary

比如:

mongo --host rs1/vm1:27017,vm3:27017,vm4:27017 db_name然后会看到一堆信息

Thu Dec 12 16:44:48.227 successfully connected to seed vm1:27017 for replica set rs1 Thu Dec 12 16:44:48.228 changing hosts to { 0: "vm1:27017", 1: "vm4:27017", 2: "vm3:27017" } from rs1/ Thu Dec 12 16:44:48.228 trying to add new host vm1:27017 to replica set rs1 Thu Dec 12 16:44:48.229 successfully connected to new host vm1:27017 in replica set rs1 Thu Dec 12 16:44:48.229 trying to add new host vm3:27017 to replica set rs1 Thu Dec 12 16:44:48.232 successfully connected to new host vm3:27017 in replica set rs1 Thu Dec 12 16:44:48.232 trying to add new host vm4:27017 to replica set rs1 Thu Dec 12 16:44:48.234 successfully connected to new host vm4:27017 in replica set rs1 Thu Dec 12 16:44:48.240 Primary for replica set rs1 changed to vm1:27017 Thu Dec 12 16:44:48.247 replica set monitor for replica set rs1 started, address is rs1/vm1:27017,vm3:27017,vm4:27017 Thu Dec 12 16:44:48.247 [ReplicaSetMonitorWatcher] starting

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • db2管理工具小结
    • DB2数据库的导出与导入(Windows客户端)
    • db2 CLP中如何换行
    • DB2查看表结构及所用表语句
    • DB2 · CREATE TABLESPACE
    • 使用DB2对象:创建模式、表和视图
    • DB2数据库逻辑卷的复制
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1