Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

Find the IP address of the server which my MongoDB is deployed on

I have an own deployed MongoDB which is the database of my parse server. Parse server requires a DATABASE_URI and I pass mongodb://user:password@mongodb:27017/main?authSource=admin&authMechanism=SCRAM-SHA-1 to it and I'm able to save data from my android client to database. I've changed only the username and password than the real URI and the rest is exactly the same. But when I try to connect to my MongoDB from MongoDB Compass or similar tools, I get connection refused error. Since my parse server and my MongoDB are deployed on the same server, it seems that I should change the mongodb part of the DATABASE_URI, after @ and before : . But I can not find the correct subdomain or host name or IP address so I still get the connection refused error. My question is, is there a command to get the IP address of MongoDB server in MongoDB shell, or anything I can replace with the host name in URI?


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

1 Answer

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

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