mongodb 在 Ubuntu系统上的安装及卸载
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mongodb 在 Ubuntu系统上的安装及卸载,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3817字,纯文字阅读大概需要6分钟。
内容图文
The Ubuntu package management tools (i.e. dpkg
and apt
) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the MongoDB public GPG Key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C62 Create a list file for MongoDB.
Create the /etc/apt/sources.list.d/mongodb-org-3.4.list
list file using the command appropriate for your version of Ubuntu:
- Ubuntu 16.04
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list3 Reload local package database. Issue the following command to reload the local package database:
sudo apt-get update4 Install the MongoDB packages.
Install the latest stable version of MongoDB.
Issue the following command:
sudo apt-get install -y mongodb-org
Run MongoDB Community Edition
Most Unix-like operating systems limit the system resources that a session may use. These limits may negatively impact MongoDB operation. See UNIX ulimit Settings for more information.
The MongoDB instance stores its data files in /var/lib/mongodb
and its log files in /var/log/mongodb
by default, and runs using the mongodb
user account. You can specify alternate log and data file directories in /etc/mongod.conf
. See systemLog.path
and storage.dbPath
for additional information.
If you change the user that runs the MongoDB process, you must modify the access control rights to the /var/lib/mongodb
and /var/log/mongodb
directories to give this user access to these directories.
Issue the following command to start mongod
:
sudo service mongod start2 Verify that MongoDB has started successfully
Verify that the mongod
process has started successfully by checking the contents of the log file at/var/log/mongodb/mongod.log
for a line reading
[initandlisten] waiting for connections on port <port>
Verify that MongoDB has started successfully
Verify that the mongod
process has started successfully by checking the contents of the log file at/var/log/mongodb/mongod.log
for a line reading
[initandlisten] waiting for connections on port <port>
where <port>
is the port configured in /etc/mongod.conf
, 27017
by default.
As needed, you can stop the mongod
process by issuing the following command:
sudo service mongod stop4 Restart MongoDB.
Issue the following command to restart mongod
:
sudo service mongod restart5 Begin using MongoDB.
To help you start using MongoDB, MongoDB provides Getting Started Guides in various driver editions. See Getting Started for the available editions.
Before deploying MongoDB in a production environment, consider the Production Notes document.
Later, to stop MongoDB, press Control+C
in the terminal where the mongod
instance is running.
Uninstall MongoDB Community Edition
To completely remove MongoDB from a system, you must remove the MongoDB applications themselves, the configuration files, and any directories containing data and logs. The following section guides you through the necessary steps.
1 Stop MongoDB. Stop the mongod
process by issuing the following command:
sudo service mongod stop2 Remove Packages.
Remove any MongoDB packages that you had previously installed.
sudo apt-get purge mongodb-org*3 Remove Data Directories.
Remove MongoDB databases and log files.
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
啦啦啦
mongodb 在 Ubuntu系统上的安装及卸载
标签:iat contain arm ensure deb more 官网 tee document
本文系统来源:http://www.cnblogs.com/ClassNotFoundException/p/6921525.html
内容总结
以上是互联网集市为您收集整理的mongodb 在 Ubuntu系统上的安装及卸载全部内容,希望文章能够帮你解决mongodb 在 Ubuntu系统上的安装及卸载所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。