- mongodb 数据库连接出问题,窗口提示在计算机上找不到指定的对象,删除mongo.lock 之后再次运行mongod;报错依旧,并且再次生成mongo.lock 文件;
2024-02-01T22:23:51.937+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2024-02-01T22:23:52.155+0800 I CONTROL [initandlisten] MongoDB starting : pid=9880 port=27017 dbpath=C:\data\db\ 64-bit host=LAPTOP-IRH2R2BS
2024-02-01T22:23:52.155+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2024-02-01T22:23:52.156+0800 I CONTROL [initandlisten] db version v4.0.2
2024-02-01T22:23:52.157+0800 I CONTROL [initandlisten] git version: fc1573ba18aee42f97a3bb13b67af7d837826b47
2024-02-01T22:23:52.157+0800 I CONTROL [initandlisten] allocator: tcmalloc
2024-02-01T22:23:52.157+0800 I CONTROL [initandlisten] modules: none
2024-02-01T22:23:52.158+0800 I CONTROL [initandlisten] build environment:
2024-02-01T22:23:52.158+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2024-02-01T22:23:52.158+0800 I CONTROL [initandlisten] distarch: x86_64
2024-02-01T22:23:52.158+0800 I CONTROL [initandlisten] target_arch: x86_64
2024-02-01T22:23:52.159+0800 I CONTROL [initandlisten] options: {}
2024-02-01T22:23:52.160+0800 I STORAGE [initandlisten] Detected data files in C:\data\db\ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2024-02-01T22:23:52.160+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7595M,session_max=20000,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),statistics_log=(wait=0),verbose=(recovery_progress),
2024-02-01T22:23:52.273+0800 I STORAGE [initandlisten] WiredTiger message [1706797432:273426][9880:140727076149344], txn-recover: Main recovery loop: starting at 1/23552
2024-02-01T22:23:52.363+0800 I STORAGE [initandlisten] WiredTiger message [1706797432:363183][9880:140727076149344], txn-recover: Recovering log 1 through 2
2024-02-01T22:23:52.418+0800 I STORAGE [initandlisten] WiredTiger message [1706797432:418275][9880:140727076149344], txn-recover: Recovering log 2 through 2
2024-02-01T22:23:52.462+0800 I STORAGE [initandlisten] WiredTiger message [1706797432:462337][9880:140727076149344], txn-recover: Set global recovery timestamp: 0
2024-02-01T22:23:52.469+0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2024-02-01T22:23:52.474+0800 I CONTROL [initandlisten]
2024-02-01T22:23:52.474+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2024-02-01T22:23:52.474+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2024-02-01T22:23:52.475+0800 I CONTROL [initandlisten]
2024-02-01T22:23:52.475+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2024-02-01T22:23:52.475+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2024-02-01T22:23:52.475+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2024-02-01T22:23:52.476+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2024-02-01T22:23:52.476+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2024-02-01T22:23:52.476+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2024-02-01T22:23:52.476+0800 I CONTROL [initandlisten]
2024-02-01T22:23:52.676+0800 W FTDC [initandlisten] Failed to initialize Performance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with '在计算机上找不到指定的对象。' for counter '\PhysicalDisk(*)\% Disk Read Time'
2024-02-01T22:23:52.676+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2024-02-01T22:23:52.679+0800 I NETWORK [initandlisten] waiting for connections on port 27017
操作步骤
- 安装mongodb4.0 默认到c盘;
- 配置环境变量 C:\Program Files\MongoDB\Server\4.0\bin
- c盘根目录创建了文件夹data以及db;(所有路径都是英文)
- 打开管理员窗口;运行指令 mongod
- 报错;
- 打开文件创建的data>db 文件夹;发现mongo.lock;
- 删除mongo.lock;
- 报错同上;
- mongo.lock 文件再次生成
- 请问需要如何正常连接