Skip to content

Commit

Permalink
Node specific data path
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <tsfarr@amazon.com>
  • Loading branch information
Xtansia committed Aug 16, 2024
1 parent 29de203 commit e0201ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ public ClusterConfiguration(OpenSearchVersion version, Func<OpenSearchVersion, s
NumberOfNodes = numberOfNodes;

var fs = FileSystem;
Add("node.max_local_storage_nodes", numberOfNodes.ToString(CultureInfo.InvariantCulture), "1.0.0");

Add("cluster.name", clusterName);
Add("path.repo", fs.RepositoryPath);
Add("path.data", fs.DataPath);
var logsPathDefault = Path.Combine(fs.OpenSearchHome, "logs");
if (logsPathDefault != fs.LogsPath) Add("path.logs", fs.LogsPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

using System;
using System.Globalization;
using System.IO;
using OpenSearch.OpenSearch.Managed.FileSystem;
using OpenSearch.Stack.ArtifactsApi;
using ProcNet;
Expand All @@ -49,9 +50,12 @@ public NodeConfiguration(IClusterConfiguration<NodeFileSystem> clusterConfigurat
ClusterConfiguration = clusterConfiguration;
DesiredPort = port;
DesiredNodeName = CreateNodeName(port, nodePrefix) ?? clusterConfiguration.CreateNodeName(port);
Settings = new NodeSettings(clusterConfiguration.DefaultNodeSettings);
Settings = new NodeSettings(clusterConfiguration.DefaultNodeSettings)
{
{ "path.data", Path.Combine(ClusterConfiguration.FileSystem.DataPath, DesiredNodeName) }
};

if (!string.IsNullOrWhiteSpace(DesiredNodeName)) Settings.Add("node.name", DesiredNodeName);
if (!string.IsNullOrWhiteSpace(DesiredNodeName)) Settings.Add("node.name", DesiredNodeName);
if (DesiredPort is { } desiredPort)
{
Settings.Add("http.port", desiredPort.ToString(CultureInfo.InvariantCulture));
Expand Down

0 comments on commit e0201ff

Please sign in to comment.