新建 /usr/local/mongodb/data文件夹,新建文件--logpath=/usr/local/mongodb/logs
./mongod --port 27017 --fork --dbpath=/usr/local/mongodb/data --logpath=/usr/local/mongodb/logs --logappend
about to fork child process, waiting until server is ready for connections.
forked process: 2440
child process started successfully, parent exiting
查看是否启动netstat -lanp | grep "27017"
删除rm /tmp/mongodb-27017.sock
就可以了