mongodb - 为什么我的 MongDB 无法访问数据?
问题描述
我有一个在 ECR/Kubernetes 上运行的 MongoDB 实例。据我所知,数据库路径是默认路径:
root@mongodb-ddn44:/data/db# ps -aux | grep -i mongod
mongodb 1 0.1 0.2 1112480 78564 ? Ssl 13:51 0:13 mongod --bind_ip_all
root 171 0.0 0.0 11284 976 pts/1 S+ 16:03 0:00 grep --color=auto -i mongod
此外,当我检查/data/db/
目录时,它似乎有内容:
root@mongodb-ddn44:/data/db# du -sh /data/db/
1.5G /data/db/
但是,我没有看到任何包含任何内容的数据库:
root@mongodb-ddn44:/data/db# mongo
MongoDB shell version v4.0.10
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("65eb0346-bac0-4a80-ae49-88b8c0adf223") }
MongoDB server version: 4.0.10
Server has startup warnings:
2021-07-16T13:51:22.594+0000 I CONTROL [initandlisten]
2021-07-16T13:51:22.594+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2021-07-16T13:51:22.594+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2021-07-16T13:51:22.595+0000 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()
---
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
而且,在这一点上,我被困住了。
解决方案
推荐阅读
- php - 如何用 Woocommerce 搜索替换 Wordpress 默认搜索
- react-router - 使用反应路由器和服务工作者在创建反应应用程序中为任何 url 脱机工作
- javascript - 如何在 React.js 中注入“FontAwesomeIcon”?
- php - codeigniter 从日期范围中选择记录而不重复记录
- python - Django-admin startproject mysite 不创建目录
- laravel-backpack - 多租户背包
- git - 在其他 git 存储库的构建管道期间,Azure DevOps 错误“Git fetch failed with exit code 128”
- haskell - 无法将类型“[Char]”与 spa 的“Char”匹配
- vue.js - 无法获取日期范围选择器(Vuejs)的值
- r - 如何将键/图例组织到 ggplot 的类别中