这是我的配置文件
port=27017 #端口号
fork=true #以守护进程的方式运行,创建服务器进程
# master=true #单主从配置时设为主服务器
#salve=true ##单主从配置时设为从服务器
logpath=~/database/data/log.log #日志输出文件路径
logappend=true #日志输出方式
dbpath=~/database/data/db/ #数据库路径
# replSet=testrs #设置富本集的名字
# shardsvr=true #设置是否分片
# auth=true#是否开启授权
mongod -f ~/database/data/mongodb.conf
试图启动,然后报错:
about to fork child process, waiting until server is ready for connections.
forked process: 27916
ERROR: child process failed, exited with error number 1
给我你的怀抱2017-05-02 09:26:56
This situation is probably because there is a problem with the path and permissions of the log file
There has been a similar discussion on stackoverflow: http://stackoverflow.com/ques...
The poster himself found a solution by changing the path of the log file to /home/<user>
an absolute path.
Use ~
to represent home. It is an alias provided by the shell and can only be used in the shell.