diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java index 4c0ec6a1d2e..aedc3142989 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java @@ -160,6 +160,8 @@ public class MachineLearning extends Plugin implements ActionPlugin { private final Environment env; private boolean enabled; private boolean transportClientMode; + private final boolean tribeNode; + private final boolean tribeNodeClient; public MachineLearning(Settings settings) { this(settings, new Environment(settings)); @@ -170,6 +172,8 @@ public class MachineLearning extends Plugin implements ActionPlugin { this.settings = settings; this.env = env; this.transportClientMode = XPackPlugin.transportClientMode(settings); + this.tribeNode = XPackPlugin.isTribeNode(settings); + this.tribeNodeClient = XPackPlugin.isTribeClientNode(settings); } @Override @@ -187,7 +191,7 @@ public class MachineLearning extends Plugin implements ActionPlugin { @Override public Settings additionalSettings() { - if (enabled == false || this.transportClientMode) { + if (enabled == false || this.transportClientMode || this.tribeNode || this.tribeNodeClient) { return super.additionalSettings(); } @@ -248,7 +252,7 @@ public class MachineLearning extends Plugin implements ActionPlugin { public Collection createComponents(Client client, ClusterService clusterService, ThreadPool threadPool, ResourceWatcherService resourceWatcherService, ScriptService scriptService, NamedXContentRegistry xContentRegistry) { - if (this.transportClientMode) { + if (this.transportClientMode || this.tribeNodeClient) { return emptyList(); } @@ -257,7 +261,7 @@ public class MachineLearning extends Plugin implements ActionPlugin { // Even when ML is disabled the native controller will be running if it's installed, and it // prevents graceful shutdown on Windows unless we tell it to stop. Hence when disabled we // still return a lifecycle service that will tell the native controller to stop. - if (false == enabled) { + if (false == enabled || this.tribeNode) { return Collections.singletonList(mlLifeCycleService); } @@ -330,7 +334,7 @@ public class MachineLearning extends Plugin implements ActionPlugin { IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver, Supplier nodesInCluster) { - if (false == enabled) { + if (false == enabled || tribeNodeClient) { return emptyList(); } return Arrays.asList( @@ -415,7 +419,7 @@ public class MachineLearning extends Plugin implements ActionPlugin { @Override public List> getExecutorBuilders(Settings settings) { - if (false == enabled) { + if (false == enabled || tribeNode || tribeNodeClient) { return emptyList(); } int maxNumberOfJobs = AutodetectProcessManager.MAX_RUNNING_JOBS_PER_NODE.get(settings); diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java index 4711dd6ed33..9bda37db307 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java @@ -34,7 +34,7 @@ public class MachineLearningFeatureSet implements XPackFeatureSet { this.licenseState = licenseState; Map nativeCodeInfo = NativeController.UNKNOWN_NATIVE_CODE_INFO; // Don't try to get the native code version in the transport client - the controller process won't be running - if (XPackPlugin.transportClientMode(settings) == false) { + if (XPackPlugin.transportClientMode(settings) == false && XPackPlugin.isTribeClientNode(settings) == false) { try { NativeController nativeController = NativeControllerHolder.getNativeController(settings); if (nativeController != null) {