MongoDB Unable to write process id 1 to file mongod.lock

2/18/2022

I create a statefulset(2 pods) to run mongodb in k8s.

The two pods each mounts a remote nfs filesystem on /data.

The sts starts failed with the following error:

Unable to write process id 1 to file (fsync failed): /data/db/mongod.lock

The pods run normally when I use localstorage-class instead of nfs pvc.

The PVC is normal used in other deployments.

More information:

2022-02-15 10:39:37 2022-02-15T02:39:37.333+0000 I CONTROL [initandlisten] options: { net: { bindIp: "0.0.0.0" }, replication: { replSet: "rs0" }, security: { authorization: "enabled", clusterAuthMode: "keyFile", keyFile: "/data/config/mongodb-keyfile" } }
2022-02-15 10:39:37 2022-02-15T02:39:37.351+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1536M,cache_overflow=(file_max=0M),session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
2022-02-15 10:39:39 2022-02-15T02:39:39.241+0000 I STORAGE [initandlisten] WiredTiger message [1644892779:241309][1:0x7f315599eb00], txn-recover: Recovering log 6 through 7
2022-02-15 10:39:39 2022-02-15T02:39:39.296+0000 I STORAGE [initandlisten] WiredTiger message [1644892779:296654][1:0x7f315599eb00], txn-recover: Recovering log 7 through 7
2022-02-15 10:39:39 2022-02-15T02:39:39.963+0000 I STORAGE [initandlisten] WiredTiger message [1644892779:963979][1:0x7f315599eb00], txn-recover: Main recovery loop: starting at 6/3072 to 7/256
2022-02-15 10:39:40 2022-02-15T02:39:40.074+0000 I STORAGE [initandlisten] WiredTiger message [1644892780:74146][1:0x7f315599eb00], txn-recover: Recovering log 6 through 7
2022-02-15 10:39:40 2022-02-15T02:39:40.166+0000 I STORAGE [initandlisten] WiredTiger message [1644892780:166049][1:0x7f315599eb00], txn-recover: Recovering log 7 through 7
2022-02-15 10:39:40 2022-02-15T02:39:40.215+0000 I STORAGE [initandlisten] WiredTiger message [1644892780:215903][1:0x7f315599eb00], txn-recover: Set global recovery timestamp: (0, 0)
2022-02-15 10:39:40 2022-02-15T02:39:40.326+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2022-02-15 10:39:40 2022-02-15T02:39:40.338+0000 I STORAGE [initandlisten] Timestamp monitor starting
2022-02-15 10:39:40 2022-02-15T02:39:40.344+0000 I STORAGE [initandlisten] exception in initAndListen: FileStreamFailed: Unable to write process id 1
2022-02-15 10:39:40 to file (fsync failed): /data/db/mongod.lock Input/output error, terminating
2022-02-15 10:39:40 2022-02-15T02:39:40.344+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2022-02-15 10:39:40 2022-02-15T02:39:40.344+0000 I - [initandlisten] Stopping further Flow Control ticket acquisitions.
2022-02-15 10:39:40 2022-02-15T02:39:40.344+0000 I REPL [initandlisten] shutting down replication subsystems

kubectl version:

Client Version: version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.12-nks.3", GitCommit:"701a1f19ca1340c64f68c3a51d5f0b1c3e0e33af", GitTreeState:"clean", BuildDate:"2021-07-01T09:46:08Z", GoVersion:"go1.15.13", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.12-nks.3", GitCommit:"701a1f19ca1340c64f68c3a51d5f0b1c3e0e33af", GitTreeState:"clean", BuildDate:"2021-07-01T09:44:20Z", GoVersion:"go1.15.13", Compiler:"gc", Platform:"linux/amd64"}

Thanks for your help~

-- Aragorn1026
kubernetes
mongodb

0 Answers