俺です。
どうでもいいことに詰まって禿げてたけど解決したので自戒を込めてメモ
mongodbのレプリカセット作成時に、ホスト名とポート番号を指定するの忘れないように。
デフォルトポート27017ではないmongodbを作る時にハマります。俺が。
- エラーケース
No host described in new configuration 1 for replica set orenoreplicaset maps to this node
> config = {
... "_id": "orenoreplicaset",
... "members": [
... { "_id": 0, "host": '172.16.10.21'},
... { "_id": 1, "host": '172.16.10.22'},
... { "_id": 2, "host": '172.16.10.23'}
... ]
... }
> rs.initiate(config){
"ok" : 0,
"errmsg" : "No host described in new configuration 1 for replica set orenoreplicaset maps to this node",
"code" : 93
}
- 正しくはこれ
config = {
"_id": "orenoreplicaset",
"members": [
{ "_id": 0, "host": '172.16.10.21:37017'},
{ "_id": 1, "host": '172.16.10.22:37017'},
{ "_id": 2, "host": '172.16.10.23:37017'}
]
}
rs.initiate(config);
{ "ok" : 1 }