How to install mongoDB on Ubuntu
来源:互联网 发布:java的wait 编辑:程序博客网 时间:2024/05/21 18:47
Ubuntu上如何安装mongodb数据库(How to install mongoDB on Ubuntu)
下文将会介绍如何安装mongodb 在你的ubuntu11.10
步骤总结:
- 在你的source.list添加10个gen包 (Add 10gen package to source.list)
- 升级系统的包(Update package)用sudo apt-get update
- 添加GPG密钥(Add GPG Key)
- 安装mongodb-10gen
- 完事
1. Add 10gen package to source.list
The 10gen package contains the latest mongoDB version, append below line to the end of the file “/etc/apt/sources.list”
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
For example, you can vim the “source.list” and append the 10gen package like this :
$ sudo vim /etc/apt/sources.list
File : /etc/apt/sources.list
#...content omitted ... ## This software is not part of Ubuntu, but is offered by third-party## developers who want to ship their latest software.deb http://extras.ubuntu.com/ubuntu natty maindeb-src http://extras.ubuntu.com/ubuntu natty main #mongo repo ###############new linedeb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
2. Update package
Update the modified “/etc/apt/sources.list” :
sudo apt-get update
Now, a new “mongodb-10gen – An object/document-oriented database” is available for install.
3. Add GPG Key
10gen package required GPG key, import it :
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
4. Install mongodb-10gen
Everything is ready, now you can Install the mongoDB package :
sudo apt-get install mongodb-10gen
5. Post-Installation
Now, mongoDB is installed, started, and auto start mongoDB script is generated to “/etc/init/mongo” and “/etc/init.d/mongo“. In addition, all mongoDB files are copied to “/usr/bin” folder.
The main configuration file “mongodb.conf” is located at “/etc/mongodb.conf“, change the values to customize your mongoDB server.
File : mongodb.conf
# mongodb.conf # Where to store the data. # Note: if you run mongodb as a non-root user (recommended) you may# need to create and set permissions for this directory manually,# e.g., if the parent directory isn't mutable by the mongodb user.dbpath=/var/lib/mongodb #where to loglogpath=/var/log/mongodb/mongodb.log logappend=true #port = 27017#......
6. Verification
To verify it, just connect it with “mongo”
$ mongoMongoDB shell version: 1.8.1connecting to: test>
- How to install mongoDB on Ubuntu
- [MongoDB--Unbuntu installation]---How to Install MongoDB on Ubuntu 16.04
- How to Install MongoDB on Windows
- How to Install MongoDB on CentOS7 Gracefully
- How to Install Fonts on Ubuntu
- How to install gCvs on ubuntu 10.04
- How to install p2psim on ubuntu.10.10
- How to install chrome on Ubuntu 10.10
- how to install software on ubuntu?
- How to install GSL on linux(ubuntu)
- How to install VNC on Ubuntu
- How to install flash plugin on Ubuntu
- How to install deb packages on Ubuntu
- How to install SmartSVN on Ubuntu 10.10
- How to Install Git on Ubuntu 12.04
- How to install GSL on ubuntu
- How to install Cacti on Ubuntu
- How to install eclipse on ubuntu/linux
- 异常等待事件Resmgr:Cpu Quantum导致CPU利用率高
- cppunit与工厂模式
- Axis的简单入门实例
- Android(cacerts.bks)添加根证书
- cppunit与组合模式
- How to install mongoDB on Ubuntu
- mysql client encode
- cppunit与观察者模式
- cppunit与单例模式
- Unix System Programming Notes
- 中国开源社区
- 网络编程之同步,阻塞,异步,非阻塞
- cppunit与装饰模式
- Android配置文件Manifest.xml如何被加载、解析的