91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

mongodb shard

發布時間:2020-07-09 02:44:03 來源:網絡 閱讀:608 作者:wdg0802 欄目:MongoDB數據庫
serverA:172.16.200.200
     /data/mongodb/db/{shard1_200,shard2_200,shard3_200,config}
    /data1/logs/mongodb/
serverB:172.16.200.201
   /data/mongodb/db/{shard1_201,shard2_201,shard3_201,config}
    /data1/logs/mongodb/
serverC:172.16.200.202
  /data/mongodb/db/{shard1_202,shard2_202,shard3_202,config}
    /data1/logs/mongodb/


serverA:./mongod --shardsvr --replSet shard1 --port 29001 --dbpath=/data/mongodb/db/shard1_200/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard1_200.log --logappend --fork --nohttpinterface —directoryperdb

serverB:
./mongod --shardsvr --replSet shard1 --port 29001 --dbpath=/data/mongodb/db/shard1_201/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard1_201.log --logappend --fork --nohttpinterface --directoryperdb
serverC:

./mongod --shardsvr --replSet shard1 --port 29001 --dbpath=/data/mongodb/db/shard1_202/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard1_202.log --logappend --fork --nohttpinterface —directoryperdb
登陸mongo
./mongo --port 29001
> config = {_id: 'shard1', members: [
... {_id: 0, host: '172.16.200.200:29001',priority:1},
... {_id: 1, host: '172.16.200.201:29001',priority:0},
... {_id: 2, host: '172.16.200.202:29001',arbiterOnly:true}]};
{
       "_id" : "shard1",
       "members" : [
               {
                       "_id" : 0,
                       "host" : "172.16.200.200:29001",
                       "priority" : 1
               },
               {
                       "_id" : 1,
                       "host" : "172.16.200.201:29001",
                       "priority" : 0
               },
               {
                       "_id" : 2,
                       "host" : "172.16.200.202:29001",
                       "arbiterOnly" : true
               }
       ]
}
> rs.initiate(config);
{
       "info" : "Config now saved locally.  Should come online in about a minute.",
       "ok" : 1
}
>
shard1:SECONDARY>
shard1:SECONDARY>
serverA:
./mongod --shardsvr --replSet shard2 --port 29002 --dbpath=/data/mongodb/db/shard2_200/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard2_201.log --logappend --fork --nohttpinterface --directoryperdb
serverB:
./mongod --shardsvr --replSet shard2 --port 29002 --dbpath=/data/mongodb/db/shard2_201/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard2_201.log --logappend --fork --nohttpinterface --directoryperdb
serverC:
./mongod --shardsvr --replSet shard2 --port 29002 --dbpath=/data/mongodb/db/shard2_202 --oplogSize 10240 --logpath=/data1/logs/mongodb/shard2_202.log --logappend --fork --nohttpinterface --directoryperdb
登錄mong
./mongo --port 29002
[root@serverA bin]# ./mongo --port 29002
MongoDB shell version: 2.6.0
connecting to: 127.0.0.1:29002/test
> config = {_id: 'shard2', members: [
... {_id: 0, host: '172.16.200.200:29002',priority:1},
... {_id: 1, host: '172.16.200.201:29002',priority:0},
... {_id: 2, host: '172.16.200.202:29002',arbiterOnly:true}]};
{
       "_id" : "shard2",
       "members" : [
               {
                       "_id" : 0,
                       "host" : "172.16.200.200:29002",
                       "priority" : 1
               },
               {
                       "_id" : 1,
                       "host" : "172.16.200.201:29002",
                       "priority" : 0
               },
               {
                       "_id" : 2,
                       "host" : "172.16.200.202:29002",
                       "arbiterOnly" : true
               }
       ]
}
> rs.initiate(config);
{
       "info" : "Config now saved locally.  Should come online in about a minute.",
       "ok" : 1
}
>
shard2:SECONDARY>
shard2:PRIMARY>
serverA:
./mongod --shardsvr --replSet shard3 --port 29003 --dbpath=/data/mongodb/db/shard3_200/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard3_200.log --logappend --fork --nohttpinterface --directoryperdb
serverB:
./mongod --shardsvr --replSet shard3 --port 29003 --dbpath=/data/mongodb/db/shard3_201/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard3_201.log --logappend --fork --nohttpinterface --directoryperdb
serverC:
./mongod --shardsvr --replSet shard3 --port 29003 --dbpath=/data/mongodb/db/shard3_202/ --oplogSize 10240 --logpath=/data1/logs/mongodb/shard3_202.log --logappend --fork --nohttpinterface --directoryperdb
[root@serverA bin]# ./mongo --port 29003
MongoDB shell version: 2.6.0
connecting to: 127.0.0.1:29003/test
> config = {_id: 'shard3', members: [
... {_id: 0, host: '172.16.200.200:29003',priority:1},
... {_id: 1, host: '172.16.200.201:29003',priority:0},
... {_id: 2, host: '172.16.200.202:29003',arbiterOnly:true}]};
{
       "_id" : "shard3",
       "members" : [
               {
                       "_id" : 0,
                       "host" : "172.16.200.200:29003",
                       "priority" : 1
               },
               {
                       "_id" : 1,
                       "host" : "172.16.200.201:29003",
                       "priority" : 0
               },
               {
                       "_id" : 2,
                       "host" : "172.16.200.202:29003",
                       "arbiterOnly" : true
               }
       ]
}
> rs.initiate(config);
{
       "info" : "Config now saved locally.  Should come online in about a minute.",
       "ok" : 1
}
>
shard3:SECONDARY>
shard3:SECONDARY>
shard3:SECONDARY>
shard3:PRIMARY>
啟動config
serverA:
./mongod --configsvr --dbpath=/data/mongodb/db/config/ --port 29000 --logpath=/data1/logs/mongodb/config_200.log --logappend --fork --nohttpinterface --directoryperdb
serverB:
./mongod --configsvr --dbpath=/data/mongodb/db/config/ --port 29000 --logpath=/data1/logs/mongodb/config_201.log --logappend --fork --nohttpinterface --directoryperdb
serverC:
./mongod --configsvr --dbpath=/data/mongodb/db/config/ --port 29000 --logpath=/data1/logs/mongodb/config_202.log --logappend --fork --nohttpinterface --directoryperdb
啟動mongos
serverA:
./mongos --configdb 172.16.200.200:29000,172.16.200.201:29000,172.16.200.202:29000 --port 27001 --chunkSize 8 --logpath=/data1/logs/mongodb/mongos_200.log --logappend --fork --nohttpinterface
serverB:
./mongos --configdb 172.16.200.200:29000,172.16.200.201:29000,172.16.200.202:29000 --port 27001 --chunkSize 8 --logpath=/data1/logs/mongodb/mongos_201.log --logappend --fork --nohttpinterface
serverC:
./mongos --configdb 172.16.200.200:29000,172.16.200.201:29000,172.16.200.202:29000 --port 27001 --chunkSize 8 --logpath=/data1/logs/mongodb/mongos_202.log --logappend --fork --nohttpinterface

