操作系统 
首页 > 操作系统 > 浏览文章

ahjesus安装mongodb企业版for ubuntu的步骤

(编辑:jimmy 日期: 2024/5/9 浏览:3 次 )

导入共匙

复制代码代码如下:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

创建源列表

复制代码代码如下:
echo 'deb https://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/stable multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list

刷新包

复制代码代码如下:
sudo apt-get update

安装企业版

复制代码代码如下:
sudo apt-get install mongodb-enterprise

防止意外升级到最新版,可以运行如下命令

复制代码代码如下:
echo "mongodb-enterprise hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-server hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-shell hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-mongos hold" | sudo dpkg --set-selections
echo "mongodb-enterprise-tools hold" | sudo dpkg --set-selections

启动运行

复制代码代码如下:
sudo /etc/init.d/mongod start

验证启动成功

验证是否启动成功可以到日志文件查看,具体位置在 /var/log/mongodb/mongod.log.

停止

复制代码代码如下:
sudo /etc/init.d/mongod stop

重启

复制代码代码如下:
sudo /etc/init.d/mongod restart

附:update失败 提示有一个旧项的解决办法

更新源至国内
我用的是阿里云的源
具体的操作是 vi /etc/apt/sources.list  在文件最前面添加以下条目(!!!操作前请做好相应备份!!!)


复制代码代码如下:
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

上一篇:ubuntu安装postgresql和使用方法
下一篇:win7使用vmware安装ubuntu详细步骤
一句话新闻
高通与谷歌联手!首款骁龙PC优化Chrome浏览器发布
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网