2

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.

2
  • That sounds like a realy basic question that could be easily answered by reading the AWS Farget Documentation (docs.aws.amazon.com/AmazonECS/latest/developerguide/…) - maybe you can try this first before asking a question here? Or is there a specific problem you are having with trying that out? Commented Aug 14, 2020 at 8:03
  • Is it required to get elasticsearch and push it to ecr only to be able to deploy for fargate? however I'm not changing anything in ES docker at all Commented Aug 14, 2020 at 8:11

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.