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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions nix/services/elasticsearch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ in
export ES_HOME ES_JAVA_OPTS ES_PATH_CONF

# Install plugins
rm -f "${config.dataDir}/plugins"
ln -sf ${esPlugins}/plugins "${config.dataDir}/plugins"
rm -rf "${config.dataDir}/plugins"
cp -rL ${esPlugins}/plugins "${config.dataDir}/plugins"
find "${config.dataDir}/plugins" -type d -exec chmod u+x {} \;

rm -f "${config.dataDir}/lib"
ln -sf ${config.package}/lib "${config.dataDir}/lib"
rm -f "${config.dataDir}/modules"
Expand Down
10 changes: 9 additions & 1 deletion nix/services/elasticsearch_test.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{ pkgs, config, ... }: {
services.elasticsearch."es1".enable = true;
services.elasticsearch."es1" = {
enable = true;
plugins = [
pkgs.elasticsearchPlugins.analysis-icu
];
};
settings.processes.test =
{
command = pkgs.writeShellApplication {
runtimeInputs = [ pkgs.curl ];
text = ''
curl 127.0.0.1:9200/_cat/health

echo "Verify plugin installation"
curl 127.0.0.1:9200/_cat/plugins | grep 'analysis-icu'
'';
name = "elasticsearch-test";
};
Expand Down