Hello,
I have installed MongoDB server on centos 7 via bin, but not able to find mongod.conf file.
While I am starting mongod, it will take default db path i.e. /data/db/.
Even I am adding mongod.conf file in /etc/mongod.conf, it won’t start with this conf file, I have tried with --config options too but bad luck.
While I am executing the command to find the argument, it is throwing an error:
db.adminCommand( { getCmdLineOpts: 1 } )
{ “argv” : [ “mongod” ], “parsed” : { }, “ok” : 1 }
Please find log below:
[root@krishna ~]# ps -eaf|grep -i mongod
root 17615 17565 0 01:44 pts/0 00:00:00 grep --color=auto -i mongod
[root@krishna ~]#
[root@krishna ~]# sudo service mongod status
Redirecting to /bin/systemctl status mongod.service
● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-08-28 01:30:12 IST; 14min ago
Docs: https://docs.mongodb.org/manual
Process: 1212 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=2)
Process: 1207 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 1194 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 1179 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
Aug 28 01:29:48 krishna systemd[1]: Starting MongoDB Database Server…
Aug 28 01:30:12 krishna mongod[1212]: Unrecognized option: authorization
Aug 28 01:30:12 krishna mongod[1212]: try ‘/usr/bin/mongod --help’ for more information
Aug 28 01:30:12 krishna systemd[1]: mongod.service: control process exited, code=exited status=2
Aug 28 01:30:12 krishna systemd[1]: Failed to start MongoDB Database Server.
Aug 28 01:30:12 krishna systemd[1]: Unit mongod.service entered failed state.
Aug 28 01:30:12 krishna systemd[1]: mongod.service failed.
[root@krishna ~]# sudo service mongod start
Redirecting to /bin/systemctl start mongod.service
Job for mongod.service failed because the control process exited with error code. See “systemctl status mongod.service” and “journalctl - xe” for details.
Whereas just typing mongod it will successfully launch:
[root@krishna ~]# mongod
2019-08-28T01:45:24.248+0530 I STORAGE [main] Max cache overflow file size custom option: 0
2019-08-28T01:45:24.392+0530 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols ‘n one’
2019-08-28T01:45:24.568+0530 I CONTROL [initandlisten] MongoDB starting : pid=17672 port=27017 dbpath=/data/db 64-bit host=krishna
2019-08-28T01:45:24.568+0530 I CONTROL [initandlisten] db version v4.0.12
2019-08-28T01:45:24.568+0530 I CONTROL [initandlisten] git version: 5776e3cbf9e7afe86e6b29e22520ffb6766e95d4
2019-08-28T01:45:24.568+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2019-08-28T01:45:24.568+0530 I CONTROL [initandlisten] allocator: tcmalloc
2019-08-28T01:45:24.568+0530 I CONTROL [initandlisten] modules: none
2019-08-28T01:45:24.568+0530 I CONTROL [initandlisten] build environment:
2019-08-28T01:45:24.569+0530 I CONTROL [initandlisten] distmod: rhel70
2019-08-28T01:45:24.569+0530 I CONTROL [initandlisten] distarch: x86_64
2019-08-28T01:45:24.569+0530 I CONTROL [initandlisten] target_arch: x86_64
2019-08-28T01:45:24.569+0530 I CONTROL [initandlisten] options: {}
2019-08-28T01:45:24.688+0530 I STORAGE [initandlisten] Detected data files in /data/db created by the ‘wiredTiger’ storage engine, so se tting the active storage engine to ‘wiredTiger’.
2019-08-28T01:45:24.689+0530 I STORAGE [initandlisten]
2019-08-28T01:45:24.689+0530 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-08-28T01:45:24.689+0530 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-08-28T01:45:24.753+0530 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1062M,cache_overflow=(file_max=0M),sess ion_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,comp ressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2019-08-28T01:45:34.232+0530 I STORAGE [initandlisten] WiredTiger message [1566936934:232359][17672:0x7fbc5a6e6b80], txn-recover: Main r ecovery loop: starting at 16/27648 to 17/256
2019-08-28T01:45:34.953+0530 I STORAGE [initandlisten] WiredTiger message [1566936934:953372][17672:0x7fbc5a6e6b80], txn-recover: Recove ring log 16 through 17
2019-08-28T01:45:35.551+0530 I STORAGE [initandlisten] WiredTiger message [1566936935:551942][17672:0x7fbc5a6e6b80], txn-recover: Recove ring log 17 through 17
2019-08-28T01:45:35.916+0530 I STORAGE [initandlisten] WiredTiger message [1566936935:916061][17672:0x7fbc5a6e6b80], txn-recover: Set gl obal recovery timestamp: 0
2019-08-28T01:45:36.073+0530 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2019-08-28T01:45:36.599+0530 I CONTROL [initandlisten]
2019-08-28T01:45:36.599+0530 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-08-28T01:45:36.599+0530 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2019-08-28T01:45:36.600+0530 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommend ed.
2019-08-28T01:45:36.600+0530 I CONTROL [initandlisten]
2019-08-28T01:45:36.600+0530 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2019-08-28T01:45:36.600+0530 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2019-08-28T01:45:36.600+0530 I CONTROL [initandlisten] ** Start the server with --bind_ip to specify which IP
2019-08-28T01:45:36.600+0530 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2019-08-28T01:45:36.601+0530 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2019-08-28T01:45:36.601+0530 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2019-08-28T01:45:36.601+0530 I CONTROL [initandlisten]
2019-08-28T01:45:36.610+0530 I CONTROL [initandlisten]
2019-08-28T01:45:36.610+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
2019-08-28T01:45:36.610+0530 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2019-08-28T01:45:36.611+0530 I CONTROL [initandlisten]
2019-08-28T01:45:36.611+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
2019-08-28T01:45:36.611+0530 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2019-08-28T01:45:36.611+0530 I CONTROL [initandlisten]
2019-08-28T01:45:37.565+0530 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘/data/db/diagnosti c.data’
2019-08-28T01:45:37.590+0530 I NETWORK [initandlisten] waiting for connections on port 27017
2019-08-28T01:45:56.431+0530 I NETWORK [listener] connection accepted from 127.0.0.1:53462 #1 (1 connection now open)
2019-08-28T01:45:56.440+0530 I NETWORK [conn1] received client metadata from 127.0.0.1:53462 conn1: { application: { name: “MongoDB Shell” }, driver: { name: “MongoDB Internal Client”, version: “4.0.12” }, os: { type: “Linux”, name: "CentOS Linux release 7.6.1810 (Core) ", architecture: “x86_64”, version: “Kernel 3.10.0-957.27.2.el7.x86_64” } }
Please help me to understand.
Thanks
Krishna