在终端上运行mongod命令时MongoDB中止 [英] MongoDB aborting when running mongod command on terminal

查看:140
本文介绍了在终端上运行mongod命令时MongoDB中止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在ubuntu终端上运行 mongod 命令时,出现此错误:

  {"t":{"$ date":"2020-10-28T22:27:29.341 + 05:00"},"s":"I","c"; ::"CONTROL","id":23285,"ctx":"main","msg":自动禁用TLS 1.0,以强制启用TLS 1.0指定--sslDisabledProtocols'none'";}{"t":{"$ date":"2020-10-28T22:27:29.348 + 05:00"},"s":"W","c":"ASIO";,"id":22601,"ctx":"main","msg":"NetworkInterface启​​动期间未配置TransportLayer"{"t":{"$ date":"2020-10-28T22:27:29.349 + 05:00"},"s":"I","c":"NETWORK","id":4648601,"ctx":"main","msg":"Implicit TCP FastOpen"不可用.如果需要TCP FastOpen,请设置tcpFastOpenServer,tcpFastOpenClient和tcpFastOpenQueueSize.{"t":{"$ date":"2020-10-28T22:27:29.349 + 05:00"},"s":"I","c":"STORAGE","id":4615611,"ctx":"initandlisten","msg":"MongoDB开始","attr":{"pid":9479,端口":27017,"; dbPath":"/data/db","architecture":"64位","host":"E7250&"}}{"t":{"$ date":"2020-10-28T22:27:29.349 + 05:00"},"s":"I","c":"CONTROL","id":23403,"ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4".1","gitVersion":"ad91a93a5a31e175f5cbf8c69561e788bbc55ce1","openSSLVersion":"OpenSSL 1.1.1f 2020年3月31日",模块":[],分配"字段:;:{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}{"t":{"$ date":"2020-10-28T22:27:29.349 + 05:00"},"s":"I","c":"CONTROL","id":51765,"ctx":"initandlisten","msg":操作系统","attr":{"OS":{名称":"Ubuntu",版本":"20.04"}}}{"t":{"$ date":"2020-10-28T22:27:29.349 + 05:00"},"s":"I","c":"CONTROL","id":21951,"ctx":"initandlisten","msg":命令行设置的选项","attr":{"options":{}}}{"t":{"$ date":"2020-10-28T22:27:29.350 + 05:00"},"s":"E","c":"NETWORK","id":23024,"ctx":"initandlisten","msg":无法取消套接字文件的链接","attr":{路径":"/tmp/mongodb-27017.sock",错误":不允许操作"}}{"t":{"$ date":"2020-10-28T22:27:29.350 + 05:00"},"s":"F","c":-";,"id":23091,"ctx":"initandlisten","msg":致命断言","attr":{"msgid":40486,文件":"src/mongo/transport/transport_layer_asio.cpp",行":919}}{"t":{"$ date":"2020-10-28T22:27:29.350 + 05:00"},"s":"F","c":-";,"id":23092,"ctx":"initandlisten","msg":"\ n \ n *** fassert()失败后中止\ n \ n"} 

当我输入命令 sudo systemctl status mongod

时,

mongod进程正在运行

 ●mongod.service-MongoDB数据库服务器已加载:已加载(/lib/systemd/system/mongod.service;已启用;供应商预设:ena>活动:自PKT 2020-10-28 22:02:55起活动(运行);32分钟前文件:https://docs.mongodb.org/manual主PID:7566(Mongod)记忆体:159.0MCGroup:/system.slice/mongod.service└─7566/usr/bin/mongod --config/etc/mongod.conf10月28日22:02:55 E7250 systemd [1]:启动了MongoDB数据库服务器. 

出了什么问题?

etc/mongod.conf文件

 #mongod.conf#有关所有选项的文档,请参阅:#http://docs.mongodb.org/manual/reference/configuration-options/#在哪里以及如何存储数据.贮存:dbPath:/var/lib/mongodb杂志:已启用:true#  引擎:#mmapv1:#wiredTiger:#在何处写入日志数据.systemLog:目的地:文件logAppend:true路径:/var/log/mongodb/mongod.log#网络接口网:端口:27017bindIp:127.0.0.1#流程如何运行流程管理:timeZoneInfo:/usr/share/zoneinfo#安全:#operation配置文件:#复制:#sharding:##仅限企业选项:#audit日志:#snmp: 

解决方案

这对我有用:

  1. 通过在终端中输入以下命令来停止mongod进程: sudo systemctl stop mongod

  2. 您必须为"dbPath"建立目录.使用以下命令: sudo mkdir -p/data/db sudo chown -R`id -un`/data/db

  3. 然后运行 sudo mongod --port 27017

完成!

您不能同时运行 sudo systemctl start mongod sudo mongod --port 27017 .通过 sudo systemctl停止mongod停止mongod ,然后运行 sudo mongod --port 27017

希望此解决方案适用于所有有相同问题的人.

when i run mongod command on ubuntu terminal i get this error:

{"t":{"$date":"2020-10-28T22:27:29.341+05:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2020-10-28T22:27:29.348+05:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2020-10-28T22:27:29.349+05:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2020-10-28T22:27:29.349+05:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":9479,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"E7250"}}
{"t":{"$date":"2020-10-28T22:27:29.349+05:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.1","gitVersion":"ad91a93a5a31e175f5cbf8c69561e788bbc55ce1","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2020-10-28T22:27:29.349+05:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
{"t":{"$date":"2020-10-28T22:27:29.349+05:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{}}}
{"t":{"$date":"2020-10-28T22:27:29.350+05:00"},"s":"E",  "c":"NETWORK",  "id":23024,   "ctx":"initandlisten","msg":"Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
{"t":{"$date":"2020-10-28T22:27:29.350+05:00"},"s":"F",  "c":"-",        "id":23091,   "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":40486,"file":"src/mongo/transport/transport_layer_asio.cpp","line":919}}
{"t":{"$date":"2020-10-28T22:27:29.350+05:00"},"s":"F",  "c":"-",        "id":23092,   "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}

mongod process is running when i enter command sudo systemctl status mongod

● mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: ena>
     Active: active (running) since Wed 2020-10-28 22:02:55 PKT; 32min ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 7566 (mongod)
     Memory: 159.0M
     CGroup: /system.slice/mongod.service
             └─7566 /usr/bin/mongod --config /etc/mongod.conf

Oct 28 22:02:55 E7250 systemd[1]: Started MongoDB Database Server.

what went wrong?

etc/mongod.conf file

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

解决方案

This works for me:

  1. Stop mongod process by entering the following command in terminal: sudo systemctl stop mongod

  2. You have to make directory for "dbPath" with following command: sudo mkdir -p /data/db and sudo chown -R `id -un` /data/db

  3. Then run sudo mongod --port 27017

Done!

you can't run sudo systemctl start mongod and sudo mongod --port 27017 at same time. Stop mongod by sudo systemctl stop mongod then run sudo mongod --port 27017

Hope this solution works for all who have same problem.

这篇关于在终端上运行mongod命令时MongoDB中止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