我在设置本地mongo db方面遇到了问题。
我已经用apt-get安装了它并用
启动它$ service mongod start
我的mongod.log文件然后显示:
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] MongoDB starting : pid=23127 port=27017 dbpath=/var/lib/mongodb 64-bit host=laptop
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] db version v3.6.0-rc1
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] git version: 979ee612682b77d9cabaafae10787fbb578cd32a
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] allocator: tcmalloc
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] modules: none
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] build environment:
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] distmod: ubuntu1604
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] distarch: x86_64
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] target_arch: x86_64
2017-10-29T10:50:58.290+0100 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { port: 27017 }, processManagement: { timeZoneInfo: "/usr/share/zoneinfo" }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2017-10-29T10:50:58.291+0100 I - [initandlisten] Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-10-29T10:50:58.291+0100 I STORAGE [initandlisten]
2017-10-29T10:50:58.291+0100 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-10-29T10:50:58.291+0100 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-10-29T10:50:58.291+0100 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3419M,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),
2017-10-29T10:50:58.553+0100 I STORAGE [initandlisten] WiredTiger message [1509270658:553910][23127:0x7ff9d73459c0], txn-recover: Main recovery loop: starting at 3/31104
2017-10-29T10:50:58.615+0100 I STORAGE [initandlisten] WiredTiger message [1509270658:615079][23127:0x7ff9d73459c0], txn-recover: Recovering log 3 through 4
2017-10-29T10:50:58.619+0100 I STORAGE [initandlisten] WiredTiger message [1509270658:619671][23127:0x7ff9d73459c0], txn-recover: Recovering log 4 through 4
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten]
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten]
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2017-10-29T10:50:59.221+0100 I CONTROL [initandlisten]
2017-10-29T10:50:59.222+0100 I CONTROL [initandlisten]
2017-10-29T10:50:59.222+0100 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-10-29T10:50:59.222+0100 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2017-10-29T10:50:59.222+0100 I CONTROL [initandlisten]
2017-10-29T10:50:59.222+0100 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-10-29T10:50:59.222+0100 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2017-10-29T10:50:59.222+0100 I CONTROL [initandlisten]
2017-10-29T10:50:59.248+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'
2017-10-29T10:50:59.249+0100 I NETWORK [initandlisten] waiting for connections on port 27017
但是当我尝试在浏览器中访问127.0.0.1:27017时,我只是
&#34;无法访问此站点。连接已重置。&#34;
现在我的mongod.log文件附加了以下行:
2017-10-29T11:15:05.056+0100 I NETWORK [initandlisten] waiting for connections on port 27017
2017-10-29T11:15:49.780+0100 I NETWORK [listener] connection accepted from 127.0.0.1:35398 #1 (1 connection now open)
2017-10-29T11:15:49.780+0100 I NETWORK [listener] connection accepted from 127.0.0.1:35402 #2 (2 connections now open)
2017-10-29T11:15:49.853+0100 I NETWORK [conn1] Error receiving request from client: SSLHandshakeFailed: SSLHandshakeFailed. Ending connection from 127.0.0.1:35398 (connection id: 1)
2017-10-29T11:15:49.853+0100 I NETWORK [conn1] end connection 127.0.0.1:35398 (1 connection now open)
2017-10-29T11:15:49.853+0100 I NETWORK [conn2] Error receiving request from client: SSLHandshakeFailed: SSLHandshakeFailed. Ending connection from 127.0.0.1:35402 (connection id: 2)
2017-10-29T11:15:49.853+0100 I NETWORK [conn2] end connection 127.0.0.1:35402 (0 connections now open)
2017-10-29T11:15:49.853+0100 I NETWORK [listener] connection accepted from 127.0.0.1:35406 #3 (1 connection now open)
2017-10-29T11:15:49.853+0100 I NETWORK [conn3] Error receiving request from client: SSLHandshakeFailed: SSLHandshakeFailed. Ending connection from 127.0.0.1:35406 (connection id: 3)
2017-10-29T11:15:49.853+0100 I NETWORK [conn3] end connection 127.0.0.1:35406 (0 connections now open)
2017-10-29T11:15:49.943+0100 I NETWORK [listener] connection accepted from 127.0.0.1:35410 #4 (1 connection now open)
2017-10-29T11:15:49.943+0100 I NETWORK [conn4] Error receiving request from client: SSLHandshakeFailed: SSLHandshakeFailed. Ending connection from 127.0.0.1:35410 (connection id: 4)
2017-10-29T11:15:49.943+0100 I NETWORK [conn4] end connection 127.0.0.1:35410 (0 connections now open)
我是否需要运行一些额外的程序来将其作为Web服务器托管?或者这是我在这里失踪的其他东西?奇怪的是它抱怨SSL,因为它只是在localhost上使用默认设置运行。