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:
Jason Tedor 2016-05-23 14:47:22 -04:00
parent 62ac719a94
commit f63d1255d1
2 changed files with 12 additions and 12 deletions

View File

@ -137,13 +137,13 @@ def start_node(version, release_dir, data_dir, repo_dir, tcp_port=DEFAULT_TRANSP
cmd = [
os.path.join(release_dir, 'bin/elasticsearch'),
'-Des.path.data=%s' % data_dir,
'-Des.path.logs=logs',
'-Des.cluster.name=%s' % cluster_name,
'-Des.network.host=localhost',
'-Des.transport.tcp.port=%s' % tcp_port,
'-Des.http.port=%s' % http_port,
'-Des.path.repo=%s' % repo_dir
'-Epath.data=%s' % data_dir,
'-Epath.logs=logs',
'-Ecluster.name=%s' % cluster_name,
'-Enetwork.host=localhost',
'-Etransport.tcp.port=%s' % tcp_port,
'-Ehttp.port=%s' % http_port,
'-Epath.repo=%s' % repo_dir
]
if version.startswith('0.') or version.startswith('1.0.0.Beta') :
cmd.append('-f') # version before 1.0 start in background automatically

View File

@ -99,8 +99,8 @@ final class ExternalNode implements Closeable {
} else {
params.add("bin/elasticsearch.bat");
}
params.add("-Des.cluster.name=" + clusterName);
params.add("-Des.node.name=" + nodeName);
params.add("-Ecluster.name=" + clusterName);
params.add("-Enode.name=" + nodeName);
Settings.Builder externaNodeSettingsBuilder = Settings.builder();
for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) {
switch (entry.getKey()) {
@ -121,11 +121,11 @@ final class ExternalNode implements Closeable {
}
this.externalNodeSettings = externaNodeSettingsBuilder.put(REQUIRED_SETTINGS).build();
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("-Des.path.conf=" + path + "/config");
params.add("-Epath.home=" + PathUtils.get(".").toAbsolutePath());
params.add("-Epath.conf=" + path + "/config");
ProcessBuilder builder = new ProcessBuilder(params);
builder.directory(path.toFile());