介绍安装的文档很多,可以参考这篇:

http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/

安装完后你可能会碰到的2个问题。

1.让mongod在后台运行
启动mongo的命令mongod有一个参数--fork可以使mongo在后台运行,但同时必须设置--logpath参数指定启动日志文件的路径,因为此时日志无法写到控制台了。例子:

mongod --fork --logpath /var/log/mongod.log
The MongoDB daemon (mongod) has a command-line option to run the server in the background...

--fork

This command-line option requires that you also specify a file to log messages to (since it can not use the current console). An example of this command looks like:

mongod --fork --logpath /var/log/mongod.log

You could put this into an /etc/init.d/mongod bash script file. And then to have the service run at startup, create the standard symbolic links (S## & K##) inside of /etc/rc#.d/. Here is a tutorial that explains this process in more detail. Scroll down to the section titled "Init Script Activation". This also has the added benefit of being able to execute commands like...

service mongod status
service mongod start
service mongos stop

2.执行mongod —fork —logpath /var/log/mongod.log 出错

about to fork child process, waiting until server is ready for connections. forked process: 10293 child process started successfully, parent exiting

这是因为当前用户对日志目录/var/log的权限不足

MongoDB Linux 安装配置 后台运行的更多相关文章

  1. Linux安装配置go运行环境

    1. 下载go,解压 gz包 wget https://storage.googleapis.com/golang/go1.7.5.linux-amd64.tar.gz tar zxvf go1.7. ...

  2. linux经常使用(一)linux 安装配置 jdk之 找不到安装文件文件夹及source /etc/profile 报unexpected end of file 错误 解决

    linux 安装配置 jdk 应该算是一个非常主要的东西.可是我到如今才自己第一次 正式安装.果然出现了问题.. 问题就是 安装之后 找不到 安装路径 ,进而没法配置环境变量. 现象例如以下: 提示 ...

  3. Linux安装配置apache

    Linux安装配置apache   1.获取软件: http://httpd.apache.org/  httpd-2.2.21.tar.gz 2.安装步骤: 解压源文件: 1 tar zvxf ht ...

  4. Linux安装配置php环境的方法

    本文实例讲述了Linux安装配置php环境的方法.分享给大家供大家参考,具体如下: 1.获取安装文件: http://www.php.net/downloads.php php-5.3.8.tar.g ...

  5. MongoDB的安装配置、基本操作及Perl操作MongoDB

    MongoDB的安装配置.基本操作及Perl操作MongoDB http://www.myhack58.com/Article/60/63/2014/42353.htm

  6. Linux安装配置varnish web加速器

    Linux安装配置varnish web加速器       Varnish是一款高性能的开源HTTP加速器,它可以来做纯粹的代理服务器,负载均衡,但varnish最主要的功能是缓存加速,也是它最出色的 ...

  7. Linux环境下NodeJS和MongoDB的安装配置

     一.NodeJS的安装配置 #进入安装目录cd /usr/local/ #删除原有安装rm -rf noderm -rf node-v0.10.29-linux-x64 #解压压缩包tar -zxv ...

  8. MongoDB Linux安装

    MongoDB 提供了 linux 各发行版本 64 位的安装包,你可以在官网下载安装包. 下载地址:https://www.mongodb.com/download-center#community ...

  9. Linux安装配置VPN服务器

    一.实验简介 VPN ,中文翻译为虚拟专有网络,英文全称是 Virtual Private Network .现在 VPN 被普遍定义为通过 一个公用互联网络建立一个临时的.安全的连接,是一条穿过混乱 ...

随机推荐

  1. 愚人的linux内核2440移植札记(超曲折版)

    http://blog.csdn.net/dreambegin/article/details/6904822 原来文章叫--编译内核之初体验.后来想了想,这篇文章让我体验了好多遍.不该叫这么大气的名 ...

  2. qtp ie_hook

    今天要讲的内容是注册异类子控件授予强制HOOK,名字有点抽象,简单的说就是在一个QTP可识别的A类插件窗口对象中存在着B类插件的控件对象, 最常见的例子就是在应用程序中内嵌一个Browser对象子控件 ...

  3. Maven jenkins +Jmeter自动化测试

    Maven jenkins +Jmeter自动化测试 1. Jenkins中集成jmeter-maven插件 http://my.oschina.net/u/1377774/blog/168969 2 ...

  4. svn merge和branch 详解

    1.本地Repository的创建 repository的创建很简单,假设我要在D:\TortoiseSVN\TestRepository目录中创建repository,只需右键TestReposit ...

  5. 发起http(s)请求

    发起http(s)请求我这里主要列举了3种方式: 一.命令行的方式 二.通过工具 三.通过代码 一.命令行的方式 1. curl  curl官网: https://curl.haxx.se/downl ...

  6. sublime text 侧边栏样式修改

    安装PackageResourceViewer 插件.快捷键 CTRL+SHIFT+P 打开 命令面板,输入 Package Control:Install Package (直接输入PCIP,四个单 ...

  7. 部署到IIS上上传不了文件

    应用程序池改一下

  8. MVC过滤大法(过滤静态文件)

    参考文章:https://prerakkaushik.wordpress.com/2014/02/12/routing-request-for-static-files-with-or-without ...

  9. java线程基础知识----java线程模型

    转载自http://www.cnblogs.com/nexiyi/p/java_memory_model_and_thread.html 1. 概述 多任务和高并发是衡量一台计算机处理器的能力重要指标 ...

  10. Spring-boot 项目中使用 jackson 遇到的一个问题

    jackson介绍 java代码中实现序列化和反序列化的工具类 jackson使用Demo https://github.com/Naylor55/JavaDebrisCode/tree/branch ...