Disabling automatic NATS configuration
BrokerGateway-managed NATS
Important
Automatic NATS configuration must either be consistently enabled in the entire cluster or disabled in the entire cluster. You cannot have part of the cluster rely on automatic NATS configuration and the other part on manual configuration.
Caution
If you disable automatic NATS configuration, this means you become responsible for maintaining the configuration of the appsettings.runtime.json and C:\Program Files\Skyline Communications\DataMiner BrokerGateway\nats-server\nats-server.config files, and you will need to ensure the synchronization of the credentials in the system.
Starting from DataMiner 10.5.0 [CU1]/10.5.4, it is possible to apply a manual NATS configuration when required. This is intended for scenarios where specific system characteristics, like high latency between nodes or geographically dispersed DataMiner Agents, necessitate a custom NATS layout.
Setting up BrokerGateway with a custom manual config will allow you to create superclusters and/or leaf nodes:
A cluster consists of all the nodes that are closely related by location. They should have low latency and high bandwidth between each other.
A supercluster is a collection of different clusters that can communicate with each other. It consists of two or more clusters. Clusters communicate with other clusters using gateway connections (port 7222). Each cluster consists of two or more nodes. These nodes communicate with each other using cluster connections (port 6222).
A leaf node is a node that is related to a specific cluster, but has a higher latency and/or lower bandwidth to the nodes of the actual cluster. Optionally, a cluster can have one or more leaf nodes attached to it. A leaf node communicates with the rest of the cluster using a specific leaf node connection (port 7422).
Setting up a manual config
From one single DMA, apply a custom config by sending a POST request to https://[ip]/BrokerGateway/api/clusteringapi/applymanualconfig using a request body that contains the full cluster config.
See Manual config example for an example request body and BrokerGateway API keys for the required node credentials.
Altering an existing manual config setup
On a single DMA of the DMS, open
C:\Program Files\Skyline Communications\DataMiner BrokerGateway\appsettings.custom.json.Copy the contents of the
ClusterArchitecturefield (i.e., excluding theClusterArchitecturefield).Add or remove the relevant node entry in the appropriate region's
nodesarray, using the structure shown in Manual config example.When adding a node, specify its endpoint and BrokerGateway API key.
From one single DMA, apply a custom config by sending a POST request to
https://[ip]/BrokerGateway/api/clusteringapi/applymanualconfigusing the request body generated in the previous steps.
Manual config example
The following example shows a supercluster consisting of two clusters with leaf nodes:
{
"regions": [
{
"name": "Cluster1",
"nodes": [
{
"endpoint": "DMA1",
"bgw_api_key": "BGW_API_KEY_1",
"is_leaf": false,
"should_run_nats_node": true,
"additional_endpoints": []
},
{
"endpoint": "DMA2",
"bgw_api_key": "BGW_API_KEY_2",
"is_leaf": false,
"should_run_nats_node": true,
"additional_endpoints": []
},
{
"endpoint": "DMA3",
"bgw_api_key": "BGW_API_KEY_3",
"is_leaf": false,
"should_run_nats_node": true,
"additional_endpoints": []
},
{
"endpoint": "LeafNode1",
"bgw_api_key": "LeafNode_BGW_API_KEY_1",
"is_leaf": true,
"should_run_nats_node": true,
"additional_endpoints": []
},
{
"endpoint": "LeafNode2",
"bgw_api_key": "LeafNode_BGW_API_KEY_2",
"is_leaf": true,
"should_run_nats_node": true,
"additional_endpoints": []
}
]
},
{
"name": "Cluster2",
"nodes": [
{
"endpoint": "DMA4",
"bgw_api_key": "BGW_API_KEY_4",
"is_leaf": false,
"should_run_nats_node": true,
"additional_endpoints": []
},
{
"endpoint": "DMA5",
"bgw_api_key": "BGW_API_KEY_5",
"is_leaf": false,
"should_run_nats_node": true,
"additional_endpoints": []
},
{
"endpoint": "DMA6",
"bgw_api_key": "BGW_API_KEY_6",
"is_leaf": false,
"should_run_nats_node": true,
"additional_endpoints": []
},
{
"endpoint": "LeafNode3",
"bgw_api_key": "LeafNode_BGW_API_KEY_3",
"is_leaf": true,
"should_run_nats_node": true,
"additional_endpoints": []
}
]
}
]
}
The additional_endpoints property allows you to specify extra endpoints that BrokerGateway must include when generating NATS certificates. This is required when adding nodes that are part of a Failover pair; in such cases, the Failover VIP or shared hostname should be listed here.
The should_run_nats_node property is currently non-functional but may be used in future releases.
BrokerGateway API keys
Each node requires the bgw_api_key of that BrokerGateway node. You can find this on that server in C:\Program Files\Skyline Communications\DataMiner BrokerGateway\appsettings.runtime.json. Use the API key with the role "BrokerGateway" on the specific node.
Deconstructing the manual config
Look up the BrokerGateway API key in
C:\Program Files\Skyline Communications\DataMiner BrokerGateway\appsettings.runtime.json.You will need to use this Administrator key in the BrokerGateway-Api-Key HTTP header of the request mentioned below.
Disable manual configuration by sending a POST request to
https://[ip]/BrokerGateway/api/clusteringapi/setmanualconfigflagwith the following request body:{ "distribute_in_cluster": true, "has_manual_config": false }Run NATSRepair.exe to reset your NATS cluster to the default state.
Legacy SLNet-managed NAS/NATS
From DataMiner 10.2.0 [CU6]/10.2.8 onwards, you can enable the NATSForceManualConfig option so that NATS is not automatically configured in your DataMiner System. When you do so, you will need to configure a NATS cluster manually. There are two distinct methods to enable NATSForceManualConfig:
- For all DMAs in the cluster via SLNetClientTestTool (recommended).
- For one DMA at a time by changing MaintenanceSettings.xml.
Important
Automatic NATS configuration must either be consistently enabled in the entire cluster or disabled in the entire cluster. You cannot have part of the cluster rely on automatic NATS configuration and the other part on manual configuration.
Caution
If you disable automatic NATS configuration, this means you become responsible for maintaining the configuration of the SLCloud.xml, nas.config, and nats-server.config files as well as ensuring the synchronization of the credentials in the system. From DataMiner 10.3.11/10.3.0 [CU8] onwards, when DataMiner makes changes to any of these files, the old version of that file is saved in the C:\Skyline DataMiner\Recycle Binfolder.
Note
Changes to the NATSForceManualConfig option are included in a DataMiner backup to make sure that the automatic NATS configuration status remains consistent after a backup is restored. From DataMiner 10.4.11/10.5.0 onwards, any changes made to the nats-server.config file after disabling automatic NATS configuration will also be included in DataMiner backups. Prior to this, you need to manually back up the nats-server.config file, located in the C:\Skyline DataMiner\NATS\nats-streaming-server\ folder. See nats-server.config file not included in DataMiner backups.
Disabling automatic NATS configuration via SLNetClientTestTool
To disable automatic NATS configuration for the entire cluster in one go when legacy SLNet-managed NAS/NATS is used:
Go to Advanced > Options > SLNet Options.
In the dropdown box, select NATSForceManualConfig.
Configure the option as follows for each DMA in the cluster:
Right-click the DMA and select Edit value.
Specify true and click OK.
Click OK to close the SLNet Options window.
The entire cluster should now be configured, except for offline Failover Agents. In case you are configuring a DMS with Failover, also configure the offline Agents one by one by changing MaintenanceSettings.xml
Warning
Always be extremely careful when using the SLNetClientTest tool, as it can have far-reaching consequences on the functionality of your DataMiner System.
Disabling automatic NATS configuration via MaintenanceSettings.xml
If legacy SLNet-managed NAS/NATS is used, you can disable the automatic NATS configuration for one Agent at a time (or on offline Agents of a Failover pair) as follows:
Stop the DataMiner Agent in question.
Navigate to
C:\Skyline DataMiner\MaintenanceSettings.xmland add the NATSForceManualConfig tag within the SLNet tag.Create the SLNet tag if it does not exist yet.
<SLNet> <NATSForceManualConfig>true</NATSForceManualConfig> </SLNet>Start DataMiner.
Repeat this process for every Agent in the cluster (or every offline Failover Agent in the DMS in case you have already disabled automatic NATS configuration for the other Agents using SLNetClientTestTool).