MongoDB错误1_启动mongodb时遇到child process failed,existed with error number 1错误

来源:互联网 发布:企业损益表数据 编辑:程序博客网 时间:2024/05/21 04:20

在进行安装配置mongodb实验时,按照以下的步骤进行:

 

启动mongodb

cd /usr/local/mongodb/mongodb/bin

进入每个mongodb节点的bin目录下

./mongod -f ../conf/mongodb-master.conf  

./mongod -f ../conf/mongodb-slaver.conf  

./mongod -f ../conf/mongodb-arbiter.conf  

注意配置文件的路径一定要保证正确,可以是相对路径也可以是绝对路径

./ 表示当前路径

../ 表示上一个路径

 

此时,报错:

note: noprealloc may hurt performance in many applications

about to fork child process, waiting until server is ready for connections.

forked process: 5644

ERROR: child process failed, exited with error number 1

 

寻找解决方法:

关闭防火墙,检查四台机器是否能ping通,排除这些原因;

 

网上解决方法:

方法一:

可以看看/usr/lib64/libssl.so.10 在不在,没有的话可以下一个;

libssl.so.10在,排除。

方法二:

这个一般是权限问题,sudo启动就好了;

成功解决。

 

重新启动mongodb

cd /usr/local/mongodb/mongodb/bin

进入每个mongodb节点的bin目录下

sudo ./mongod -f ../conf/mongodb-master.conf  

sudo ./mongod -f ../conf/mongodb-slaver.conf  

sudo ./mongod -f ../conf/mongodb-arbiter.conf  

注意配置文件的路径一定要保证正确,可以是相对路径也可以是绝对路径

 

可以正常进行

 

其他注意事项:

 

配置mongodb-master.conf

cd /usr/local/mongodb/mongodb/conf

vim mongodb-master.conf

 

#mongodb-master.conf  

dbpath=/usr/local/mongodb/mongodb/data/master  

logpath=/usr/local/mongodb/mongodb/logs/master.log  

pidfilepath=/usr/local/mongodb/mongodb/data/master.pid  

directoryperdb=true  

logappend=true  

replSet=testrs  

bind_ip=192.168.154.156  

port=27017

oplogSize=1000

fork=true  

noprealloc=true

 

配置mongodb-slaver.conf

cd /usr/local/mongodb/mongodb/conf

vim mongodb-slaver.conf

 

#mongodb-slaver.conf 

dbpath=/usr/local/mongodb/mongodb/data/slaver  

logpath=/usr/local/mongodb/mongodb/logs/slaver.log  

pidfilepath=/usr/local/mongodb/mongodb/data/slaver.pid  

directoryperdb=true  

logappend=true  

replSet=testrs   

bind_ip=192.168.154.158

port=27017

oplogSize=1000  

fork=true  

noprealloc=true  

smallfiles=true  

 

配置mongodb-arbiter.conf

cd /usr/local/mongodb/mongodb/conf

vim mongodb-arbiter.conf

 

#mongodb-arbiter.conf 

dbpath=/usr/local/mongodb/mongodb/data/arbiter  

logpath=/usr/local/mongodb/mongodb/logs/arbiter.log  

pidfilepath=/usr/local/mongodb/mongodb/data/arbiter.pid  

directoryperdb=true  

logappend=true  

replSet=testrs  

bind_ip=192.168.154.160

port=27017

oplogSize=1000 

fork=true  

noprealloc=true  

smallfiles=true  

 

配置时,分别参考了:

http://blog.csdn.net/wang_zhenwei/article/details/48239893

http://blog.csdn.net/xuguokun1986/article/details/47172685

 

文件夹logs.conf里的logs应该统一,要不都是log,要不都是logs

因为里面少了个s,所以也找了很久。

 

0 0
原创粉丝点击