如何在 AWS 中为弹性搜索使用持久存储?
How can I use persisted storage for elasticsearch in AWS?
我正在将我的容器部署到 AWS EKS,即 运行 elasticsearch。我需要选择一个存储服务来存储所有数据。我搜索了几篇文章,有人提到了 EBS。这是像 elasticsearch
这样的数据源的良好存储吗?有没有更好的解决办法?
我知道 AWS 提供托管 elasticsearch
解决方案,但我不想坚持使用 AWS。通过使用EKS,我以后迁移到其他云很容易。
AWS 提供名为 Amazon Elasticsearch Service which is based on the OpenDistro Elasticsearch. Which means you are not tied into AWS. AWS just manages the cluster on your behalf. But because it is an AWS managed service it supports additional services such as Amazon CloudWatch and Amazon S3. If you are using Amazon Elasticsearch service you can store data on S3. See the blog post "Use Amazon S3 to Store a Single Amazon Elasticsearch Service Index". Amazon Elasticsearch service has a new cost effective way to store large amounts of read-only data by moving the data from EBS to S3. This new service is known as Ultrawarm. More information here 的托管 Elasticsearch 服务。
回答你的问题。
您想存储什么?因为有几个选项。但是正如您提到的 EBS(亚马逊弹性块存储)。我假设您想存储 Elastic Search 数据。在这种情况下,我建议您查看 Amazon Elastic File System (EFS)。
EBS 是绑定到 EC2 实例的块存储。在您的例子中,EC2 实例 运行 作为 EKS 节点。通常 EBS 只绑定一个 EC2 实例。虽然它确实支持多个 EC2 instances too 与 Amazon EBS Multi-Attach。但是把EBS想象成一个硬盘。
另一方面,EFS 是可扩展的网络存储,可以 linked 到多个容器(EKS, ECS, and Fargate), EC2 instances, and Lambda 功能。
以下博客 post 解释了新功能 - AWS Fargate for Amazon EKS now supports EFS. In summary AWS released a driver called the Amazon EFS CSI driver. The documentation is here。您可以使用此驱动程序在您的容器中装载 EFS 卷。因为它是网络存储,所以您可以与其他实例共享该卷。
EKS Workshop 有一节介绍如何 link EFS 到 EKS。你可以关注工作坊here.
的支持回复
由于您为 EKS 使用 Fargate,我认为使用 Amazon Elastic File System 是一个不错的选择,它会 persist您的数据,即使您终止了 EKS 集群。此外,ECS 任务、EC2 实例甚至 Lambda 函数可以同时使用 EFS 上的数据。
EFS 可与 EKS Fargate 一起使用,如 AWS blog:
中所述
EFS provides a simple, scalable, and fully managed shared file system for use with AWS cloud services, and can also help Kubernetes applications be highly available because all data written to EFS is written to multiple AWS Availability Zones. EFS is built for on-demand petabyte growth without application interruption, and it automatically grows and shrinks as files are added and removed, eliminating the need to provision and manage capacity to accommodate growth.
我正在将我的容器部署到 AWS EKS,即 运行 elasticsearch。我需要选择一个存储服务来存储所有数据。我搜索了几篇文章,有人提到了 EBS。这是像 elasticsearch
这样的数据源的良好存储吗?有没有更好的解决办法?
我知道 AWS 提供托管 elasticsearch
解决方案,但我不想坚持使用 AWS。通过使用EKS,我以后迁移到其他云很容易。
AWS 提供名为 Amazon Elasticsearch Service which is based on the OpenDistro Elasticsearch. Which means you are not tied into AWS. AWS just manages the cluster on your behalf. But because it is an AWS managed service it supports additional services such as Amazon CloudWatch and Amazon S3. If you are using Amazon Elasticsearch service you can store data on S3. See the blog post "Use Amazon S3 to Store a Single Amazon Elasticsearch Service Index". Amazon Elasticsearch service has a new cost effective way to store large amounts of read-only data by moving the data from EBS to S3. This new service is known as Ultrawarm. More information here 的托管 Elasticsearch 服务。
回答你的问题。
您想存储什么?因为有几个选项。但是正如您提到的 EBS(亚马逊弹性块存储)。我假设您想存储 Elastic Search 数据。在这种情况下,我建议您查看 Amazon Elastic File System (EFS)。
EBS 是绑定到 EC2 实例的块存储。在您的例子中,EC2 实例 运行 作为 EKS 节点。通常 EBS 只绑定一个 EC2 实例。虽然它确实支持多个 EC2 instances too 与 Amazon EBS Multi-Attach。但是把EBS想象成一个硬盘。
另一方面,EFS 是可扩展的网络存储,可以 linked 到多个容器(EKS, ECS, and Fargate), EC2 instances, and Lambda 功能。
以下博客 post 解释了新功能 - AWS Fargate for Amazon EKS now supports EFS. In summary AWS released a driver called the Amazon EFS CSI driver. The documentation is here。您可以使用此驱动程序在您的容器中装载 EFS 卷。因为它是网络存储,所以您可以与其他实例共享该卷。
EKS Workshop 有一节介绍如何 link EFS 到 EKS。你可以关注工作坊here.
的支持回复由于您为 EKS 使用 Fargate,我认为使用 Amazon Elastic File System 是一个不错的选择,它会 persist您的数据,即使您终止了 EKS 集群。此外,ECS 任务、EC2 实例甚至 Lambda 函数可以同时使用 EFS 上的数据。
EFS 可与 EKS Fargate 一起使用,如 AWS blog:
中所述EFS provides a simple, scalable, and fully managed shared file system for use with AWS cloud services, and can also help Kubernetes applications be highly available because all data written to EFS is written to multiple AWS Availability Zones. EFS is built for on-demand petabyte growth without application interruption, and it automatically grows and shrinks as files are added and removed, eliminating the need to provision and manage capacity to accommodate growth.