在终端上运行mongod命令时MongoDB中止 [英] MongoDB aborting when running mongod command on terminal
问题描述
当我在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:
这对我有用:
-
通过在终端中输入以下命令来停止mongod进程:
sudo systemctl stop mongod
-
您必须为"dbPath"建立目录.使用以下命令:
sudo mkdir -p/data/db
和sudo chown -R`id -un`/data/db
-
然后运行
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:
Stop mongod process by entering the following command in terminal:
sudo systemctl stop mongod
You have to make directory for "dbPath" with following command:
sudo mkdir -p /data/db
andsudo chown -R `id -un` /data/db
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屋!