将AWS EC2 Instance上安装的MongoDB的存储位置设置为EBS存储。(Set storage location of MongoDB installed on AWS EC2 Inst

编程入门 行业动态 更新时间:2024-10-25 04:26:57
将AWS EC2 Instance上安装的MongoDB的存储位置设置为EBS存储。(Set storage location of MongoDB installed on AWS EC2 Instance to EBS storage. And How do I recover It after instance is stopped/terminated?)

您好,我是AWS的新手。 我已经创建了Instance并在其上安装了MongoDB。 但我从EC2文档中了解到,一旦停止或终止,存储在EC2机器上的数据就会被破坏。 所以我必须使用EBS进行数据存储。

在创建EC2实例的第四步,我选择了卷

但我不知道如何使用它。 它是由EC2-Instance自动用于存储数据还是我们必须手动执行。 我知道,为了更改数据库存储,我们必须更改名为mongod.conf的文件并在那里修改dbpath,但我不知道在那里提供什么路径。 之后,如果我将EBS存储器取回,那么我也会销毁该实例。 先谢谢您的帮助。

Hello everone I am new to AWS. I have created and Instance and installed MongoDB on It. But I learned from EC2 docs that the data stored on EC2 machine destroyed once they stop or terminated. So I have to use EBS for the data storage.

On the 4th step of creating EC2-Instance I selected the volume

But I don't know how to use it. Is it automatically used by EC2-Instance to store the data in it or we have to manually do it. I know that for changing the database storage we have to change the file named mongod.conf and modify the dbpath there but I don't know what path to give there. and after that also if I destroyed that instance when I will get the EBS storage back. thanks in advance for the help.

最满意答案

在屏幕截图中,EBS卷是实例的根卷。 因此,除非您向实例添加其他卷,否则该实例上持久存储到磁盘的所有内容都将存储在EBS卷上。 您可以选择(或创建)任何存储数据库的位置。

In your screenshot the EBS volume is the root volume for the instance. So unless you add other volumes to the instance, everything persisted to disk on that instance is going to be stored on the EBS volume. You can pick (or create) any location to store your database.

更多推荐

本文发布于:2023-08-04 10:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1415330.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设置为   位置   EBS   MongoDB   AWS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!