ubuntu简单安装Mongodb-创新互联
ubuntu 简单安装 Mongodb
应县网站建设公司创新互联,应县网站设计制作,有大型网站制作公司丰富经验。已为应县上千提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的应县做网站的公司定做!系统:ubuntu 12.04 x64
下面介绍最简单的安装方式
1.添加国内163的更新源
首先备份Ubuntu12.04源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
修改更新源(163源),在最后一行添加
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
更新源
sudo apt-get update
2.安装mongodb
sudo apt-get install mongodb
安装完成之后,自动运行mongod程序,查看是否运行
pgrep mongo -l
800 mongod
进入数据库
mongo
MongoDB shell version: 2.0.4
connecting to: test
>exit
创建目录
sudo mkdir -p /data/mongodb/db /data/mongodb/log
启动程序
sudo mongod --dbpath /data/mongodb/db --logpath /data/mongodb/log/mongodb.log --logappend
all output going to: /data/mongodb/log/mongodb.log
查看端口
sudo netstat -nalupt | grep mongo
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 800/mongod
tcp 0 0 127.0.0.1:28017 0.0.0.0:* LISTEN 800/mongod
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
本文名称:ubuntu简单安装Mongodb-创新互联
URL地址:http://azwzsj.com/article/dsehcd.html