C:\Windows\system32>c:\mongodb\bin\mongo.exe --port=14014
MongoDB shell version v3.4.7
connecting to: mongodb://127.0.0.1:14014/
2018-05-29T20:10:06.939+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:14014 after 5000ms milliseconds, giving up.
2018-05-29T20:10:06.939+0530 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:14014, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed
У меня проблема с подключением к базе данных, которую я запускаю в качестве службы Windows локально с номером порта 14014.
Я вижу, что служба успешно работает с помощью диспетчера задач Windowsи я также могу получить к нему доступ с помощью Python.Но я не могу подключить его с помощью командной строки, набрав следующую команду:
C:> C: \ mongodb \ bin \ mongo.exe --port = 14014
Однако я могу подключиться к другой базе данных через порт 27017, который я использую, используя mongod.exe.Это очень сложно!Я надеюсь, что кто-то может помочь мне здесь!
Я также прикрепляю под журналом службу базы данных, работающую на порту 14014.
2018-05-29T20:06:00.169+0530 I CONTROL [main] Trying to start Windows service 'MongoDB'
2018-05-29T20:06:00.170+0530 I CONTROL [initandlisten] MongoDB starting : pid=6964 port=14041 dbpath=C:\Users\Lubna\Desktop\My Naseef\My Freelancing\mongodatabase\db 64-bit host=Lubna-PC
2018-05-29T20:06:00.170+0530 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] db version v3.4.7
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] git version: cf38c1b8a0a8dca4a11737581beafef4fe120bcd
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] allocator: tcmalloc
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] modules: none
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] build environment:
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] distmod: 2008plus-ssl
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] distarch: x86_64
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] target_arch: x86_64
2018-05-29T20:06:00.171+0530 I CONTROL [initandlisten] options: { config: "C:\Users\Lubna\Desktop\My Naseef\My Freelancing\mongodatabase\config\nwdb.cfg", net: { port: 14041 }, service: true, storage: { dbPath: "C:\Users\Lubna\Desktop\My Naseef\My Freelancing\mongodatabase\db" }, systemLog: { destination: "file", path: "C:\Users\Lubna\Desktop\My Naseef\My Freelancing\mongodatabase\log\nwdb.log" } }
2018-05-29T20:06:00.198+0530 I - [initandlisten] Detected data files in C:\Users\Lubna\Desktop\My Naseef\My Freelancing\mongodatabase\db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-05-29T20:06:00.198+0530 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=949M,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),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2018-05-29T20:06:02.582+0530 I CONTROL [initandlisten]
2018-05-29T20:06:02.582+0530 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-05-29T20:06:02.583+0530 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-05-29T20:06:02.583+0530 I CONTROL [initandlisten]
2018-05-29T20:06:02.583+0530 I CONTROL [initandlisten] Hotfix KB2731284 or later update is not installed, will zero-out data files.
2018-05-29T20:06:02.583+0530 I CONTROL [initandlisten]
2018-05-29T20:06:03.960+0530 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/Users/Lubna/Desktop/My Naseef/My Freelancing/mongodatabase/db/diagnostic.data'
2018-05-29T20:06:03.961+0530 I NETWORK [thread1] waiting for connections on port 14041
2018-05-29T20:06:03.961+0530 I STORAGE [initandlisten] Service running
2018-05-29T20:06:56.578+0530 I NETWORK [thread1] connection accepted from 127.0.0.1:50811 #1 (1 connection now open)
2018-05-29T20:06:56.645+0530 I NETWORK [conn1] received client metadata from 127.0.0.1:50811 conn1: { driver: { name: "PyMongo", version: "3.6.1" }, os: { type: "Windows", name: "Windows 7", architecture: "AMD64", version: "6.1.7601-SP1" }, platform: "CPython 3.6.0.final.0" }
2018-05-29T20:06:56.709+0530 I NETWORK [thread1] connection accepted from 127.0.0.1:50812 #2 (2 connections now open)
2018-05-29T20:06:56.709+0530 I NETWORK [conn2] received client metadata from 127.0.0.1:50812 conn2: { driver: { name: "PyMongo", version: "3.6.1" }, os: { type: "Windows", name: "Windows 7", architecture: "AMD64", version: "6.1.7601-SP1" }, platform: "CPython 3.6.0.final.0" }
2018-05-29T20:06:57.017+0530 I COMMAND [conn2] command workdb_test.cud_db command: find { find: "cud_db", filter: {} } planSummary: COLLSCAN keysExamined:0 docsExamined:4 cursorExhausted:1 numYields:0 nreturned:4 reslen:1116 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_query 297ms
2018-05-29T20:06:57.357+0530 I - [conn1] end connection 127.0.0.1:50811 (2 connections now open)
2018-05-29T20:06:57.357+0530 I - [conn2] end connection 127.0.0.1:50812 (2 connections now open)
2018-05-29T20:08:15.569+0530 I NETWORK [thread1] connection accepted from 127.0.0.1:50855 #3 (1 connection now open)
2018-05-29T20:08:15.570+0530 I NETWORK [conn3] received client metadata from 127.0.0.1:50855 conn3: { driver: { name: "PyMongo", version: "3.6.1" }, os: { type: "Windows", name: "Windows 7", architecture: "AMD64", version: "6.1.7601-SP1" }, platform: "CPython 3.6.0.final.0" }
2018-05-29T20:08:15.572+0530 I NETWORK [thread1] connection accepted from 127.0.0.1:50856 #4 (2 connections now open)
2018-05-29T20:08:15.582+0530 I NETWORK [conn4] received client metadata from 127.0.0.1:50856 conn4: { driver: { name: "PyMongo", version: "3.6.1" }, os: { type: "Windows", name: "Windows 7", architecture: "AMD64", version: "6.1.7601-SP1" }, platform: "CPython 3.6.0.final.0" }
2018-05-29T20:08:16.105+0530 I - [conn4] end connection 127.0.0.1:50856 (2 connections now open)
2018-05-29T20:08:16.105+0530 I - [conn3] end connection 127.0.0.1:50855 (1 connection now open)