Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearch: copy plugins to dataDir #331

Merged
merged 4 commits into from
Sep 18, 2024
Merged

elasticsearch: copy plugins to dataDir #331

merged 4 commits into from
Sep 18, 2024

Conversation

shivaraj-bh
Copy link
Member

resolves #325

@shivaraj-bh
Copy link
Member Author

@secobarbital can you check if this works for you?

Also, I have included a test to check for plugin installation.

@secobarbital
Copy link
Contributor

secobarbital commented Sep 18, 2024

Wow, thank you for the quick turnaround! Yes, this does work for me, it is almost the same as the workaround I came back to report:

                cp -RL ${esPlugins}/plugins "${config.dataDir}"
                find "${config.dataDir}/plugins" -type d -exec chmod u+w {} \;

I find that only the directories needed their permissions fixed to get it to work, not the files.

However, I also found this in the official elasticsearch Dockerfile and I wonder if we should follow their permissions as canonical. It looks like they intentionally package the files and directories with no permissions and expect consumer to modify them?

RUN sed -i -e 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' bin/elasticsearch-env && \
    mkdir data && \
    mv config/log4j2.properties config/log4j2.file.properties && \
    mv config/log4j2.docker.properties config/log4j2.properties && \
    find . -type d -exec chmod 0555 {} + && \
    find . -type f -exec chmod 0444 {} + && \
    chmod 0555 bin/* jdk/bin/* jdk/lib/jspawnhelper modules/x-pack-ml/platform/linux-*/bin/* && \
    chmod 0775 bin config config/jvm.options.d data logs plugins && \
    find config -type f -exec chmod 0664 {} +

Copy link
Contributor

@secobarbital secobarbital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works! Coupa of slight tweaks to suggest.

nix/services/elasticsearch.nix Outdated Show resolved Hide resolved
nix/services/elasticsearch.nix Outdated Show resolved Hide resolved
@shivaraj-bh shivaraj-bh merged commit 5960a2c into main Sep 18, 2024
2 checks passed
@shivaraj-bh shivaraj-bh deleted the es-plugins-fix branch September 18, 2024 18:39
@shivaraj-bh
Copy link
Member Author

Thanks @secobarbital

shivaraj-bh pushed a commit that referenced this pull request Sep 23, 2024
…search plugins (#332)

We need to add the write permission to directories in elasticsearch
plugins, not execute, which they already have.

Sorry @shivaraj-bh this was a typo in my suggestion in #331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to load elasticsearch plugin
2 participants