WickyWinslow
Zar ne bi on trebao znato da ono što dolazi na 27022 translatira na 27017 ?
Probao sam da sve budu isti portovi.
Ovo je novi docker compose
version: '3'
services:
rs10:
image: mongo:4.4
ports:
- "27018:27018"
command: mongod --replSet rsnmbp
volumes:
- rs10_data:/data/db
- ./nmbprsdata10:/nmbpdata
rs11:
image: mongo:4.4
ports:
- "27019:27019"
command: mongod --replSet rsnmbp
volumes:
- rs11_data:/data/db
- ./nmbprsdata11:/nmbpdata
rs12:
image: mongo:4.4
ports:
- "27020:27020"
command: mongod --replSet rsnmbp
volumes:
- rs12_data:/data/db
- ./nmbprsdata12:/nmbpdata
rs13:
image: mongo:4.4
ports:
- "27021:27021"
command: mongod --replSet rsnmbp
volumes:
- rs13_data:/data/db
- ./nmbprsdata13:/nmbpdata
rs14:
image: mongo:4.4
ports:
- "27022:27022"
command: mongod --replSet rsnmbp
volumes:
- rs14_data:/data/db
- ./nmbprsdata14:/nmbpdata
volumes:
rs10_data:
rs11_data:
rs12_data:
rs13_data:
rs14_data:
Kada napravim docker ps -a dobijem ovo, opet se pojavljuje ova port 27017 (vidi pod ports)
No sada ne mogi inicijalizirati replica set sa
rsconf = {
_id: "rsnmbp",
members: [
{
_id: 0,
host: "rs10:27018"
},
{
_id: 1,
host: "rs11:27019"
},
{
_id: 2,
host: "rs12:27020"
},
{
_id: 3,
host: "rs13:27021"
},
{
_id: 4,
host: "rs14:27022"
},
]
}
rs.initiate(rsconf)
javlja mi
“errmsg” : “No host described in new configuration with {version: 1, term: 0} for replica set rsnmbp maps to this node”,
Pretpostavljam da moram promjeniti port ovih hostova gore na 27017, no onda mi to nema opet nema smisla.
Što treba stavit za rs.conf ?
Jel tebi radi, ako da kako ti izgleda compose file i što si napisao za rs.conf ?