Cleanup settings and system properties entanglement
This commit cleans up some additional places where system properties were being used to pass settings to Elasticsearch. Relates #18524
This commit is contained in:
parent
62ac719a94
commit
f63d1255d1
|
@ -137,13 +137,13 @@ def start_node(version, release_dir, data_dir, repo_dir, tcp_port=DEFAULT_TRANSP
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
os.path.join(release_dir, 'bin/elasticsearch'),
|
os.path.join(release_dir, 'bin/elasticsearch'),
|
||||||
'-Des.path.data=%s' % data_dir,
|
'-Epath.data=%s' % data_dir,
|
||||||
'-Des.path.logs=logs',
|
'-Epath.logs=logs',
|
||||||
'-Des.cluster.name=%s' % cluster_name,
|
'-Ecluster.name=%s' % cluster_name,
|
||||||
'-Des.network.host=localhost',
|
'-Enetwork.host=localhost',
|
||||||
'-Des.transport.tcp.port=%s' % tcp_port,
|
'-Etransport.tcp.port=%s' % tcp_port,
|
||||||
'-Des.http.port=%s' % http_port,
|
'-Ehttp.port=%s' % http_port,
|
||||||
'-Des.path.repo=%s' % repo_dir
|
'-Epath.repo=%s' % repo_dir
|
||||||
]
|
]
|
||||||
if version.startswith('0.') or version.startswith('1.0.0.Beta') :
|
if version.startswith('0.') or version.startswith('1.0.0.Beta') :
|
||||||
cmd.append('-f') # version before 1.0 start in background automatically
|
cmd.append('-f') # version before 1.0 start in background automatically
|
||||||
|
|
|
@ -99,8 +99,8 @@ final class ExternalNode implements Closeable {
|
||||||
} else {
|
} else {
|
||||||
params.add("bin/elasticsearch.bat");
|
params.add("bin/elasticsearch.bat");
|
||||||
}
|
}
|
||||||
params.add("-Des.cluster.name=" + clusterName);
|
params.add("-Ecluster.name=" + clusterName);
|
||||||
params.add("-Des.node.name=" + nodeName);
|
params.add("-Enode.name=" + nodeName);
|
||||||
Settings.Builder externaNodeSettingsBuilder = Settings.builder();
|
Settings.Builder externaNodeSettingsBuilder = Settings.builder();
|
||||||
for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) {
|
for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) {
|
||||||
switch (entry.getKey()) {
|
switch (entry.getKey()) {
|
||||||
|
@ -121,11 +121,11 @@ final class ExternalNode implements Closeable {
|
||||||
}
|
}
|
||||||
this.externalNodeSettings = externaNodeSettingsBuilder.put(REQUIRED_SETTINGS).build();
|
this.externalNodeSettings = externaNodeSettingsBuilder.put(REQUIRED_SETTINGS).build();
|
||||||
for (Map.Entry<String, String> entry : externalNodeSettings.getAsMap().entrySet()) {
|
for (Map.Entry<String, String> entry : externalNodeSettings.getAsMap().entrySet()) {
|
||||||
params.add("-Des." + entry.getKey() + "=" + entry.getValue());
|
params.add("-E" + entry.getKey() + "=" + entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
params.add("-Des.path.home=" + PathUtils.get(".").toAbsolutePath());
|
params.add("-Epath.home=" + PathUtils.get(".").toAbsolutePath());
|
||||||
params.add("-Des.path.conf=" + path + "/config");
|
params.add("-Epath.conf=" + path + "/config");
|
||||||
|
|
||||||
ProcessBuilder builder = new ProcessBuilder(params);
|
ProcessBuilder builder = new ProcessBuilder(params);
|
||||||
builder.directory(path.toFile());
|
builder.directory(path.toFile());
|
||||||
|
|
Loading…
Reference in New Issue