老师,还是不行,帮看下怎么弄
[imooc-user1@localhost ~]$ mongod --dbpath data/ --logpath log/mongo.log --port 27017 --bind_ip 0.0.0.0 --fork
about to fork child process, waiting until server is ready for connections.
forked process: 4302
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the "--fork" option.
[imooc-user1@localhost ~]$ ^C
[imooc-user1@localhost ~]$ mongod --dbpath data/ --logpath log/mongo.log --port 27017 --bind_ip 0.0.0.0
2020-09-24T16:57:01.889+0800 F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open "/home/imooc-user1/log/mongo.log"
[imooc-user1@localhost ~]$ mongo
MongoDB shell version v4.0.20
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
2020-09-24T16:57:13.733+0800 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:344:17
@(connect):2:6
exception: connect failed
2020-09-24 16:59:19
换成这个绝对路径也是不行,要怎么操作呢?
[imooc-user1@localhost ~]$ mongod --dbpath E:/Mongodb/Server/4.4/data/ --logpath E:/Mongodb/Server/4.4/log/mongo.log --port 27017 --bind_ip 0.0.0.0 --fork
about to fork child process, waiting until server is ready for connections.
forked process: 4470
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the "--fork" option.
[imooc-user1@localhost ~]$ mongod --dbpath E:/Mongodb/Server/4.4/data/ --logpath E:/Mongodb/Server/4.4/log/mongo.log --port 27017 --bind_ip 0.0.0.0
2020-09-24T17:05:19.917+0800 F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open "/home/imooc-user1/E:/Mongodb/Server/4.4/log/mongo.log"
[imooc-user1@localhost ~]$
2020-09-24 17:06:48
同学你好,同学可以删除mongodb 的db目录下的mongod.lock文件,重启mongodb即可
2020-09-24 18:18:50
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星