阿里云ECS lnmp linux7 安装mongodb连接不上 child process failed, exited with error number

linux安装mongodb安装网上有很多教程,我就不赘述了:

##安装mongodb连接:https://www.cnblogs.com/Lovebugs/p/8606000.html

我主要总结一下安装中容易出现的问题:

  1. child process failed, exited with error number 48
    阿里云ECS lnmp linux7 安装mongodb连接不上 child process failed, exited with error number
    报48错误:因为fork不支持–config 所以请使用手动配置:

    mongod --dbpath=/data/mongodb/db --logpath=/data/mongodb/log/mongodb.log --bind_ip=0.0.0.0 --fork

注意配置bind_ip,0.0.0.0表示对所有ip开放,否则远程无法连接;

重点如果是阿里云,请一定要开放27017端口

去你的ecs云服务器里面找一下安全组配置,添加新的安全组规则:
阿里云ECS lnmp linux7 安装mongodb连接不上 child process failed, exited with error number

阿里云ECS lnmp linux7 安装mongodb连接不上 child process failed, exited with error number
阿里云ECS lnmp linux7 安装mongodb连接不上 child process failed, exited with error number
阿里云ECS lnmp linux7 安装mongodb连接不上 child process failed, exited with error number
阿里云ECS lnmp linux7 安装mongodb连接不上 child process failed, exited with error number
这样就可以远程连接我们的mongodb了