Cannot start Elasticsearch 6.2.1 on Centos7


#1

I've installed Elasticsearch 6.2.1 via RPM but when I try to run it gives me on several files.
This is my Dockerfile:
FROM centos:centos7

ADD elasticsearch.repo /etc/yum.repos.d/elasticsearch.repo
RUN rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch &&
yum install -y --setopt=tsflags=nodocs --nogpgcheck
java-1.8.0-openjdk-headless
elasticsearch-6.2.1

USER 1000
CMD ["sh", "/usr/share/elasticsearch/bin/elasticsearch"]

If I try to run build this image and run it will give me this err:
/usr/share/elasticsearch/bin/elasticsearch-env: line 70: /etc/sysconfig/elasticsearch: Permission denied

If I give permission for this file and try to run again. I will get other permission issues with var/lib/elasticsearch and var/log/elasticsearch.

I've also noticed that these file/directory are owned by elasticsearch group. I've tried to start elasticsearch as user 'elasticsearch' and it seems to work. However I wonder if there is any other way to run elasticsearch? Or is running as 'elasticsearch' user the standard way? Thanks.


(David Pilato) #2

Why not using elastic official docker image instead ?


#3

I haven't tried it yet. But do you suggest any changes I should make with the current Dockerfile in order for the Elasticsearch to run ?


(David Pilato) #4

I don't know. I'm trying to always use the simplest path. :wink:


#5

Do you happen to know where can I find the dockerfile that is used to build official image ?


#6

nvm I found it


(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.