Cannot run old elasticsearch on m1 chip (with rosetta2)

Viewed 1000

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?

1 Answers

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

Related