# Node not able to join the cluster after enabling x-pack in elastic v6.5

**URL:** <https://discuss.elastic.co/t/node-not-able-to-join-the-cluster-after-enabling-x-pack-in-elastic-v6-5/160031>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [December 9, 2018, 7:04am UTC](https://discuss.elastic.co/t/node-not-able-to-join-the-cluster-after-enabling-x-pack-in-elastic-v6-5/160031 "2018-12-09T07:04:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamedabdoun](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@mohamedabdoun](https://discuss.elastic.co/u/mohamedabdoun)\
**Post date:** [December 9, 2018, 7:04am UTC](https://discuss.elastic.co/t/node-not-able-to-join-the-cluster-after-enabling-x-pack-in-elastic-v6-5/160031/1 "2018-12-09T07:04:19Z")

</div>

I’m trying to build elasticsearch 6.5 cluster , mcluster consists of 3 nodes , I managed to installed the cluster without x-pack successfully and all 3 nodes appears in \_cat API. However, when I configured x-pack only 2 nodes at a time can join the cluster successfully, for example [either 1& 2; 2 ,2& 3; 3 or 1&3] the first two will join normally the last node wont.

After couple of retries the last node will not be rejected from the cluster with below exceptions:

```
       [2018-12-09T06:33:45,622][INFO][o.e.c.s.ClusterApplierService] [master] added {{node-02}{HOKSU6z1RVaXx7WS_VWpmA}{4Chz9jZISZOz0_AluwBexA}{172.31.35.173}{172.31.35.173:9300}{ml.machine_memory=1926344704, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true, zone=2},}, reason: apply cluster state (from master [master {node-01}{EdOKMIeHQ_KSCc3yXTIk6Q}{JM3rOVNHR0u6cYf4_LOAmw}{172.31.16.192}{172.31.16.192:9300}{ml.machine_memory=1926344704, rack=2, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true} committed version [473]])
    =[2018-12-09T06:33:45,662][WARN][o.e.c.NodeConnectionsService] [master] failed to connect to node {node-02}{HOKSU6z1RVaXx7WS_VWpmA}{4Chz9jZISZOz0_AluwBexA}{172.31.35.173}{172.31.35.173:9300}{ml.machine_memory=1926344704, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true, zone=2} (tried [1] times)
    org.elasticsearch.transport.ConnectTransportException: [node-02][172.31.35.173:9300] general node connection failure
            at org.elasticsearch.transport.ConnectionManager.connectToNode(ConnectionManager.java:142) ~[elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:369) ~[elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:356) ~[elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.cluster.NodeConnectionsService.validateAndConnectIfNeeded(NodeConnectionsService.java:153) [elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.cluster.NodeConnectionsService$1.doRun(NodeConnectionsService.java:106) [elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:723) [elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.5.0.jar:6.5.0]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_191]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_191]
            at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
    Caused by: java.lang.IllegalStateException: handshake failed with {node-02}{HOKSU6z1RVaXx7WS_VWpmA}{4Chz9jZISZOz0_AluwBexA}{172.31.35.173}{172.31.35.173:9300}{ml.machine_memory=1926344704, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true, zone=2}
            at org.elasticsearch.transport.TransportService.handshake(TransportService.java:444) ~[elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.transport.TransportService.lambda$connectionValidator$4(TransportService.java:375) ~[elasticsearch-6.5.0.jar:6.5.0]
            at org.elasticsearch.transport.ConnectionManager.connectToNode(ConnectionManager.java:120) ~[elasticsearch-6.5.0.jar:6.5.0]
            ... 9 more
    Caused by: org.elasticsearch.transport.RemoteTransportException: [node-02][172.31.35.173:9300][internal:transport/handshake]
    Caused by: org.elasticsearch.ElasticsearchSecurityException: missing authentication token for action [internal:transport/handshake]
            at org.elasticsearch.xpack.core.security.support.Exceptions.authenticationError(Exceptions.java:18) ~[?:?]
            at
org.elasticsearch.xpack.core.security.authc.DefaultAuthenticationFailureHandler.createAuthenticationError(DefaultAuthenticationFailureHandler.java:161) ~[?:?]
        at org.elasticsearch.xpack.core.security.authc.DefaultAuthenticationFailureHandler.missingToken(DefaultAuthenticationFailureHandler.java:116) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$AuditableTransportRequest.anonymousAccessDenied(AuthenticationService.java:517) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$handleNullToken$17(AuthenticationService.java:342) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.handleNullToken(AuthenticationService.java:347) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.consumeToken(AuthenticationService.java:259) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$extractToken$7(AuthenticationService.java:230) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.extractToken(AuthenticationService.java:248) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$authenticateAsync$0(AuthenticationService.java:182) ~[?:?]
        at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:60) ~[elasticsearch-6.5.0.jar:6.5.0]
        at org.elasticsearch.xpack.security.authc.TokenService.getAndValidateToken(TokenService.java:310) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$authenticateAsync$2(AuthenticationService.java:178) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$lookForExistingAuthentication$4(AuthenticationService.java:209) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lookForExistingAuthentication(AuthenticationService.java:220) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.authenticateAsync(AuthenticationService.java:174) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.access$000(AuthenticationService.java:134) ~[?:?]
        at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:104) ~[?:?]
        at org.elasticsearch.xpack.security.transport.ServerTransportFilter$NodeProfile.inbound(ServerTransportFilter.java:130) ~[?:?]
        at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:307) ~[?:?]
```

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [December 9, 2018, 10:30am UTC](https://discuss.elastic.co/t/node-not-able-to-join-the-cluster-after-enabling-x-pack-in-elastic-v6-5/160031/2 "2018-12-09T10:30:57Z")

</div>

Please don't post unformatted logs as they're very hard to read.

Instead paste the text and format it with \</\> icon, and check the preview  
window to make sure it's properly formatted before posting it. This makes it  
more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [December 10, 2018, 5:22am UTC](https://discuss.elastic.co/t/node-not-able-to-join-the-cluster-after-enabling-x-pack-in-elastic-v6-5/160031/3 "2018-12-10T05:22:08Z")

</div>

Assuming you want to apply security to your cluster, then you should add

```auto
xpack.security.enabled: true
xpack.license.self_generated.type: trial

```

to your `elasticsearch.yml`

It looks like you're running into an issue where you have a mismatch where some nodes think security is enabled and some don't. The settings above should force all nodes to have the same configuration.

---

<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:** [January 7, 2019, 5:22am UTC](https://discuss.elastic.co/t/node-not-able-to-join-the-cluster-after-enabling-x-pack-in-elastic-v6-5/160031/4 "2019-01-07T05:22:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
