簡體   English   中英

為什么當我在安裝后啟動 mongod 時它卡在 [ftdc] 將集合 local.oplog.rs 標記為集合版本:<unsharded>

[英]Why when i start mongod after installation it got stuck to [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>

昨天當我准備安裝 mongodb 時,我用正確的權限創建了 /data/db 並輸入了 mongod 但它卡在了 [ftdc] 將集合 local.oplog.rs 標記為集合版本:從 1 小時開始,謝謝你是時候幫助我了

經過幾個小時和幾次重新安裝后,我決定查看並查看某些文件是否“損壞”,我發現 MongoDB 沒有刪除它在 /var/lib/ 中的文件夾,所以我刪除了它,當我再次重新安裝 MongoDB 時它起作用了就像一個魅力。

我認為我們遇到了同樣的問題,我為自己找到了解決方案。 但如果我錯了,請原諒)

如果你想訪問 Mongodb,你必須輸入 mongo 而不是 mongod。

我正在做一個關於在 Centos 7 上安裝 MongoDB 的分步教程並使用它。 在某些時候,我決定關閉服務器:

db.shutdownServer()

在那之后,我在使用 mongod 啟動/登錄數據庫時遇到了麻煩。 但問題是,mongod 在您當前的終端中啟動了 Mongodb 服務器。

[root@ip-*-*-*-* tmp]# mongod
2020-06-09T19:52:14.630+0000 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-06-09T19:52:14.632+0000 W  ASIO     [main] No TransportLayer configured during NetworkInterface startup
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] MongoDB starting : pid=27618 port=27017 dbpath=/data/db 64-bit host=ip-*-*-*-*.eu-central-1.compute.internal
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] db version v4.2.7
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] git version: 51d9fe12b5d19720e72dcd7db0f2f17dd9a19212
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] allocator: tcmalloc
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] modules: none
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] build environment:
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten]     distmod: rhel70
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten]     distarch: x86_64
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten]     target_arch: x86_64
2020-06-09T19:52:14.632+0000 I  CONTROL  [initandlisten] options: { storage: { dbPath: "/data/db" } }
2020-06-09T19:52:14.633+0000 I  STORAGE  [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-06-09T19:52:14.633+0000 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=256M,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],
2020-06-09T19:52:15.356+0000 I  STORAGE  [initandlisten] WiredTiger message [1591732335:356822][27618:0x7f9b34a81c40], txn-recover: Recovering log 6 through 7
2020-06-09T19:52:15.412+0000 I  STORAGE  [initandlisten] WiredTiger message [1591732335:412272][27618:0x7f9b34a81c40], txn-recover: Recovering log 7 through 7
2020-06-09T19:52:15.500+0000 I  STORAGE  [initandlisten] WiredTiger message [1591732335:500634][27618:0x7f9b34a81c40], txn-recover: Main recovery loop: starting at 6/22528 to 7/256
2020-06-09T19:52:15.609+0000 I  STORAGE  [initandlisten] WiredTiger message [1591732335:609015][27618:0x7f9b34a81c40], txn-recover: Recovering log 6 through 7
2020-06-09T19:52:15.672+0000 I  STORAGE  [initandlisten] WiredTiger message [1591732335:672877][27618:0x7f9b34a81c40], txn-recover: Recovering log 7 through 7
2020-06-09T19:52:15.727+0000 I  STORAGE  [initandlisten] WiredTiger message [1591732335:727038][27618:0x7f9b34a81c40], txn-recover: Set global recovery timestamp: (0, 0)
2020-06-09T19:52:15.735+0000 I  RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2020-06-09T19:52:15.739+0000 I  STORAGE  [initandlisten] Timestamp monitor starting
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] 
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] 
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] 
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] 
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **        We suggest setting it to 'never'
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] 
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] **        We suggest setting it to 'never'
2020-06-09T19:52:15.741+0000 I  CONTROL  [initandlisten] 
2020-06-09T19:52:15.743+0000 I  SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
2020-06-09T19:52:15.744+0000 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.
2020-06-09T19:52:15.744+0000 I  SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
2020-06-09T19:52:15.745+0000 I  SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
2020-06-09T19:52:15.746+0000 I  SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
2020-06-09T19:52:15.746+0000 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2020-06-09T19:52:15.748+0000 I  SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
2020-06-09T19:52:15.749+0000 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
2020-06-09T19:52:15.749+0000 I  NETWORK  [listener] Listening on /tmp/mongodb-27017.sock
2020-06-09T19:52:15.749+0000 I  NETWORK  [listener] Listening on 127.0.0.1
2020-06-09T19:52:15.749+0000 I  NETWORK  [listener] waiting for connections on port 27017
2020-06-09T19:52:16.000+0000 I  SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>

我只是在這一點上卡住並按下了 ctrl+C

2020-06-09T19:56:26.172+0000 I  CONTROL  [signalProcessingThread] got signal 2 (Interrupt), will terminate after current cmd ends
2020-06-09T19:56:26.172+0000 I  NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2020-06-09T19:56:26.176+0000 I  NETWORK  [listener] removing socket file: /tmp/mongodb-27017.sock
2020-06-09T19:56:26.176+0000 I  -        [signalProcessingThread] Stopping further Flow Control ticket acquisitions.
2020-06-09T19:56:26.176+0000 I  CONTROL  [signalProcessingThread] Shutting down free monitoring
2020-06-09T19:56:26.176+0000 I  FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2020-06-09T19:56:26.180+0000 I  STORAGE  [signalProcessingThread] Deregistering all the collections
2020-06-09T19:56:26.180+0000 I  STORAGE  [signalProcessingThread] Timestamp monitor shutting down
2020-06-09T19:56:26.180+0000 I  STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2020-06-09T19:56:26.180+0000 I  STORAGE  [signalProcessingThread] Shutting down session sweeper thread
2020-06-09T19:56:26.180+0000 I  STORAGE  [signalProcessingThread] Finished shutting down session sweeper thread
2020-06-09T19:56:26.180+0000 I  STORAGE  [signalProcessingThread] Shutting down journal flusher thread
2020-06-09T19:56:26.264+0000 I  STORAGE  [signalProcessingThread] Finished shutting down journal flusher thread
2020-06-09T19:56:26.264+0000 I  STORAGE  [signalProcessingThread] Shutting down checkpoint thread
2020-06-09T19:56:26.264+0000 I  STORAGE  [signalProcessingThread] Finished shutting down checkpoint thread
2020-06-09T19:56:26.268+0000 I  STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2020-06-09T19:56:26.268+0000 I  CONTROL  [signalProcessingThread] now exiting
2020-06-09T19:56:26.268+0000 I  CONTROL  [signalProcessingThread] shutting down with code:0

在這一點上,我意識到我有那個致命的額外字母,並且我能夠訪問數據庫

[root@ip-*-*-*-* tmp]# mongo

我遇到了同樣的問題。 打開一個新終端,cd 到相同的路徑,然后運行“mongo”命令。 然后它起作用了!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM