Mongodb ubuntu under installation with remote connection

Source: Internet
Author: User
Tags install mongodb mongodb

Ubuntu under Installation and remote connection

Install, view services, whether the service starts automatically on boot, view ports, local connections, remote connections.

Installation

Apt Install MongoDB

View Services

Ll/etc/init.d

-rwxr-xr-x 1 root root 7768 June mongodb*

Service MongoDB Status

Mongodb.service-an object/document-oriented Database

Loaded:loaded (/lib/systemd/system/mongodb.service; enabled; Vendor Preset:

Active:active (running) since three 2018-08-01 12:43:19 CST; 1min 12s ago

Docs:man:mongod (1)

Main pid:3017 (Mongod)

CGroup:/system.slice/mongodb.service

└─3017/usr/bin/mongod--config/etc/mongodb.conf

Obviously, the service starts automatically after installation.

Whether the service starts automatically with boot

Reboot

Obviously, the MongoDB service starts automatically with the boot.

View ports

Netstat-anpl|grep MONGO

TCP 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 994/mongod

Local connection

Mongo

MongoDB Shell version:2.6.10

Connecting To:test

Welcome to the MongoDB shell.

For interactive help, type ' help '.

For more comprehensive documentation, see

http://docs.mongodb.org/

Questions? Try the Support group

Http://groups.google.com/group/mongodb-user

>

Remote connection

1 Modify the configuration file.

Vim/etc/mongodb.conf

Comment out the bind_ip=127.0.0.1 line or modify it to bind_ip=0.0.0.0

2 Restart the service (depending on the situation if necessary).

/etc/init.d/mongodb restart

3 Firewall Open ports (depending on the situation).

Iptables-a input-p tcp-m State--state new-m TCP--dport 27017-j ACCEPT

MONGO Client

Mongod Server

Mongodb ubuntu under installation with remote connection

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.