配置sharding
./mono --port 27001
mongos> use admin
switched to db admin
db.runCommand( { addshard:"shard1/172.16.200.200:29001,172.16.200.201:29001,172.16.200.202:29001",name:"s1"} );
{ "shardAdded" : "s1", "ok" : 1 }
mongos> db.runCommand( { addshard:"shard2/172.16.200.201:29002,172.16.200.202:29002,172.16.200.200:29002",name:"s2"} );
{ "shardAdded" : "s2", "ok" : 1 }
mongos> db.runCommand( { addshard:"shard3/172.16.200.202:29003,172.16.200.200:29003,172.16.200.201:29003",name:"s3"} )
{ "shardAdded" : "s3", "ok" : 1 }
mongos>
[root@serverA bin]# ./mongo --port 27001
MongoDB shell version: 2.6.0
connecting to: 127.0.0.1:27001/test
mongos>

mongos> show dbs
admin     0.016GB
config    0.016GB
congig    (empty)mongos> use config
switched to db config
mongos> show collections
changelog
chunks
collections
databases
lockpings
locks
mongos
settings
shards
system.indexes
tags
version






向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

汤阴县| 突泉县| 融水| 上饶县| 高阳县| 江阴市| 嘉鱼县| 肇庆市| 新绛县| 南江县| 邵东县| 苗栗市| 拉萨市| 防城港市| 鄂托克旗| 三亚市| 隆昌县| 金川县| 沭阳县| 姜堰市| 和平区| 冷水江市| 山阳县| 灯塔市| 铜鼓县| 宜春市| 兴海县| 兴业县| 旅游| 策勒县| 米脂县| 濮阳市| 大厂| 新余市| 宜君县| 上犹县| 定边县| 绥滨县| 三亚市| 阿克苏市| 横峰县|