R
Railwayβ€’7mo ago
Raigato

Elasticsearch docker image

Did anyone manage to run elasticsearch docker image in Railway? I created a docker image service from elasticsearch:8.12.1 with the following env
ELASTIC_PASSWORD=SUPER_SECRET_PASSWORD
ELASTIC_USERNAME=elastic
discovery.type=single-node
ELASTIC_PASSWORD=SUPER_SECRET_PASSWORD
ELASTIC_USERNAME=elastic
discovery.type=single-node
but it keeps crashing with the following logs
loaded module [runtime-fields-common]

loaded module [x-pack-async]

loaded module [vector-tile]

loaded module [lang-expression]

loaded module [x-pack-eql]

fatal exception while booting Elasticsearch

ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log

ERROR: Elasticsearch exited unexpectedly, with exit code 1
loaded module [runtime-fields-common]

loaded module [x-pack-async]

loaded module [vector-tile]

loaded module [lang-expression]

loaded module [x-pack-eql]

fatal exception while booting Elasticsearch

ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log

ERROR: Elasticsearch exited unexpectedly, with exit code 1
It runs fine locally with railway run docker run elasticsearch:8.12.1 I have no clue how to get said logs as the container dies on exit and I can't mount a volume on another path than /usr/share/elasticsearch/data
Solution:
looks like the image wants a volume mounted at /usr/share/elasticsearch/data instead
Jump to solution
17 Replies
Percy
Percyβ€’7mo ago
Project ID: 21336b7e-4344-41de-b812-f1d71747e697
Brody
Brodyβ€’7mo ago
please send the full dockerfile you are using
Brody
Brodyβ€’7mo ago
any reason why you are using a dockerfile instead of deploying the image directly? (I have never used elastic search before)
Raigato
Raigatoβ€’7mo ago
I am using the image directly
No description
Raigato
Raigatoβ€’7mo ago
I think the solution is this: https://stackoverflow.com/a/53097050/13735374 but I have no idea how to pull this up in Railway
Brody
Brodyβ€’7mo ago
you can't, is that needed?
Raigato
Raigatoβ€’7mo ago
I think so but I can't be sure as I can't access the logs when the container crashed after writing in the logs πŸ₯²
Brody
Brodyβ€’7mo ago
why can't you mount a volume to /usr/share/elasticsearch/logs?
Raigato
Raigatoβ€’7mo ago
When I do, I get this:
Raigato
Raigatoβ€’7mo ago
It somehow need a volume on /usr/share/elasticsearch/data to run
Brody
Brodyβ€’7mo ago
set a service variable RAILWAY_RUN_UID to 0
Raigato
Raigatoβ€’7mo ago
Ok, it still doesn't work but I can move logs to the volume, I can investigate now πŸ™
Brody
Brodyβ€’7mo ago
progress!
Raigato
Raigatoβ€’7mo ago
Ok made some progress, it seems to be somehow related to volumes. With no volume attached, it works fine. When I mount a volume on /usr/share/elasticsearch, I get /usr/local/bin/docker-entrypoint.sh: line 49: /usr/share/elasticsearch/bin/elasticsearch-env-from-file: No such file or directory Also, I still have the vm.max_map_count=262144 thing (https://discord.com/channels/713503345364697088/1206911735399849984/1207002891022372967) but as I understand from your previous answer, I cannot change it, right ? Any solution ?
Want results from more Discord servers?
Add your server