mirror of
https://github.com/Graylog2/graylog2-server.git
synced 2026-03-13 09:32:21 +08:00
Synchronize opensearch config to a user-defined directory (#15307)
* Synchronize opensearch config to a user-defined directory (fixes #15223) * fixed check naming * fixed opensearch configuration location * simplified Environment constructor * point gc logs of datanodes opensearch to /tmp for now * full dir sync for opensearch config * Fixed full dir sync when removing non-empty dir * simpified recursive directory deletion
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.graylog.datanode.process;
|
||||
|
||||
import org.graylog.datanode.management.Environment;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -24,6 +26,7 @@ import java.util.Map;
|
||||
public record OpensearchConfiguration(
|
||||
String opensearchVersion,
|
||||
Path opensearchDir,
|
||||
Path opensearchConfigDir,
|
||||
int httpPort,
|
||||
int transportPort,
|
||||
String authUsername,
|
||||
@@ -55,4 +58,10 @@ public record OpensearchConfiguration(
|
||||
private String toValuesList(List<String> values) {
|
||||
return String.join(",", values);
|
||||
}
|
||||
|
||||
public Environment getEnv() {
|
||||
final Environment env = new Environment(System.getenv());
|
||||
env.put("OPENSEARCH_PATH_CONF", opensearchConfigDir.resolve("opensearch").toAbsolutePath().toString());
|
||||
return env;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user