Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
527 views
in Technique[技术] by (71.8m points)

mongodb - Atlas Mongo : No address associated error

My code is getting connected to Mongo Cluster but giving exception as well later

2021-01-09 10:27:04,358 [cluster-ClusterId{value='5ff984f53051d07265915193', description='null'}-myac-demo-shard-00-00.hn89s.mongodb.net:27017] INFO  - diagnostics.logging.SLF4JLogger (SLF4JLogger.java:71) | {} | Monitor thread successfully connected to server with description ServerDescription{address=myac-demo-shard-00-00.hn89s.mongodb.net:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=252439567, setName='atlas-97d1j6-shard-0', canonicalAddress=myac-demo-shard-00-00.hn89s.mongodb.net:27017, hosts=[myac-demo-shard-00-02.hn89s.mongodb.net:27017, myac-demo-shard-00-01.hn89s.mongodb.net:27017, myac-demo-shard-00-00.hn89s.mongodb.net:27017], passives=[], arbiters=[], primary='myac-demo-shard-00-02.hn89s.mongodb.net:27017', tagSet=TagSet{[Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='AP_NORTHEAST_1'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=null, setVersion=1, lastWriteDate=Sat Jan 09 10:27:01 UTC 2021, lastUpdateTimeNanos=1051125373154500}
2021-01-09 10:27:04,358 [cluster-ClusterId{value='5ff984f53051d07265915193', description='null'}-myac-demo-shard-00-01.hn89s.mongodb.net:27017] INFO  - diagnostics.logging.SLF4JLogger (SLF4JLogger.java:71) | {} | Monitor thread successfully connected to server with description ServerDescription{address=myac-demo-shard-00-01.hn89s.mongodb.net:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=251190466, setName='atlas-97d1j6-shard-0', canonicalAddress=myac-demo-shard-00-01.hn89s.mongodb.net:27017, hosts=[myac-demo-shard-00-02.hn89s.mongodb.net:27017, myac-demo-shard-00-01.hn89s.mongodb.net:27017, myac-demo-shard-00-00.hn89s.mongodb.net:27017], passives=[], arbiters=[], primary='myac-demo-shard-00-02.hn89s.mongodb.net:27017', tagSet=TagSet{[Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='AP_NORTHEAST_1'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=null, setVersion=1, lastWriteDate=Sat Jan 09 10:27:01 UTC 2021, lastUpdateTimeNanos=1051125372345179}
2021-01-09 10:27:04,359 [cluster-ClusterId{value='5ff984f53051d07265915193', description='null'}-myac-demo-shard-00-02.hn89s.mongodb.net:27017] INFO  - diagnostics.logging.SLF4JLogger (SLF4JLogger.java:71) | {} | Monitor thread successfully connected to server with description ServerDescription{address=myac-demo-shard-00-02.hn89s.mongodb.net:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=258466617, setName='atlas-97d1j6-shard-0', canonicalAddress=myac-demo-shard-00-02.hn89s.mongodb.net:27017, hosts=[myac-demo-shard-00-02.hn89s.mongodb.net:27017, myac-demo-shard-00-01.hn89s.mongodb.net:27017, myac-demo-shard-00-00.hn89s.mongodb.net:27017], passives=[], arbiters=[], primary='myac-demo-shard-00-02.hn89s.mongodb.net:27017', tagSet=TagSet{[Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='AP_NORTHEAST_1'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=7fffffff0000000000000002, setVersion=1, lastWriteDate=Sat Jan 09 10:27:01 UTC 2021, lastUpdateTimeNanos=1051125375100888}

BUT GIVES BELOW ERROR AS WELL LATER

diagnostics.logging.SLF4JLogger (SLF4JLogger.java:76) | {} | Exception in monitor thread while connecting to server myac-demo.hn89s.mongodb.net:27017
com.mongodb.MongoSocketException: myac-demo.hn89s.mongodb.net: No address associated with hostname

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...