设为首页 加入收藏

TOP

MongoDB 3 分片集群安装配置(二)
2017-04-26 10:22:18 】 浏览:754
Tags:MongoDB 3分片 集群 安装 配置
nbsp;           "buildIndexes" : true,
            "hidden" : false,
            "priority" : 1,
            "tags" : {
                 
            },
            "slaveDelay" : NumberLong(0),
            "votes" : 1
        }
    ],
    "settings" : {
        "chainingAllowed" : true,
        "heartbeatIntervalMillis" : 2000,
        "heartbeatTimeoutSecs" : 10,
        "electionTimeoutMillis" : 10000,
        "catchUpTimeoutMillis" : 2000,
        "getLastErrorModes" : {
             
        },
        "getLastErrorDefaults" : {
            "w" : 1,
            "wtimeout" : 0
        },
        "replicaSetId" : ObjectId("58fe111823612a418eb7f3fc")
    }
}
shard-a:PRIMARY> config.members[0].priority = 2        # 这里增加自身主机的优先级为 2,防止后面 PRIMARY 重新选举到其余主机
2
shard-a:PRIMARY> rs.reconfig(config)                    # 重新应用该配置
{ "ok" : 1 }
shard-a:PRIMARY> rs.add("test2.lan:27017")            # 添加副本集主机
{ "ok" : 1 }
shard-a:PRIMARY> rs.add("test3.lan")                # 添加副本集主机(默认端口为 27017)
{ "ok" : 1 }
shard-a:PRIMARY> rs.config()
{
    "_id" : "shard-a",
    "version" : 4,
    "protocolVersion" : NumberLong(1),
    "members" : [
        {
            "_id" : 0,
            "host" : "test1.lan:27017",
            "arbiterOnly" : false,
            "buildIndexes" : true,
            "hidden" : false,
            "priority" : 2,
            "tags" : {
                 
            },
            "slaveDelay" : NumberLong(0),
            "votes" : 1
        },
        {
            "_id" : 1,
            "host" : "test2.lan:27017",
            "arbiterOnly" : false,
            "buildIndexes" : true,
            "hidden
首页 上一页 1 2 3 4 5 6 7 下一页 尾页 2/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL 5.7.x开启SSL连接 下一篇MySQL分库分表备份脚本

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目