为什么我的mongodb集合会自动删除? [英] Why is my mongodb collection deleted automatically?

查看:865
本文介绍了为什么我的mongodb集合会自动删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在三个EC2实例中都有一个MongoDB客户端,并且创建了一个副本集.上一次我遇到空间之类的其他问题,这些问题建议设置TTL.根本没做.
现在,我该如何调试这种情况并进行正确的根本原因分析?我什至在调试日志中也找不到任何东西.桌子消失了.如何设置适当的日志记录机制以及如何确保不再删除所有表?

I have a MongoDB client in three EC2 instances and I have created a replica set. Last time I had a problem, of space constraint which stopped my mongod process, thereby halting the application and now in an instance couple of days back, some of my tables were gone from database, so I set logging and all to my database just to catch if anything like that happens again. In a fresh incident this morning I was unable to login to my system and that's when I found out that whole database was empty. I checked other SO question like this which suggest setting up a TTL.Which I haven't done at all.
Now how do I debug this situation and do a proper root cause analysis? I can't even find anything in my debug logs as well. The tables just vanished. How do I set up proper logging mechanism and how do I ensure that all my tables are never ever deleted again?

推荐答案

今天,我从亚马逊收到一封邮件,说我可能正在运行MongoDB的不安全版本,并且可能导致了此问题.因此,面对此问题的人,请仔细阅读 MongoDB提供的安全清单.这里有一些绝对必要的要点.
1.启用访问控制并强制执行身份验证
2.加密通信
3.限制网络曝光

Today I got a mail from Amazon that I was probably running an unsecured version of MongoDB and that may have caused this issue. So who ever is facing this issue please go through the Security Checklist Provided by MongoDB. There are some points that are absolutely necessary in there.
1. Enable Access Control and Enforce Authentication
2. Encrypt Communication
3. Limit Network Exposure

这三个是核心,您可以Configure Role-Based Access Control取决于有多少人访问您的数据库.

These three are the core and depending upon how many people access your database you can Configure Role-Based Access Control.

这些都是我所做的所有事情.在此事件发生之前,我没有认真对待安全性,但是在我被它击中之后.我确保已采取所有必要的预防措施. 希望这对某人有帮助.

These are all the things I have done. Before this incident I had not taken security that seriously but after I was hit by it. I made sure I have all the necessary precautions in place. Hope this helps someone.

这篇关于为什么我的mongodb集合会自动删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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