连接mongodb超时
# 具体遇到的问题
# 报错信息的截图
# 相关课程内容截图
# 尝试过的解决思路和结果
尝试:
·1.改变ip地址配置-- 输入mongod --dbpath data/ --logpath log/mongo.log --port 27017 --bind_ip 0.0.0.0 --fork
2.关闭防火墙 systemctl stop firewalld
# 粘贴全部相关代码,切记添加代码注释(请勿截图)
[root@localhost mongodb_dir]# cd
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# mongo
MongoDB shell version v4.2.11
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("a0466ed0-0877-4190-bfca-6fcf66c895fe") }
MongoDB server version: 4.2.11
Server has startup warnings:
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten]
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten]
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2020-12-05T19:07:11.319+0800 I CONTROL [initandlisten]
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).
The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.
To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---
> exit
bye
[root@localhost ~]# mongod --dbpath data/ --logpath log/mongo.log --port 27017 --bind_ip 0.0.0.0 --fork
about to fork child process, waiting until server is ready for connections.
forked process: 6046
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the "--fork" option.
[root@localhost ~]#
在这里输入代码,可通过选择【代码语言】突出显示
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 107 份
- 解答问题 1672 个
Python最广为人知的应用就是爬虫了,有趣且酷的爬虫技能并没有那么遥远,本阶段带你学会利用主流Scrapy框架完成爬取招聘网站和二手车网站的项目实战。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星