启动备份WiredTiger mongodb数据库时出错

问题描述

我的任务是在新服务器上还原WiredTiger mongodb备份,我已将该文件夹下载到路径/data/db

但是什么时候 在新服务器上运行sudo mongod --dbpath=/data/db时,出现以下错误

{"t":{"$date":"2020-11-06T22:11:16.443+00:00"},"s":"W","c":"ASIO","id":22601,"ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2020-11-06T22:11:16.443+00:00"},"s":"I","c":"NETWORK","id":4648601,"msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required,set tcpFastOpenServer,tcpFastOpenClient,and tcpFastOpenQueueSize."}
{"t":{"$date":"2020-11-06T22:11:16.443+00:00"},"c":"STORAGE","id":4615611,"ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":19032,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"ip-172-31-4-37"}}
{"t":{"$date":"2020-11-06T22:11:16.443+00:00"},"c":"CONTROL","id":23403,"msg":"Build Info","attr":{"buildInfo":{"version":"4.4.1","gitVersion":"ad91a93a5a31e175f5cbf8c69561e788bbc55ce1","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2020-11-06T22:11:16.443+00:00"},"id":51765,"msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
{"t":{"$date":"2020-11-06T22:11:16.443+00:00"},"id":21951,"msg":"Options set by command line","attr":{"options":{"storage":{"dbPath":"/data/db"}}}}
{"t":{"$date":"2020-11-06T22:11:16.444+00:00"},"id":22270,"msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}}
{"t":{"$date":"2020-11-06T22:11:16.444+00:00"},"id":22315,"msg":"opening WiredTiger","attr":{"config":"create,cache_size=94061M,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,compact_progress],"}}
{"t":{"$date":"2020-11-06T22:11:16.908+00:00"},"id":22430,"msg":"WiredTiger message","attr":{"message":"[1604700676:908863][19032:0x7fd255377c80],txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 3 through 4"}}
{"t":{"$date":"2020-11-06T22:11:16.953+00:00"},"attr":{"message":"[1604700676:953627][19032:0x7fd255377c80],txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 4 through 4"}}
{"t":{"$date":"2020-11-06T22:11:17.039+00:00"},"attr":{"message":"[1604700677:39694][19032:0x7fd255377c80],txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Main recovery loop: starting at 3/640 to 4/256"}}
{"t":{"$date":"2020-11-06T22:11:17.040+00:00"},"attr":{"message":"[1604700677:40016][19032:0x7fd255377c80],txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 3 through 4"}}
{"t":{"$date":"2020-11-06T22:11:17.092+00:00"},"attr":{"message":"[1604700677:92204][19032:0x7fd255377c80],txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 4 through 4"}}
{"t":{"$date":"2020-11-06T22:11:17.134+00:00"},"attr":{"message":"[1604700677:134313][19032:0x7fd255377c80],txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global recovery timestamp: (1604638812,8737)"}}
{"t":{"$date":"2020-11-06T22:11:17.134+00:00"},"attr":{"message":"[1604700677:134351][19032:0x7fd255377c80],txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global oldest timestamp: (1604638812,8737)"}}
{"t":{"$date":"2020-11-06T22:11:25.589+00:00"},"id":4795906,"msg":"WiredTiger opened","attr":{"durationMillis":9145}}
{"t":{"$date":"2020-11-06T22:11:25.590+00:00"},"c":"RECOVERY","id":23987,"msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":1604638812,"i":8737}}}}
{"t":{"$date":"2020-11-06T22:11:25.591+00:00"},"id":22383,"msg":"The size storer reports that the oplog contains","attr":{"numRecords":327031365,"dataSize":133132846247}}
{"t":{"$date":"2020-11-06T22:11:25.592+00:00"},"id":22386,"msg":"Sampling the oplog to determine where to place markers for truncation"}
{"t":{"$date":"2020-11-06T22:11:25.592+00:00"},"id":22389,"msg":"Sampling from the oplog to determine where to place markers for truncation","attr":{"from":{"$timestamp":{"t":1604570183,"i":3649}},"to":{"$timestamp":{"t":1604638812,"i":10667}}}}
{"t":{"$date":"2020-11-06T22:11:25.592+00:00"},"id":22390,"msg":"Taking samples and assuming each oplog section contains","attr":{"numSamples":991,"containsNumRecords":3296963,"containsNumBytes":1342177280}}
{"t":{"$date":"2020-11-06T22:11:27.142+00:00"},"id":22393,"msg":"Oplog sampling complete"}
{"t":{"$date":"2020-11-06T22:11:27.142+00:00"},"id":22382,"msg":"WiredTiger record store oplog processing finished","attr":{"durationMillis":1550}}
{"t":{"$date":"2020-11-06T22:11:27.176+00:00"},"id":22262,"msg":"Timestamp monitor starting"}
{"t":{"$date":"2020-11-06T22:11:27.177+00:00"},"id":22120,"msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
{"t":{"$date":"2020-11-06T22:11:27.177+00:00"},"id":22138,"msg":"You are running this process as the root user,which is not recommended","id":22140,"msg":"This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from,or with --bind_ip_all to bind to all interfaces. If this behavior is desired,start the server with --bind_ip 127.0.0.1 to disable this warning","tags":["startupWarnings"]}
{"t":{"$date":"2020-11-06T22:11:27.187+00:00"},"id":22167,"msg":"You are running on a NUMA machine. We suggest launching mongod like this to avoid performance problems: numactl --interleave=all mongod [other options]","id":22184,"msg":"Soft rlimits too low","attr":{"currentValue":1024,"recommendedMinimum":64000},"tags":["startupWarnings"]}
{"t":{"$date":"2020-11-06T22:11:27.189+00:00"},"id":21005,"msg":"Not restarting unfinished index builds because we are in standalone mode"}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"s":"F","id":20573,"msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: BadValue: Invalid value for version,found 4.0,expected '4.4' or '4.2'. Contents of featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\",version: \"4.0\" }. See https://docs.mongodb.com/master/release-notes/4.4-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 4.2,see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/4.4/#upgrade-procedures."}}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"c":"REPL","id":4784900,"msg":"Stepping down the ReplicationCoordinator for shutdown","attr":{"waitTimeMillis":10000}}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"c":"COMMAND","id":4784901,"msg":"Shutting down the MirrorMaestro"}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"c":"SHARDING","id":4784902,"msg":"Shutting down the WaitForMajorityService"}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"id":20562,"msg":"Shutdown: going to close listening sockets"}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"id":4784905,"msg":"Shutting down the global connection pool"}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"id":4784906,"msg":"Shutting down the FlowControlTicketholder"}
{"t":{"$date":"2020-11-06T22:11:27.284+00:00"},"c":"-","id":20520,"msg":"Stopping further Flow Control ticket acquisitions."}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784908,"msg":"Shutting down the PeriodicThreadToAbortExpiredTransactions"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784934,"msg":"Shutting down the PeriodicThreadToDecreaseSnapshotHistoryCachePressure"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784909,"msg":"Shutting down the ReplicationCoordinator"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784910,"msg":"Shutting down the ShardingInitializationMongoD"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784911,"msg":"Enqueuing the ReplicationStateTransitionLock for shutdown"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784912,"msg":"Killing all operations for shutdown"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4695300,"msg":"Interrupted all currently running operations","attr":{"opsKilled":3}}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784913,"msg":"Shutting down all open transactions"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784914,"msg":"Acquiring the ReplicationStateTransitionLock for shutdown"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"c":"INDEX","id":4784915,"msg":"Shutting down the IndexBuildsCoordinator"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784916,"msg":"Reacquiring the ReplicationStateTransitionLock for shutdown"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784917,"msg":"Attempting to mark clean shutdown"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784918,"msg":"Shutting down the replicasetMonitor"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784921,"msg":"Shutting down the MigrationUtilExecutor"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784925,"msg":"Shutting down free monitoring"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"c":"FTDC","id":4784926,"msg":"Shutting down full-time data capture"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784927,"msg":"Shutting down the HealthLog"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784929,"msg":"Acquiring the global lock for shutdown"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":4784930,"msg":"Shutting down the storage engine"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":20282,"msg":"Deregistering all the collections"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":22372,"ctx":"OplogVisibilityThread","msg":"Oplog visibility thread shutting down."}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":22261,"msg":"Timestamp monitor shutting down"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":22317,"msg":"WiredTigerKVEngine shutting down"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":22318,"msg":"Shutting down session sweeper thread"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":22319,"msg":"Finished shutting down session sweeper thread"}
{"t":{"$date":"2020-11-06T22:11:27.285+00:00"},"id":22320,"msg":"Shutting down journal flusher thread"}
{"t":{"$date":"2020-11-06T22:11:27.286+00:00"},"id":22321,"msg":"Finished shutting down journal flusher thread"}
{"t":{"$date":"2020-11-06T22:11:27.286+00:00"},"id":22322,"msg":"Shutting down checkpoint thread"}
{"t":{"$date":"2020-11-06T22:11:27.286+00:00"},"id":22323,"msg":"Finished shutting down checkpoint thread"}
{"t":{"$date":"2020-11-06T22:11:27.286+00:00"},"id":4795902,"msg":"Closing WiredTiger","attr":{"closeConfig":"leak_memory=true,"}}
{"t":{"$date":"2020-11-06T22:11:28.544+00:00"},"id":4795901,"msg":"WiredTiger closed","attr":{"durationMillis":1258}}
{"t":{"$date":"2020-11-06T22:11:28.544+00:00"},"id":22279,"msg":"shutdown: removing fs lock..."}
{"t":{"$date":"2020-11-06T22:11:28.544+00:00"},"id":4784931,"msg":"Dropping the scope cache for shutdown"}
{"t":{"$date":"2020-11-06T22:11:28.544+00:00"},"id":20565,"msg":"Now exiting"}
{"t":{"$date":"2020-11-06T22:11:28.544+00:00"},"id":23138,"msg":"Shutting down","attr":{"exitCode":62}}

运行mongod也会出现上述错误

我该如何解决

解决方法

您需要查看mongod,这是严重性失败。

在阅读了indexes之后,看来原因可能与索引构建有关。

根据日志中的建议,将fileUpload从4.0升级到4.4。有关how to do upgrade,请参阅此文档。