简体   繁体   English

将 ElasticSearch Docker 容器部署到 AWS Fargate

[英]Deploy ElasticSearch Docker Container to AWS Fargate

I'm trying to deploy non custom single node elasticsearch:7.8.1 docker container to AWS ECS Fargate.我正在尝试将非自定义单节点 elasticsearch:7.8.1 docker 容器部署到 AWS ECS Fargate。

On my local I simply executed:在我的本地我只是执行:

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.8.1

And it spined up ES container for me which my app utilises.它为我启动了我的应用程序使用的 ES 容器。 I want do have the same container available in the cloud.我想要在云中使用相同的容器。

How can I do it?我该怎么做?

Update: I was able to deploy ES to Fargate but it fails in attempt to access it with error message:更新:我能够将 ES 部署到 Fargate,但尝试访问它失败并显示错误消息:

ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

After short googling I found this post where they fixed the problem by turning single node mode on.经过简短的谷歌搜索后,我发现了这篇文章,他们通过打开单节点模式解决了这个问题。 I dont quite understand how I can turn it on in Fargate, is it in task definition or how?我不太明白如何在 Fargate 中打开它,是在任务定义中还是如何打开它?

Another question would be what is the most common way of running ES in AWS?另一个问题是在 AWS 中运行 ES 的最常见方式是什么? in EC2 or AWS ES service?在 EC2 或 AWS ES 服务中? My aim is to setup infra as quickly as I can.我的目标是尽快设置基础设施。 I have got .net core app running in docker using elastic search.我使用弹性搜索在 docker 中运行了 .net 核心应用程序。

Answering to the latest comment.回复最新评论。 No, you can simply provide the public Elasticsearch image address from image registry like Docker Hub in your Docker-compose.yml file supplied to AWS Fargate.不,您只需在提供给 AWS Fargate 的 Docker-compose.yml 文件中提供来自镜像注册表(如 Docker Hub)的公共 Elasticsearch 镜像地址。 eg: image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0 .例如: image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0

You can solve the first issue with setting ulimits - I'm using task definition from within Terraform:您可以通过设置 ulimits 解决第一个问题——我使用的是 Terraform 中的任务定义:

ulimits = [
    {
      name      = "nofile"
      softLimit = 65535
      hardLimit = 65535
    }]

For the vm.max_map_count you can disable checking via setting ES_SETTING_NODE_STORE_ALLOW__MMAP to false .对于vm.max_map_count ,您可以通过将ES_SETTING_NODE_STORE_ALLOW__MMAP设置为false来禁用检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Terraform 部署 AWS EKS Fargate - Deploy AWS EKS Fargate with Terraform Angular 2 应用程序部署在 AWS 上运行的 docker 容器中 - Angular 2 app deploy in a docker Container running on AWS 使用相同的 docker 图像在 Azure 上运行多个容器实例,就像 AWS Fargate 任务一样 - Run multiple container instances on Azure with the same docker image just like AWS Fargate tasks AWS Fargate 在 docker 下运行 docker - AWS Fargate run docker inside under docker 在 AWS Fargate 上运行的容器中提取 AWS 凭证 - Pull AWS credentials in container running on AWS Fargate AWS CDK Init 容器依赖与 Fargate 模式 - AWS CDK Init Container dependency with Fargate Pattern AWS Fargate jenkins docker 卷安装不工作 - AWS Fargate jenkins docker volume mount is not working AWS ECS Fargate,将日志发送到多个目的地(CloudWatch Logs 和 Elasticsearch) - AWS ECS Fargate, send logs to multiple destinations (CloudWatch Logs and Elasticsearch) AWS SDK 在 fargate 上运行任务,在容器覆盖命令上抛出错误 - AWS SDK to runtask on fargate throwing error on container override command 使用 AWS 管道和 CDK 将应用程序从 github 部署到 Fargate - Deploy the app from github to fargate using AWS pipelines and CDK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM