mongodb 在 Ubuntu系统上的安装及卸载
The mongodb-org-server
package provides an initialization script that starts mongod
with the /etc/mongod.conf
configuration file.
See Run MongoDB Community Edition for details on using this initialization script.
These packages conflict with the mongodb
, mongodb-server
, and mongodb-clients
packages provided by Ubuntu.
The default /etc/mongod.conf
configuration file supplied by the packages have bind_ip
set to 127.0.0.1
by default. Modify this setting as needed for your environment before initializing a replica set.
Install MongoDB Community Edition
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 0C49F3730359A14518585931BC711F9BA15703C6
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.list
sudo apt-get update
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 start
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 stop
Issue the following command to restart mongod
:
sudo service mongod restart
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.
Stop the mongod
process by issuing the following command:
sudo service mongod stop
Remove any MongoDB packages that you had previously installed.
sudo apt-get purge mongodb-org*
Remove MongoDB databases and log files.
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
啦啦啦
mongodb 在 Ubuntu系统上的安装及卸载的更多相关文章
- 解决django项目在ubuntu系统上无法安装mysqlclient
首先我的项目是django2.0,python环境是3.5. 我们在本地开发完django项目了,在本地运行是成功的,然后我们把django项目放到服务器上,运行的时候就出错了. 如图: 我们都知道, ...
- 在64位Ubuntu系统上安装32位程序包
在64位Ubuntu系统上安装32位的程序包 $sudo apt-get install package_name:i386 例如: $sudo apt-get install openjdk-7-j ...
- Nginx: ubuntu系统上如何判断是否安装了Nginx?
问题描述:ubuntu系统上,如何查看是否安装了Nginx? 解决方法:输入命令行:ps -ef | grep nginx master process后面就是Nginx的安装目录. 延伸:1. 如何 ...
- 在Ubuntu系统上搭建Hadoop 2.x(2.6.2)
官方的中文版的Hadoop快速入门教程已经是很老的版本了,新版的Hadoop目录结构发生了变化,因此一些配置文件的位置也略微调整了,例如新版的hadoop中找不到快速入门中提到的conf目录,另外,网 ...
- Ubuntu系统Apache Maven安装
操作系统:Linux x64 / Ubuntu 14.04 Apache Maven版本:3.3.9 建议预先搭建Java开发环境:详见上一篇<Linux Ubuntu系统下Java开发环境搭建 ...
- Ubuntu系统的Redis安装配置
Ubuntu系统的Redis安装配置 一. 安装Redis: 在Ubuntu系统下安装Redis数据库有两种方式: 方式一:下载最新的Redis版本(tar.gz格式),解压安装.操作如下: ...
- 如何在一个ubuntu系统上搭建SVN版本控制工具
有话说,由于公司项目部署需要,将Windows工程迁移到Linux,通过调查确定使用Ubuntu的Linux操作系统.那么如何快速搭建和Windows一样快捷方便的开发环境就很重要了.本文讲述如何在一 ...
- 64位的Ubuntu系统上使用汇编nasm和C语言
64位的Ubuntu系统上使用汇编nasm和C语言 $ nasm -f elf foo.asm -o foo.o$ gcc -c bar.c -o bar.o$ ld -s foo.o bar.o ...
- Oracle 支持在具有 DHCP 分配的 IP 地址的系统上进行安装
今天在安装Oracle 10g的时候,遇到了“ Oracle 支持在具有 DHCP 分配的 IP 地址的系统上进行安装” 这个问题,经过搜索,找到了解决方案,具体如下: win7下右键单机" ...
随机推荐
- Linux高频命令精讲(三)
[教程主题]:2.Linux高频命令精讲 [2.1]Linux的运行方式 图形运行方式 - 本地使用KDE/Gnome集成环境 - 运行X Server远程使用图形环境 命令行(字符运行)方式 - 本 ...
- 浏览器自己主动填表安全漏洞:查看浏览器保存的password
我通常会使用浏览器保存自己的帐号和password,下次登录就无需又一次输入,很方便.而像傲游这种浏览器还提供了自己主动同步功能,让我一个傲游帐号.就带着互联网上全部帐号password去旅行. 昨天 ...
- vs自己主动生成的WebService配置文件在部署到IIs6后,服务调用失败的解决方法
近日.在项目中须要引用java公布的WebService,加入服务引用后,调用一切正常. 配置例如以下: <system.serviceModel> <bindings> &l ...
- Git 提交更改
Jerry 已经提交的更改,他想纠正他的最后一次提交,在这种情况下,git 的修改将帮助操作.最后提交修改操作的变化,包括提交信息,它创建新的提交ID. 修改操作之前,他会检查提交日志. [jerry ...
- ie6 无法显示网页 已终止操作
已终止操作原因: 在文件加载完成之前执行了dom操作,如appendChild, innerHTML等 解决办法: ready后再执行
- springmvc访问静态资源出现Request method 'GET' not supported
答案最后.:D 默认的访问的URL都会被DispatcherServlet所拦截. 这里说一下如何配置springmvc访问静态文件. <mvc:default-servlet-handler/ ...
- asp.net请求管道和页面生命周期
- jquery 利用CSS 控制打印样式
一.添加打印样式 1. 为屏幕显示和打印分别准备一个css文件,如下所示: 用于屏幕显示的css: <link rel="stylesheet" href="cs ...
- Qt安装过程中: configure 时发生的经典出错信息之”Basic XLib functionality test failed!”(Z..z..) 之 MySQL support cannot be enabled due to functionality test!
整出错信息是在./configure阶段Basic XLib functionality test failed!You might need to modify the include and li ...
- Android 软键盘弹出与关闭监听
private void listenerSoftInput() { final View activityRootView = findViewById(R.id.activityRoot); ac ...