脚本宝典收集整理的这篇文章主要介绍了ahjesus安装mongodb企业版for ubuntu的步骤,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
导入共匙
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 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/in
IT.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 m
ain 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
脚本宝典总结
以上是脚本宝典为你收集整理的ahjesus安装mongodb企业版for ubuntu的步骤全部内容,希望文章能够帮你解决ahjesus安装mongodb企业版for ubuntu的步骤所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。