[centos@ip-172-26-2-104 ~]$ pwd
/home/centos
[centos@ip-172-26-2-104 ~]$ ls -l
drwxrwxrwx. 3 centos centos 26 Jul 1 09:05 mongodb
[centos@ip-172-26-2-104 ~]$ ls -l mongodb/log
-rwxrwxrwx. 1 centos centos 0 Jul 1 09:01 a
so i have both the data and log directories with 777 permission
[centos@ip-172-26-2-104 ~]$ ps -ef | grep mongod
centos 15164 14007 0 09:32 pts/5 00:00:00 grep --color=auto mongod
[centos@ip-172-26-2-104 ~]$ mongod --dbpath mongodb --port 27017 --logpath mongodb/log --fork --logappend --bind_ip_all
about to fork child process, waiting until server is ready for connections.
forked process: 15194
ERROR: child process failed, exited with 1
To see additional information in this output, start without the “–fork” option.
[centos@ip-172-26-2-104 ~]$ mongod --dbpath mongodb --port 27017 --logpath mongodb/log --logappend --bind_ip_all
{“t”:{"$date":“2022-07-01T09:33:45.030Z”},“s”:“F”, “c”:“CONTROL”, “id”:20574, “ctx”:"-",“msg”:“Error during global initialization”,“attr”:{“error”:{“code”:38,“codeName”:“FileNotOpen”,“errmsg”:“logpath “/home/centos/mongodb/log” should name a file, not a directory.”}}}
[centos@ip-172-26-2-104 ~]$