Skip to content

Commit

Permalink
fix(elasticsearch): copy plugins to dataDir
Browse files Browse the repository at this point in the history
resolves #325
  • Loading branch information
shivaraj-bh committed Sep 17, 2024
1 parent 37176c4 commit 60cfe1e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 5 additions & 2 deletions nix/services/elasticsearch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ 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 f -exec chmod 0700 {} \;
find "${config.dataDir}/plugins" -type d -exec chmod 0700 {} \;
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

0 comments on commit 60cfe1e

Please sign in to comment.