账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    mongod --config /usr/local/etc/mongod.conf 无法启动
    48
    0

    问题:

      使用mac,第一次安装mongodb,使用命令:mongod --config /usr/local/etc/mongod.conf 无法启动mongodb,也不打印任何信息

    输入输入mongod 打印:

    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000} span.s1 {font-variant-ligatures: no-common-ligatures}
    2020-01-21T09:37:47.092+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] MongoDB starting : pid=706 port=27017 dbpath=/data/db 64-bit host=zhaohangdeMacBook-Pro.local
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] db version v4.2.2
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] git version: a0bbbff6ada159e19298d37946ac8dc4b497eadf
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] allocator: system
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] modules: none
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] build environment:
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] distarch: x86_64
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] target_arch: x86_64
    2020-01-21T09:37:47.101+0800 I CONTROL [initandlisten] options: {}
    2020-01-21T09:37:47.102+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3584M,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-01-21T09:37:47.609+0800 I STORAGE [initandlisten] WiredTiger message [1579570667:609640][706:0x10f5f1dc0], txn-recover: Set global recovery timestamp: (0,0)
    2020-01-21T09:37:47.672+0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
    2020-01-21T09:37:47.715+0800 I STORAGE [initandlisten] Timestamp monitor starting
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten]
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten]
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten]
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten]
    2020-01-21T09:37:47.716+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
    2020-01-21T09:37:47.717+0800 I STORAGE [initandlisten] createCollection: admin.system.version with provided UUID: fb17097e-1776-4459-961d-f71499c404fd and options: { uuid: UUID("fb17097e-1776-4459-961d-f71499c404fd") }
    2020-01-21T09:37:47.761+0800 I INDEX [initandlisten] index build: done building index _id_ on ns admin.system.version
    2020-01-21T09:37:47.762+0800 I SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
    2020-01-21T09:37:47.762+0800 I COMMAND [initandlisten] setting featureCompatibilityVersion to 4.2
    2020-01-21T09:37:47.762+0800 I SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
    2020-01-21T09:37:47.762+0800 I STORAGE [initandlisten] Flow Control is enabled on this deployment.

    2020-01-21T09:37:47.762+0800 I SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>

    2020-01-21T09:37:47.763+0800 I STORAGE [initandlisten] createCollection: local.startup_log with generated UUID: 98a179e5-d6d1-47a4-af7b-b1687587be18 and options: { capped: true, size: 10485760 }

    2020-01-21T09:37:47.816+0800 I INDEX [initandlisten] index build: done building index _id_ on ns local.startup_log

    2020-01-21T09:37:47.816+0800 I SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>

    2020-01-21T09:37:47.816+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'

    2020-01-21T09:37:47.819+0800 I SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
    2020-01-21T09:37:47.819+0800 I NETWORK [initandlisten] Listening on /tmp/mongodb-27017.sock
    2020-01-21T09:37:47.819+0800 I NETWORK [initandlisten] Listening on 127.0.0.1

    2020-01-21T09:37:47.819+0800 I NETWORK [initandlisten] waiting for connections on port 27017

    2020-01-21T09:37:47.822+0800 I CONTROL [LogicalSessionCacheReap] Sessions collection is not set up; waiting until next sessions reap interval: config.system.sessions does not exist

    2020-01-21T09:37:47.822+0800 I STORAGE [LogicalSessionCacheRefresh] createCollection: config.system.sessions with provided UUID: 92a85516-6fa3-46ae-bc19-0c2370a66c7e and options: { uuid: UUID("92a85516-6fa3-46ae-bc19-0c2370a66c7e") }

    2020-01-21T09:37:47.867+0800 I INDEX [LogicalSessionCacheRefresh] index build: done building index _id_ on ns config.system.sessions

    2020-01-21T09:37:47.912+0800 I INDEX [LogicalSessionCacheRefresh] index build: starting on config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lsidTTLIndex", ns: "config.system.sessions", expireAfterSeconds: 1800 } using method: Hybrid
    2020-01-21T09:37:47.912+0800 I INDEX [LogicalSessionCacheRefresh] build may temporarily use up to 500 megabytes of RAM
    2020-01-21T09:37:47.913+0800 I INDEX [LogicalSessionCacheRefresh] index build: collection scan done. scanned 0 total records in 0 seconds
    2020-01-21T09:37:47.913+0800 I INDEX [LogicalSessionCacheRefresh] index build: inserted 0 keys from external sorter into index in 0 seconds
    2020-01-21T09:37:47.924+0800 I INDEX [LogicalSessionCacheRefresh] index build: done building index lsidTTLIndex on ns config.system.sessions
    2020-01-21T09:37:47.935+0800 I COMMAND [LogicalSessionCacheRefresh] command config.system.sessions command: createIndexes { createIndexes: "system.sessions", indexes: [ { key: { lastUse: 1 }, name: "lsidTTLIndex", expireAfterSeconds: 1800 } ], $db: "config" } numYields:0 reslen:114 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 2 } }, ReplicationStateTransition: { acquireCount: { w: 3 } }, Global: { acquireCount: { r: 1, w: 2 } }, Database: { acquireCount: { r: 1, w: 2, W: 1 } }, Collection: { acquireCount: { r: 4, w: 1, R: 1, W: 2 } }, Mutex: { acquireCount: { r: 3 } } } flowControl:{ acquireCount: 1 } storage:{} protocol:op_msg 113ms
    2020-01-21T09:37:48.001+0800 I SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>
    Killed: 9

    也没看到明显的报错信息

    环境:osx(mac)

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • []飲天下£烈酒_ 普通会员 1楼

      这个错误表明你在尝试启动MongoDB服务器,但是命令行参数没有正确设置。请按照以下步骤进行操作:

      1. 确保你已经正确设置了MongoDB的配置文件,路径为 /usr/local/etc/mongod.conf
      2. 检查你的系统中是否安装了MongoDB。如果没有,你可以通过以下命令安装: sudo apt-get install mongodb 如果已经安装了,但仍然无法启动,你可以尝试使用 systemctl start mongodsystemctl start mongodb.service 命令来启动。

      3. 如果你仍然无法启动,你可能需要检查你的防火墙设置。请确保MongoDB的端口没有被防火墙阻塞。你可以使用以下命令查看MongoDB的监听端口: sudo systemctl status mongod 如果监听端口被阻塞,你可能需要修改防火墙设置。

      4. 如果以上步骤都无法解决问题,你可能需要寻求专业的技术支持。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部