Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

MongoDB

Newbie Spellweaver
Joined
Apr 24, 2018
Messages
40
Reaction score
2
Hey guys, I would like to know what I have to do, so I can access the MongoDB from a remote access, not just from the localhost.

Thank you!
 
Initiate Mage
Joined
Apr 23, 2018
Messages
4
Reaction score
2
First SSH into your server and enter the mongo shell by typing MONGO For this example, I will set up a user named ian and give that user read & write access to the cool_db database.
use cool_db

db.createUser({
user: 'ian',
pwd: 'secretPassword',
roles: [{ role: 'readWrite', db:'cool_db'}]
})Enable auth and open MongoDB access up to all IPs
Edit your MongoDB config file
sudo vim /etc/mongod.conf

Look for the net line and comment out the bindIp line under it, which is currently limiting MongoDB connections to localhost:

# network interfacesnet: port: 27017# bindIp: 127.0.0.1 <- comment out this line

Scroll down to the #security: section and add the following line. Make sure to un-comment the security: line.
security: authorization: 'enabled'

after open port 2017 and restart mongo daemon.
profit )))
 
Upvote 0
Newbie Spellweaver
Joined
Apr 24, 2018
Messages
40
Reaction score
2
First SSH into your server and enter the mongo shell by typing MONGO For this example, I will set up a user named ian and give that user read & write access to the cool_db database.
use cool_db

db.createUser({
user: 'ian',
pwd: 'secretPassword',
roles: [{ role: 'readWrite', db:'cool_db'}]
})Enable auth and open MongoDB access up to all IPs
Edit your MongoDB config file
sudo vim /etc/mongod.conf

Look for the net line and comment out the bindIp line under it, which is currently limiting MongoDB connections to localhost:

# network interfacesnet: port: 27017# bindIp: 127.0.0.1 <- comment out this line

Scroll down to the #security: section and add the following line. Make sure to un-comment the security: line.
security: authorization: 'enabled'

after open port 2017 and restart mongo daemon.
profit )))

Thank you so much!!
 
Upvote 0
Back
Top