简体   繁体   中英

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.

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. 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:

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?

Another question would be what is the most common way of running ES in AWS? in EC2 or AWS ES service? My aim is to setup infra as quickly as I can. I have got .net core app running in docker using elastic search.

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. eg: 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 = [
    {
      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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM