Allow MongoDB to connect remotely

Source: Internet
Author: User
Tags mongodb ssh robomongo
Allow MongoDB to connect remotely

Recently used a QT-made database management software: Robomongo, it can connect MongoDB database, perform some query operations and get feedback. However, I found that Robomongo was only able to connect via SSH at that time:

That means that I want to let the database maintenance permissions to other administrators, it is necessary to have their own administrator account and password to other administrators, which is sometimes not secure, and more troublesome, some support remote connection programs, such as Mongodump, cannot be used-because there is no SSH login rights.

What about this change? I've been searching the web for a long time, and I finally found out that this is no other problem, the problem is in MongoDB itself.

To allow MongoDB to log on without SSH, you need to meet two conditions: 1, MongoDB database do not bind any ip;2, MongoDB database corresponding port (usually 27017) need to open up.

Here are the ways to support MongoDB remote connection: 1, configure mongodb.conf

Vi/etc/mongod.conf

Here you edit 11 lines of

BIND_IP = 127.0.0.1

#将其注释. 2. Open MongoDB corresponding port (usually 27017)

Iptables-a input-p tcp-m State--statenew-m tcp--dport 27017-j ACCEPT 3, for insurance purposes, the MongoDB service needs to be restarted

Service MongoDB Restart

MongoDB can then be accessed on port 27017.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.