使用済みelasticsearchの人が知っておくべき、ダイナミックフラグメンテーションは、チャートを見て非常に強力で、ES、データのバックアップ・ノードは、自分が管理しているES
私mongodb4.xのクラスタセットアップの最初の7.1.1Spring動作するMongoDBで参照MongoDB4を。 0.2パッチ+レプリカセットのクラスタを構築し、MongoDBのスライスは、それを手動で指定する必要がありますでしょうか?
見てくださいMongoDBのキャパシティプランニングおよびハードウェア構成を完了するために、10分を
1主よ、仲裁のモードから1つに従って、それぞれの新しいノードは、それは3の倍数ではないでしょうか?
次のディレクトリに新しいノードが作成されるように、我々は中に、設定サーバーを作成する必要はありませんmongos.conf
変更することなく、コンテンツ
mkdir -p /application/data/mongodb/mongos/log
mkdir -p /application/data/mongodb/shard4/data
mkdir -p /application/data/mongodb/shard4/log
mkdir -p /application/data/mongodb/shard5/data
mkdir -p /application/data/mongodb/shard5/log
mkdir -p /application/data/mongodb/shard6/data
mkdir -p /application/data/mongodb/shard6/log
# shared4.conf
systemLog:
destination: file
logAppend: true
path: /application/data/mongodb/shard4/log/shared4.log
# Where and how to store data.
storage:
dbPath: /application/data/mongodb/shard4/data
journal:
enabled: true
# how the process runs
processManagement:
fork: true
pidFilePath: /application/data/mongodb/shard4/log/shard4.pid
# network interfaces
net:
port: 27004
bindIp: 0.0.0.0
#operationProfiling:
replication:
replSetName: shard4
sharding:
clusterRole: shardsvr
systemLog:
destination: file
logAppend: true
path: /application/data/mongodb/shard5/log/shared5.log
# Where and how to store data.
storage:
dbPath: /application/data/mongodb/shard5/data
journal:
enabled: true
# how the process runs
processManagement:
fork: true
pidFilePath: /application/data/mongodb/shard5/log/shard5.pid
# network interfaces
net:
port: 27005
bindIp: 0.0.0.0
#operationProfiling:
replication:
replSetName: shard5
sharding:
clusterRole: shardsvr
systemLog:
destination: file
logAppend: true
path: /application/data/mongodb/shard6/log/shared6.log
# Where and how to store data.
storage:
dbPath: /application/data/mongodb/shard6/data
journal:
enabled: true
# how the process runs
processManagement:
fork: true
pidFilePath: /application/data/mongodb/shard1/log/shard6.pid
# network interfaces
net:
port: 27006
bindIp: 0.0.0.0
#operationProfiling:
replication:
replSetName: shard6
sharding:
clusterRole: shardsvr
シャードを開始するには、次のコマンドを実行
mongod -f /application/data/mongodb/config/shard4.conf
mongod -f /application/data/mongodb/config/shard5.conf
mongod -f /application/data/mongodb/config/shard6.conf
そして、スライスの設定
mongo --port 27004
config = {
_id : "shard4",
members : [
{_id : 0, host : "bwhs163:27004", priority : 2 },
{_id : 1, host : "bwhs164:27004" , arbiterOnly :true},
{_id : 2, host : "bwhs165:27004", priority : 1 }
]
}
rs.initiate(config)
mongo --port 27005
config = {
_id : "shard5",
members : [
{_id : 0, host : "bwhs163:27005", priority : 1 },
{_id : 1, host : "bwhs164:27005" , priority :2},
{_id : 2, host : "bwhs165:27005", arbiterOnly :true }
]
}
rs.initiate(config)
mongo --port 27006
config = {
_id : "shard6",
members : [
{_id : 0, host : "bwhs163:27006", arbiterOnly :true },
{_id : 1, host : "bwhs164:27006" , priority :2},
{_id : 2, host : "bwhs165:27006", priority : 2 }
]
}
rs.initiate(config)
ファイル名を指定して実行mongos -f /application/data/mongodb/config/mongos.conf
、それをスライスして、その後、
mongo --port 20000
use admin
sh.addShard("shard4/bwhs163:27004,bwhs164:27004,bwhs164:27004")
sh.addShard("shard5/bwhs163:27005,bwhs164:27005,bwhs164:27005")
sh.addShard("shard6/bwhs163:27006,bwhs164:27006,bwhs164:27006")
実行はdb.stats()
、対応するデータベース内のどのスライスを見ることができます。