Hello, I really struggle since days, running systemctl start mongod.service
- as it always hangs up. I can cancle the command with ctrl+c
. The funny thing is, that the mongodb server is reachable and I can filter, add and delete items. The problem is, that when I run sudo systemctl status --full --lines=50 mongod
I get following output:
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mongod.service.d
└─mongod.conf
Active: activating (start) since Sat 2023-08-12 01:39:29 CEST; 13s ago
Docs: https://docs.mongodb.org/manual
Main PID: 3002149 (mongod)
Memory: 166.3M
CGroup: /system.slice/mongod.service
└─3002149 /usr/bin/mongod --config /etc/mongod.conf
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: Trying to enqueue job mongod.service/start/replace
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: Installed new job mongod.service/start as 27570
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: Enqueued job mongod.service/start as 27570
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: Failed to set 'blkio.weight' attribute on '/system.slice/mongod.service' to '500': No such file or directory
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: Passing 0 fds to service
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: About to execute: /usr/bin/mongod --config /etc/mongod.conf
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: Forked /usr/bin/mongod as 3002149
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: Changed dead -> start
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: Starting MongoDB Database Server...
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[1]: mongod.service: User lookup succeeded: uid=111 gid=113
> Aug 12 01:39:29 xxxxx.xxxxxx.net systemd[3002149]: mongod.service: Executing: /usr/bin/mongod --config /etc/mongod.conf
> Aug 12 01:39:29 xxxxx.xxxxxx.net mongod[3002149]: {"t":{"$date":"2023-08-11T23:39:29.560Z"},"s":"I", "c":"CONTROL", "id":7484500, "ctx":"-","msg":"Environment variable MONGODB_CONFIG_OVERRIDE_NOFORK == 1, overriding \"processManagement.fork\" to false"}
As you can see here, “Active” is remaining on “activating” and is not changing at all. That is why the command hangs, and that is, why other services, which should run with After=network.target mongod.service
does not run at all, as mongod is never finishing the start up…
Here is my config - pretty much default, I only changed the dbPath to create a new one.
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb2
# journal:
# enabled: true
# engine:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# logRotate: rename
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1,mongo0.xxxxxxx.com
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
#security:
# keyFile: /var/lib/mongo-security/keyfile.txt
#operationProfiling:
#replication:
# replSetName: rs0
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
This is the log:
> {"t":{"$date":"2023-08-12T01:37:45.470+02:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"in
> comingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true}}}
> {"t":{"$date":"2023-08-12T01:37:45.471+02:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
> {"t":{"$date":"2023-08-12T01:37:45.474+02:00"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpF
> astOpenQueueSize."}
> {"t":{"$date":"2023-08-12T01:37:45.487+02:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.te
> nantMigrationDonors"}}
> {"t":{"$date":"2023-08-12T01:37:45.487+02:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"confi
> g.tenantMigrationRecipients"}}
> {"t":{"$date":"2023-08-12T01:37:45.487+02:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"ShardSplitDonorService","namespace":"config.tenantS
> plitDonors"}}
> {"t":{"$date":"2023-08-12T01:37:45.487+02:00"},"s":"I", "c":"CONTROL", "id":5945603, "ctx":"main","msg":"Multi threading initialized"}
> {"t":{"$date":"2023-08-12T01:37:45.488+02:00"},"s":"I", "c":"CONTROL", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":2999311,"port":27017,"dbPath":"/var/lib/mongodb2","architecture":"64-bit"
> ,"host":"xxxxxx.xxxxxxx.net"}}
> {"t":{"$date":"2023-08-12T01:37:45.488+02:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"6.0.8","gitVersion":"3d84c0dd4e5d99be0d69003652313e7eaf4cdd74
> ","openSSLVersion":"OpenSSL 1.1.1f 31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
> {"t":{"$date":"2023-08-12T01:37:45.488+02:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
> {"t":{"$date":"2023-08-12T01:37:45.488+02:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"config":"/etc/mongod.conf","net":{"bindIp":"127.0.0.1,mo
> ngo0.xxxxxxxxx.com","port":27017},"processManagement":{"timeZoneInfo":"/usr/share/zoneinfo"},"storage":{"dbPath":"/var/lib/mongodb2"},"systemLog":{"destination":"file","logAppend":false,"path":"/var/log/mongodb/mongod.
> log"}}}}
> {"t":{"$date":"2023-08-12T01:37:45.490+02:00"},"s":"I", "c":"STORAGE", "id":22270, "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/var/lib/mongodb2","storageEngine":"wired
> Tiger"}}
> {"t":{"$date":"2023-08-12T01:37:45.490+02:00"},"s":"I", "c":"STORAGE", "id":22297, "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mo
> ngodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]}
> {"t":{"$date":"2023-08-12T01:37:45.490+02:00"},"s":"I", "c":"STORAGE", "id":22315, "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=31625M,session_max=33000,eviction=(threads_min=4,
> threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=
> 10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rt
> s:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],"}}
> {"t":{"$date":"2023-08-12T01:37:47.061+02:00"},"s":"I", "c":"STORAGE", "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":1571}}
> {"t":{"$date":"2023-08-12T01:37:47.061+02:00"},"s":"I", "c":"RECOVERY", "id":23987, "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
> {"t":{"$date":"2023-08-12T01:37:47.083+02:00"},"s":"W", "c":"CONTROL", "id":22120, "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrest
> ricted","tags":["startupWarnings"]}
> {"t":{"$date":"2023-08-12T01:37:47.084+02:00"},"s":"W", "c":"CONTROL", "id":5123300, "ctx":"initandlisten","msg":"vm.max_map_count is too low","attr":{"currentValue":65530,"recommendedMinimum":102400,"maxConns":51200},"
> tags":["startupWarnings"]}
> {"t":{"$date":"2023-08-12T01:37:47.087+02:00"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersi
> on":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersio
> n":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
> {"t":{"$date":"2023-08-12T01:37:47.087+02:00"},"s":"I", "c":"REPL", "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"6.0","context":"startup
> "}}
> {"t":{"$date":"2023-08-12T01:37:47.087+02:00"},"s":"I", "c":"STORAGE", "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"}
> {"t":{"$date":"2023-08-12T01:37:47.089+02:00"},"s":"I", "c":"CONTROL", "id":20536, "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
> {"t":{"$date":"2023-08-12T01:37:47.089+02:00"},"s":"I", "c":"FTDC", "id":20625, "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/var/lib/mongodb2/diagnostic.dat
> a"}}
> {"t":{"$date":"2023-08-12T01:37:47.097+02:00"},"s":"I", "c":"REPL", "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStar
> t"}}
> {"t":{"$date":"2023-08-12T01:37:47.097+02:00"},"s":"I", "c":"STORAGE", "id":22262, "ctx":"initandlisten","msg":"Timestamp monitor starting"}
> {"t":{"$date":"2023-08-12T01:37:47.104+02:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
> {"t":{"$date":"2023-08-12T01:37:47.104+02:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}}
> {"t":{"$date":"2023-08-12T01:37:47.104+02:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
It would be really appreciated, if someone of you knows how to fix that problem, that systemctl start will run completely and Active: Running
is appearing instead of Active: activating
Thank you in advanced!