- zadatak 2.dio projekta
Stalno mi baca gresku
pymongo.errors.ServerSelectionTimeoutError: rs2:27020: [Errno 11001] getaddrinfo failed,rs1:27019: [Errno 11001] getaddrinfo failed,rs0:27018: [Errno 11001] getaddrinfo failed,rs4:27022: [Errno 11001] getaddrinfo failed,rs3:27021: [Errno 11001] getaddrinfo failed, Timeout: 30s, Topology Description: <TopologyDescription id: 61e05b5fdbb9effe73359370, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('rs0', 27018) server_type: Unknown, rtt: None, error=AutoReconnect('rs0:27018: [Errno 11001] getaddrinfo failed')>, <ServerDescription ('rs1', 27019) server_type: Unknown, rtt: None, error=AutoReconnect('rs1:27019: [Errno 11001] getaddrinfo failed')>, <ServerDescription ('rs2', 27020) server_type: Unknown, rtt: None, error=AutoReconnect('rs2:27020: [Errno 11001] getaddrinfo failed')>, <ServerDescription ('rs3', 27021) server_type: Unknown, rtt: None, error=AutoReconnect('rs3:27021: [Errno 11001] getaddrinfo failed')>, <ServerDescription ('rs4', 27022) server_type: Unknown, rtt: None, error=AutoReconnect('rs4:27022: [Errno 11001] getaddrinfo failed')>]>
kada pokusam izvrsit python skriptu.
Ovako mi izgleda spajanje
myclient = pymongo.MongoClient("mongodb://rs0:27018,rs1:27019,rs2:27020,rs3:27021,rs4:27022/?replicaSet=rsnmbp")
i dalje stvaranje kolekcije, insertMany()…
Imam rs0…rs4 u \etc\hosts
Imam docker-compose-rs.yml datoteku definiranu ko sto su kolege gore vec navele.
Pokrenem je s docker compose -f docker-compose-rs.yml up
, udem u CLI od rs0, napisem mongo - -port 27018, napravim rsconf i rs.initiate isto ko sto je vec gore napisano.
Al stalno javlja onu gore gresku.
Je li mi nesto fali?