Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ubuntu simple installation of Mongodb

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Ubuntu simple installation of Mongodb

System: ubuntu 12.04 x64

Here is the simplest way to install

1. Add an update source for domestic 163

First back up the list of Ubuntu12.04 sources

Sudo cp / etc/apt/sources.list / etc/apt/sources.list.bak

Modify the update source (163 source) and add it on the last line

Sudo vi / etc/apt/sources.list

Deb http://mirrors.163.com/ubuntu/ precise main restricted

Deb-src http://mirrors.163.com/ubuntu/ precise main restricted

Deb http://mirrors.163.com/ubuntu/ precise-updates main restricted

Deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted

Deb http://mirrors.163.com/ubuntu/ precise universe

Deb-src http://mirrors.163.com/ubuntu/ precise universe

Deb http://mirrors.163.com/ubuntu/ precise-updates universe

Deb-src http://mirrors.163.com/ubuntu/ precise-updates universe

Deb http://mirrors.163.com/ubuntu/ precise multiverse

Deb-src http://mirrors.163.com/ubuntu/ precise multiverse

Deb http://mirrors.163.com/ubuntu/ precise-updates multiverse

Deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse

Deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

Deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

Deb http://mirrors.163.com/ubuntu/ precise-security main restricted

Deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted

Deb http://mirrors.163.com/ubuntu/ precise-security universe

Deb-src http://mirrors.163.com/ubuntu/ precise-security universe

Deb http://mirrors.163.com/ubuntu/ precise-security multiverse

Deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse

Deb http://extras.ubuntu.com/ubuntu precise main

Deb-src http://extras.ubuntu.com/ubuntu precise main

Update sourc

Sudo apt-get update

two。 Install mongodb

Sudo apt-get install mongodb

After the installation is complete, run the mongod program automatically to see if it is running

Pgrep mongo-l

800 mongod

Access to the database

Mongo

MongoDB shell version: 2.0.4

Connecting to: test

> exit

Create a directory

Sudo mkdir-p / data/mongodb/db / data/mongodb/log

Startup program

Sudo mongod-dbpath / data/mongodb/db-logpath / data/mongodb/log/mongodb.log-logappend

All output going to: / data/mongodb/log/mongodb.log

View Port

Sudo netstat-nalupt | grep mongo

Tcp 00 127.0.0.1 27017 0.0.0.0 * LISTEN 800/mongod

Tcp 00 127.0.0.1 28017 0.0.0.0 * LISTEN 800/mongod

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report