AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 537463
Accepted
Parul Chourasia
Parul Chourasia
Asked: 2019-08-27 03:02:47 +0800 CST2019-08-27 03:02:47 +0800 CST 2019-08-27 03:02:47 +0800 CST

在 Cli 中给出 mongod 命令时无法连接 MongoDB

  • 772

我正在尝试在 centos VM 上安装 mongoDb,并关注了几个站点,例如 https://linuxize.com/post/how-to-install-mongodb-on-centos-7/,https://www.digitalocean.com/ community/tutorials/how-to-install-mongodb-on-centos-7 ,但在 Cli 中给出 mongod 命令时无法连接/进入 MongoDB。有人对此有任何想法吗?提前致谢。

输出mongod:

-460f-4bb5-a5d7-0bbe48f3246a") }
2019-08-26T15:21:13.417+0530 I  INDEX    [initandlisten] index build: done building index _id_ on ns admin.system.version
2019-08-26T15:21:13.417+0530 I  SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
2019-08-26T15:21:13.417+0530 I  COMMAND  [initandlisten] setting featureCompatibilityVersion to 4.2
2019-08-26T15:21:13.421+0530 I  SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
2019-08-26T15:21:13.421+0530 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.
2019-08-26T15:21:13.422+0530 I  SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
2019-08-26T15:21:13.422+0530 I  STORAGE  [initandlisten] createCollection: local.startup_log with generated UUID: 660f8f2a-c6d0-4a0c-a4bb-0f975d1f207e and options: { c485760 }

2019-08-26T15:21:13.426+0530 I  INDEX    [initandlisten] index build: done building index _id_ on ns local.startup_log
2019-08-26T15:21:13.427+0530 I  SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
2019-08-26T15:21:13.427+0530 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2019-08-26T15:21:13.428+0530 I  SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
2019-08-26T15:21:13.428+0530 I  NETWORK  [initandlisten] Listening on /tmp/mongodb-27017.sock
2019-08-26T15:21:13.428+0530 I  NETWORK  [initandlisten] Listening on 127.0.0.1
2019-08-26T15:21:13.428+0530 I  NETWORK  [initandlisten] waiting for connections on port 27017
2019-08-26T15:21:13.428+0530 I  CONTROL  [LogicalSessionCacheReap] Sessions collection is not set up; waiting until next sessions reap interval: config.system.sessions
2019-08-26T15:21:13.429+0530 I  STORAGE  [LogicalSessionCacheRefresh] createCollection: config.system.sessions with provided UUID: 45ed25cc-1dbb-4f38-8333-cf36ae8bd473 UUID("45ed25cc-1dbb-4f38-8333-cf36ae8bd473") }
2019-08-26T15:21:13.433+0530 I  INDEX    [LogicalSessionCacheRefresh] index build: done building index _id_ on ns config.system.sessions
2019-08-26T15:21:13.438+0530 I  INDEX    [LogicalSessionCacheRefresh] index build: starting on config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lnfig.system.sessions", expireAfterSeconds: 1800 } using method: Hybrid
2019-08-26T15:21:13.439+0530 I  INDEX    [LogicalSessionCacheRefresh] build may temporarily use up to 500 megabytes of RAM
2019-08-26T15:21:13.439+0530 I  INDEX    [LogicalSessionCacheRefresh] index build: collection scan done. scanned 0 total records in 0 seconds
2019-08-26T15:21:13.439+0530 I  INDEX    [LogicalSessionCacheRefresh] index build: inserted 0 keys from external sorter into index in 0 seconds
2019-08-26T15:21:13.440+0530 I  INDEX    [LogicalSessionCacheRefresh] index build: done building index lsidTTLIndex on ns config.system.sessions
2019-08-26T15:26:13.428+0530 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>

在此处输入图像描述

linux software-installation
  • 3 3 个回答
  • 5890 Views

