I have mongodb which i used to run with the following command without any issue
sudo mongodb/mongodb-linux-x86_64-2.2.7/bin/mongod --config /etc/mongod.conf
This morning i upgraded from fedora 31 to 32 then 33 then 34, when i run the same command i get ;
error command line: unrecognized line in ‘systemLog:’
use --help for help
here is the content of the config file
systemLog:
destination: file
path: “/var/log/mongodb/mongod.log”
logAppend: true
storage:
dbPath: /home/data/db
journal:
enabled: true
processManagement:
fork: true
net:
bindIp: 192.168.10.11
port: 28015
security:
authorization: enabled
steevej
(Steeve Juneau)
December 6, 2021, 10:56pm
2
YAML is very sensitive to formatting. The way you published your configuration file gives us no clue about the formatting. See Formatting code and log snippets in posts and re-post.
You are not supposed to run mongod as root.
The message error command line: unrecognized line in ‘systemLog:’ does not look like an error message from mongod. Because it usually indicate the line number when yaml is wrong. May be you are using an old mongod and the error messages have been rewritten.
systemLog:
destination: file
path: "/var/log/mongodb/mongod.log"
logAppend: true
storage:
dbPath: /home/data/db
journal:
enabled: true
processManagement:
fork: true
net:
bindIp: 192.168.1.11
port: 28015
security:
authorization: enabled
Yes, I used to run the command
mongod --config /etc/mongod.conf
without sudo, but after the upgrade it does not go through
also, I upgraded to feddora 34
steevej
(Steeve Juneau)
December 7, 2021, 3:53pm
8
I tried the configuration file you posted and it worked. So, as I suspected the error message ***
comes from somewhere else.
The first thing to figure out is why
Post a screenshot of starting mongod without sudo. But running with sudo might have cause other issues.
Here is the snapshot. Very strange as mongodb that I started with sudo was terminated
And here is te output when I use he config file wiht or without sudo
steevej
(Steeve Juneau)
December 7, 2021, 5:39pm
11
You must be using a very old mongod as the configuration file works fine. I already hinted that this might be the case:
I use version:
db version v5.0.3
I read your other thread that says:
then why are you starting db version v2.2.7 .
Since you started mongod with sudo, /home/data/db/mongod.lock is own by root. You will need to manually remove it with sudo.
steevej
(Steeve Juneau)
December 7, 2021, 5:43pm
12
I have found another Getting strange message after feedora upgrade - #3 by Stennie in which you have been told that you are running an old version.
Please fix this.
Agree, but I am not able to download and install a new version as indicated in my thread
Also, I removed the lock file but still getting the same errors with or without sudo