Mongodb installation under Ubuntu environment

Today, we try to establish some of the services on the virtual machine, pm2 management node, such as the establishment of mongodb.

On the installation mongodb stepped on some pit, record it.

installation steps

Reference: for MongoDB mounting step in Ubuntu

After installed, the computer tries to connect with robo3T mongodb on the virtual machine, and found that the normal connection, but the time has been to create a database error. This was found to be installed on the virtual machine version is very old version needs to be updated.

updated version

Refer to the official document: https://docs.mongodb.com/master/tutorial/install-mongodb-on-ubuntu/?_ga=2.248935234.453417702.1528768122-1832599284.1528768122

After the steps according to official documents given command to do good can be installed, the installation to the latest version, is the start of mongod service rather than mongodb, you need to pay attention.

Profiles

After the virtual machine is installed, the machine does not directly connect, because mongodb profile bindIp ip on the virtual machine is configured virtual machine environment, that is 127.0.0.1, it needs to be changed to generic ip

vim /etc/mongod.conf

Then changed inside bindIp 0.0.0.0

vim /etc/mongodb.conf

Then changed inside bindIp 0.0.0.0

I changed both can connect a success, specifically to see which profile is no specific test.

Guess you like

Origin www.cnblogs.com/chengquanomg/p/11775686.html