3 个回答

  • Voted
  1. Best Answer
    bebu
    2019-09-06T05:13:32+08:002019-09-06T05:13:32+08:00

    我不确定您实际上要做什么。运行将在您当前的 shell 中mongod启动一个 mongo服务器。如果你想连接到 MongoDB 服务器,你应该使用mongo

    • 0
  2. Gamma032
    2020-04-17T22:16:14+08:002020-04-17T22:16:14+08:00

    不清楚,但如果你已经Marking collection...从mongod命令中到达,MongoDB 已经启动。

    要开始工作,请打开一个新的终端窗口,导航到您的 bin 文件夹并运行mongo. 我的部分困惑是它似乎挂起(在 bash 中),但事实并非如此。键入help它应该可以工作。

    • 0
  3. user373704
    2019-09-22T08:04:37+08:002019-09-22T08:04:37+08:00

    我有同样的问题。我正在尝试安装 mongo db。我调用 ./mongod 命令,安装无法完成。它挂在相同的命令上:

    2019-09-21T21:45:17.039+0600 I SHARDING [LogicalSessionCacheReap] 将集合 config.transactions 标记为集合版本:

    Mac OS Mojave 10.14 我的所有痕迹:

    MacBook-Pro-dns:mongo user$ ./mongod
    2019-09-21T21:45:16.178+0600 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten] MongoDB starting : pid=8310 port=27017 dbpath=/data/db 64-bit host=MacBook-Pro-dns.local
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten] db version v4.2.0
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten] git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten] allocator: system
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten] modules: none
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten] build environment:
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten]     distarch: x86_64
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten]     target_arch: x86_64
    2019-09-21T21:45:16.187+0600 I  CONTROL  [initandlisten] options: {}
    2019-09-21T21:45:16.189+0600 W  STORAGE  [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
    2019-09-21T21:45:16.189+0600 I  STORAGE  [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
    2019-09-21T21:45:16.189+0600 W  STORAGE  [initandlisten] Recovering data from the last clean checkpoint.
    2019-09-21T21:45:16.189+0600 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=7680M,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),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
    2019-09-21T21:45:16.699+0600 I  STORAGE  [initandlisten] WiredTiger message [1569080716:699859][8310:0x10e6245c0], txn-recover: Recovering log 1 through 2
    2019-09-21T21:45:16.762+0600 I  STORAGE  [initandlisten] WiredTiger message [1569080716:762524][8310:0x10e6245c0], txn-recover: Recovering log 2 through 2
    2019-09-21T21:45:16.825+0600 I  STORAGE  [initandlisten] WiredTiger message [1569080716:825486][8310:0x10e6245c0], txn-recover: Main recovery loop: starting at 1/22912 to 2/256
    2019-09-21T21:45:16.826+0600 I  STORAGE  [initandlisten] WiredTiger message [1569080716:826288][8310:0x10e6245c0], txn-recover: Recovering log 1 through 2
    2019-09-21T21:45:16.884+0600 I  STORAGE  [initandlisten] WiredTiger message [1569080716:884735][8310:0x10e6245c0], txn-recover: Recovering log 2 through 2
    2019-09-21T21:45:16.932+0600 I  STORAGE  [initandlisten] WiredTiger message [1569080716:932134][8310:0x10e6245c0], txn-recover: Set global recovery timestamp: (0,0)
    2019-09-21T21:45:17.002+0600 I  RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
    2019-09-21T21:45:17.019+0600 I  STORAGE  [initandlisten] Timestamp monitor starting
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] 
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] 
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] 
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] 
    2019-09-21T21:45:17.020+0600 I  CONTROL  [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
    2019-09-21T21:45:17.031+0600 I  SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
    2019-09-21T21:45:17.034+0600 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.
    2019-09-21T21:45:17.034+0600 I  SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
    2019-09-21T21:45:17.034+0600 I  SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
    2019-09-21T21:45:17.035+0600 I  SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
    2019-09-21T21:45:17.036+0600 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
    2019-09-21T21:45:17.039+0600 I  SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
    2019-09-21T21:45:17.039+0600 I  NETWORK  [initandlisten] Listening on /tmp/mongodb-27017.sock
    2019-09-21T21:45:17.039+0600 I  NETWORK  [initandlisten] Listening on 127.0.0.1
    2019-09-21T21:45:17.039+0600 I  NETWORK  [initandlisten] waiting for connections on port 27017
    2019-09-21T21:45:17.039+0600 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>```
    
    • -1

相关问题

  • 有没有办法让 ls 只显示某些目录的隐藏文件?

  • 使用键盘快捷键启动/停止 systemd 服务 [关闭]

  • 需要一些系统调用

  • astyle 不会更改源文件格式

  • 通过标签将根文件系统传递给linux内核

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve