Configure the remote connection configuration of mongodb in the following four steps. 1. Add the Administrator account useadminswitchedtodbadmindb. addUser (tank, test); 2. Configure mongodb. conf # bind_ip127.0.0.1 comment this line authtrue remove the comment before this line 3, restart mongodbetcinit. d0000d4, open firewall 270
Configure the remote connection configuration of mongodb in the following four steps. 1. Add the Administrator account use adminswitched to db admin db. addUser ('tank', 'test'); 2. Configure mongodb. conf # bind_ip = 127.0.0.1 // comment this line auth = true // remove the comment before this line 3 and restart mongodb/etc/init. d/ipvd 4, open firewall 270
Configure the remote connection configuration of mongodb in the following four steps.
1. Add an Administrator Account
> use adminswitched to db admin> db.addUser('tank','test');
2. Configure mongodb. conf
# Bind_ip = 127.0.0.1 // comment this line auth = true // remove the comment before this line
3. Restart mongodb.
/etc/init.d/mongod
4. Open firewall port 27017
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 27017 -j ACCEPT
5. Test
Mongdb remote connection
Original article address: detailed explanation of mongodb remote connection. Thanks to the original author for sharing.