# How to configure a cluster with enable X-Pac(security)?

**URL:** <https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801>\
**Category:** Elasticsearch\
**Created:** [August 5, 2020, 2:32am UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801 "2020-08-05T02:32:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenriqueNogueira](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@HenriqueNogueira](https://discuss.elastic.co/u/HenriqueNogueira)\
**Post date:** [August 5, 2020, 2:32am UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/1 "2020-08-05T02:32:12Z")

</div>

I'm using version 7.8.1 with x-pac enabled and I can't get my second node to connect to my cluster, what should I do?

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 5, 2020, 4:14am UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/2 "2020-08-05T04:14:39Z")

</div>

Hi @HenriqueNogueira, please can you share

1. elasticsearch.yml configuration file for the first node
2. elasticsearch.yml configuration file for the second node
3. The error output seen when starting the second node

---

<div class="post-metadata">

**Author:** ![HenriqueNogueira](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@HenriqueNogueira](https://discuss.elastic.co/u/HenriqueNogueira)\
**Post date:** [August 5, 2020, 10:06am UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/3 "2020-08-05T10:06:34Z")

</div>

Hi, @forloop thanks for responding.

I generated certificates on the first node and set the elastic CA password, CRT AND KEY. But when I try to curl to test the cluster on the second node for example I can't connect with the password generated on the first node. I don't know what can be done wrong. Without the password settings it works perfectly.

These are my settings:

1. 

cluster.name: nogueira-teste  
node.name: node-1  
node.master: true  
node.data: true  
path.data: /var/lib/elasticsearch  
path.logs: /var/log/elasticsearch  
network.host: 0.0.0.0  
http.port: 9200  
discovery.seed\_hosts: ["172.31.53.70", "172.31.48.49"]  
cluster.initial\_master\_nodes: ["172.31.53.70"]  
xpack.security.enabled: true  
xpack.security.http.ssl.enabled: true  
xpack.security.transport.ssl.enabled: true  
xpack.security.http.ssl.key: node1.key  
xpack.security.http.ssl.certificate: node1.crt  
xpack.security.http.ssl.certificate\_authorities: ca.crt  
xpack.security.transport.ssl.key: node1.key  
xpack.security.transport.ssl.certificate: node1.crt  
xpack.security.transport.ssl.certificate\_authorities: ca.cr

1. 

cluster.name: nogueira-teste  
node.name: node-2  
node.master: true  
node.data: true  
path.data: /var/lib/elasticsearch  
path.logs: /var/log/elasticsearch  
network.host: 0.0.0.0  
http.port: 9200  
discovery.seed\_hosts: ["172.31.53.70", "172.31.48.49"]  
cluster.initial\_master\_nodes: ["172.31.53.70"]  
xpack.security.enabled: true  
xpack.security.http.ssl.enabled: true  
xpack.security.transport.ssl.enabled: true  
xpack.security.http.ssl.key: node2.key  
xpack.security.http.ssl.certificate: node2.crt  
xpack.security.http.ssl.certificate\_authorities: ca.crt  
xpack.security.transport.ssl.key: node2.key  
xpack.security.transport.ssl.certificate: node2.crt  
xpack.security.transport.ssl.certificate\_authorities: ca.cr

1. 

java.security.cert.CertificateException: No subject alternative names matching IP address

Thanks!

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 12:25pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/4 "2020-08-05T12:25:04Z")

</div>

> [@HenriqueNogueira](#):
>
> network.host: 0.0.0.0

Do you have really such IP 0.0.0.0 in configuration files?

---

<div class="post-metadata">

**Author:** ![HenriqueNogueira](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@HenriqueNogueira](https://discuss.elastic.co/u/HenriqueNogueira)\
**Post date:** [August 5, 2020, 1:07pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/5 "2020-08-05T13:07:44Z")

</div>

@d.silwon yes, it serves to connect a port on any ip of my server. Ex: 3.86.210.2:9200 or 127.0.0.1:9200 I cannot consult my main node all indexes and another server calling the public ip of the main node can also perform queries, ex: another machine other than the main one can connect the 3.86.210.2:9200 or the problem is in connecting a second node with X-Pac enabled.

I have no problems with the first node everything works normal.

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 2:29pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/6 "2020-08-05T14:29:57Z")

</div>

From my point of view network.host should include exact IP address of node, for example: "network.host: 192.168.1.100" and on the second node should be the IP address of second node, for example: "network.host: 192.168.1.101".

---

<div class="post-metadata">

**Author:** ![HenriqueNogueira](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@HenriqueNogueira](https://discuss.elastic.co/u/HenriqueNogueira)\
**Post date:** [August 5, 2020, 2:48pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/7 "2020-08-05T14:48:15Z")

</div>

@d.silwon I understand, I'll try, the error I pasted here do you think that's why?

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 3:04pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/8 "2020-08-05T15:04:47Z")

</div>

> [@HenriqueNogueira](#):
>
> I understand, I'll try, the error I pasted here do you think that's why

I don't know. Maybe I'm wrong but I think that you should try to do it according to the documentation and best practice.

---

<div class="post-metadata">

**Author:** ![HenriqueNogueira](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@HenriqueNogueira](https://discuss.elastic.co/u/HenriqueNogueira)\
**Post date:** [August 5, 2020, 5:41pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/9 "2020-08-05T17:41:46Z")

</div>

@d.silwon I found the problem, in fact the problem was time to create the certificates in my .yml file I was not passing the ips that could connect using the certificate I changed the file parameters as below and it worked. Thanks for the personal help!

instances:

- name: "node1"  
ip:
  - "10.171.1.184"

- name: "node2"  
ip:
  - "10.171.1.142"  
🙏

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 6:17pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/10 "2020-08-05T18:17:16Z")

</div>

Excelent 👍

---

<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:** [September 2, 2020, 6:17pm UTC](https://discuss.elastic.co/t/how-to-configure-a-cluster-with-enable-x-pac-security/243801/11 "2020-09-02T18:17:30Z")

</div>

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