2

My current project requires me to use elasticsearch:2.4.6-alpine docker image. The container seems running correctly and I am able to go inside the container using CLI. But when curl http://localhost:9200 executed it says:

curl: (52) Empty reply from server

Tried the same curl command from inside the container and it says:

curl: (7) Failed to connect to localhost port 9200: Connection refused

The elasticsearch service seems not exists when I use rc-status list from inside the container. Anyone have any idea?

Edi
  • 31
  • 6
  • Do you get any solution for your above problem? I'm facing the same one. – Waqas Afzal Jun 03 '22 at 05:05
  • Alas the only real solution is to get a proper computer not a Fisher Price one. I've been on one of these Fisher Price M1s for about 6 months now and I'm finally giving up and going back to Windows. Much cheaper, much faster, much more reliable. I hate Apple computer with a passion. – satnhak Nov 10 '22 at 13:33

2 Answers2

1

It looks like support for M1 was only added in elasticsearch 7.12.0. Use that version or anything newer.

image: elasticsearch:7.16.3

Some say it works better when pulling the image file from elastic directly, not via dockerhub.

image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3

More discussion: https://discuss.elastic.co/t/arm-docker-image/268588

Legacy elasticsearch (v2)

any help here is appreciated :)

I am still looking for any way to run legacy elasticsearch (version 2) on a M1 mac via Rosetta. So far, no luck.

Update: elasticsearch V2 doesn't work because of a known bug in Docker's qemu translation from x64 to arm. Workarounds maybe possible (at least for v6+)

Well... the QEMU emulation is frankly not ideal and there are no guarantees there. If you need to run ES 6.x on Apple silicon the best option is probably to use a proper aarch64 JDK and use the tarball distribution. Still no guarantees here as this isn't a supported configuration. Source: https://github.com/elastic/elasticsearch/issues/69767

0

I found the solution was to rebuild the elastic search image on your M1 Mac. Just search the source code for particular version on GitHub and build the docker image.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Edi
  • 31
  • 6