安装 mongoDB(子进程失败,以错误号 100 退出) [英] install mongoDB (child process failed, exited with error number 100)

查看:24
本文介绍了安装 mongoDB(子进程失败,以错误号 100 退出)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我的 macbook air 上安装 mongoDB.

I tried to install mongoDB on my macbook air.

我已经从官方网站下载了压缩文件并解压缩该文件并移动到根目录.之后,在该目录下,我创建了/data/db 和/log 文件夹.

I've downloaded zipped file from official website and extract that file and move to root directory. After that, under that directory, I've made /data/db and /log folder.

这是我的 mongodb.config,它描述了我的数据库的基本配置.

Here is my mongodb.config which describes the basic config for my DB.

dbpath = /mongodb/data/db
logpath = /mongodb/log/mongo.log
logappend = true
#bind ip = 127.0.0.1
port = 27017

fork = true
rest = true
verbose = true
#auth = true
#noauth = true

另外,我想知道配置文件中的#是什么意思.

Additionally, I want to know what the # means in the config file.

我把这个文件放到了/mongodb/bin/mongodb是我解压的目录.

I put this file to /mongodb/bin, /mongodb is the directory I extracted the files into.

我打开终端并输入 ./mongod --config mongodb.config 然后我得到了这个.

I opened terminal and entered ./mongod --config mongodb.config and I got this back.

Juneyoung-ui-MacBook-Air:bin juneyoungoh$ ./mongod --config mongodb.config
about to fork child process, waiting until server is ready for connections.
forked process: 1775
all output going to: /mongodb/log/mongo.log
ERROR: child process failed, exited with error number 100

我该如何处理这个错误?这意味着什么?

How can I handle this error and what this means?

推荐答案

您创建的数据文件夹很可能是用 sudo 创建的,是吗?它们归 root 所有,普通用户不可写.如果您是 macbook 的唯一用户,请将目录的所有权更改为您:

The data folders you created were very likely created with sudo, yes? They are owned by root and are not writable by your normal user. If you are the only user of your macbook, then change the ownership of the directories to you:

sudo chown juneyoungoh /data
sudo chown juneyoungoh /data/db
sudo chown juneyoungoh /data/log

如果您打算在公共机器或合法的地方安装它,请在其他地方阅读更多关于 mongo 安全实践的信息.我会让你在你的 macbook 上运行.

If you plan on installing this on a public machine or somewhere legit, then read more about mongo security practices elsewhere. I'll just get you running on your macbook.

这篇关于安装 mongoDB(子进程失败,以错误号 100 退出)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