# Enable/disable Shield in Node Client

**URL:** <https://discuss.elastic.co/t/enable-disable-shield-in-node-client/23434>\
**Category:** Elasticsearch\
**Created:** [April 28, 2015, 11:27am UTC](https://discuss.elastic.co/t/enable-disable-shield-in-node-client/23434 "2015-04-28T11:27:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_7](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@Tom\_7](https://discuss.elastic.co/u/Tom_7)\
**Post date:** [April 28, 2015, 11:27am UTC](https://discuss.elastic.co/t/enable-disable-shield-in-node-client/23434/1 "2015-04-28T11:27:51Z")

</div>

Hello all,

I am coding a Java application that will connect to various Elasticseach  
instances, some of them are secured by Shield, some are unsecured. I need  
have a choice to connect via NodeClient (only not secured instances) or  
TransportClient (both secured and not secured instances). This requires me  
to have shield as Maven dependency in my project, but in a situation when I  
connect via NodeClient to a not secured instance, Shield comes in a way and  
complains about the lack of license plugin. I would like to  
disable/bypass/not use Shield plugin in such a scenario - is there a  
property I can set?

Example code:

```
        final Node node = 

```

nodeBuilder().clusterName(clusterName).client(true).node();  
client = node.client();

I can connect via this code to a not secured instance, but in a moment I  
add Shield as a Maven dependency, it starts to complain about the license.

I found a similar thread on StackOverflow, but there is no response there:

> <https://stackoverflow.com/questions/29744120/disabling-shield-for-intergration-tests>

Thank you in advance for advice.

Tom

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3941330e-9e85-49a0-b95f-cf7fe5c51a4e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3941330e-9e85-49a0-b95f-cf7fe5c51a4e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [April 28, 2015, 1:29pm UTC](https://discuss.elastic.co/t/enable-disable-shield-in-node-client/23434/2 "2015-04-28T13:29:14Z")

</div>

Hi Tom,

For the nodes that you don't want to use Shield with, you should be able to  
add the following to your node creation line:

```
.settings(ImmutableSettings.builder().put("shield.enabled", false))

```

-Jay

On Tuesday, April 28, 2015 at 7:27:51 AM UTC-4, Tom wrote:

> Hello all,
> 
> I am coding a Java application that will connect to various Elasticseach  
> instances, some of them are secured by Shield, some are unsecured. I need  
> have a choice to connect via NodeClient (only not secured instances) or  
> TransportClient (both secured and not secured instances). This requires me  
> to have shield as Maven dependency in my project, but in a situation when I  
> connect via NodeClient to a not secured instance, Shield comes in a way and  
> complains about the lack of license plugin. I would like to  
> disable/bypass/not use Shield plugin in such a scenario - is there a  
> property I can set?
> 
> Example code:
> 
> ```
> final Node node = 
> 
> ```
> 
> nodeBuilder().clusterName(clusterName).client(true).node();  
> client = node.client();
> 
> I can connect via this code to a not secured instance, but in a moment I  
> add Shield as a Maven dependency, it starts to complain about the license.
> 
> I found a similar thread on StackOverflow, but there is no response there:  
> [java - Disabling shield for intergration tests - Stack Overflow](http://stackoverflow.com/questions/29744120/disabling-shield-for-intergration-tests)
> 
> Thank you in advance for advice.
> 
> Tom

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/593abe50-08f0-40b3-bacf-27beec15b6e6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/593abe50-08f0-40b3-bacf-27beec15b6e6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Tom\_7](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@Tom\_7](https://discuss.elastic.co/u/Tom_7)\
**Post date:** [April 28, 2015, 2:25pm UTC](https://discuss.elastic.co/t/enable-disable-shield-in-node-client/23434/3 "2015-04-28T14:25:49Z")

</div>

Thank you, Jay. It actually worked for me, I should have checked the  
solution from the SO thread despite authors negative claims. 🙂

On Tuesday, 28 April 2015 15:29:14 UTC+2, Jay Modi wrote:

> Hi Tom,
> 
> For the nodes that you don't want to use Shield with, you should be able  
> to add the following to your node creation line:
> 
> ```
> .settings(ImmutableSettings.builder().put("shield.enabled", false))
> 
> ```
> 
> -Jay
> 
> On Tuesday, April 28, 2015 at 7:27:51 AM UTC-4, Tom wrote:
> 
> > Hello all,
> > 
> > I am coding a Java application that will connect to various Elasticseach  
> > instances, some of them are secured by Shield, some are unsecured. I need  
> > have a choice to connect via NodeClient (only not secured instances) or  
> > TransportClient (both secured and not secured instances). This requires me  
> > to have shield as Maven dependency in my project, but in a situation when I  
> > connect via NodeClient to a not secured instance, Shield comes in a way and  
> > complains about the lack of license plugin. I would like to  
> > disable/bypass/not use Shield plugin in such a scenario - is there a  
> > property I can set?
> > 
> > Example code:
> > 
> > ```
> > final Node node = 
> > 
> > ```
> > 
> > nodeBuilder().clusterName(clusterName).client(true).node();  
> > client = node.client();
> > 
> > I can connect via this code to a not secured instance, but in a moment I  
> > add Shield as a Maven dependency, it starts to complain about the license.
> > 
> > I found a similar thread on StackOverflow, but there is no response  
> > there:  
> > [java - Disabling shield for intergration tests - Stack Overflow](http://stackoverflow.com/questions/29744120/disabling-shield-for-intergration-tests)
> > 
> > Thank you in advance for advice.
> > 
> > Tom

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ce3ff310-f9c1-4e27-b28b-5ce6da07d54a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ce3ff310-f9c1-4e27-b28b-5ce6da07d54a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:17am UTC](https://discuss.elastic.co/t/enable-disable-shield-in-node-client/23434/4 "2017-07-06T00:17:23Z")

</div>


