# SSL question in Cluster configuration

**URL:** <https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922>\
**Category:** Percona XtraDB Cluster\
**Created:** [June 17, 2021, 4:47pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922 "2021-06-17T16:47:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 17, 2021, 4:47pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/1 "2021-06-17T16:47:12Z")

</div>

Configured a cluster but my second added node fails to start due to what appears to be an SSL issue.

According to the install guide.

“Set up the traffic encryption settings. Each node of the cluster must use the same SSL certificates.”

- Do I need to copy the server certs to each node? They appear to be different between them.

I assume I need to add this to the .cnf file?  
[mysqld]  
wsrep\_provider\_options=”socket.ssl\_key=server-key.pem;socket.ssl\_cert=server-cert.  
˓→pem;socket.ssl\_ca=ca.pem”

and this as well,?

[sst]  
encrypt=4  
ssl-key=server-key.pem  
ssl-ca=ca.pem  
ssl-cert=server-cert.pem

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 17, 2021, 5:19pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/2 "2021-06-17T17:19:56Z")

</div>

Hello @Mikem,  
Yes, you need to copy the SSL certificates created from your bootstrap node to the other nodes. Assuming this is PXC8, you do not need to add any SSL configuration parameters to my.cnf as MySQL will look for these automatically if installed in the $DATADIR. SSL is enabled by default in PXC8.

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 17, 2021, 6:36pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/3 "2021-06-17T18:36:41Z")

</div>

That worked and node3 is in synch. No errors on node2 but it is not synching with changes in the Master(Node 1). Do I need to do another bootstrap on Node 1? No real errors in the logs for Node2.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 17, 2021, 6:54pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/4 "2021-06-17T18:54:26Z")

</div>

What do you mean “not syncing with changes in node1” (btw, PXC has no concept of ‘master’) Is node2 connected to the cluster?

Bootstrapping is a process which starts a brand new cluster. You do this only on the very first node you start and will never do this again unless you completely stop all nodes.

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 17, 2021, 6:58pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/5 "2021-06-17T18:58:10Z")

</div>

I found the issue, I had somehow missed updating the my.cnf file after I got the correct path situated. It looks like all three nodes are synched now. Thanks for all your help.

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 18, 2021, 12:45pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/6 "2021-06-18T12:45:59Z")

</div>

I think I lost my bootstrap node. Can I just reboot it? Where can I find root cause?

mysql\> select count(\*) from user;  
ERROR 1047 (08S01): WSREP has not yet prepared node for application use

root@iaddb01:~# cat /var/lib/mysql/grastate.dat

# GALERA saved state

version: 2.1  
uuid: 00000000-0000-0000-0000-000000000000  
seqno: -1  
safe\_to\_bootstrap: 0

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 18, 2021, 2:36pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/7 "2021-06-18T14:36:19Z")

</div>

If your other two nodes are online yes, `systemctl stop mysql@bootstrap` but make sure you restart it normally `systemctl start mysql` otherwise, if you bootstrap it, you will create a NEW, SEPARATE, CLUSTER, which you don’t want. You want this node to join the others in the already established cluster.

Find the cause? Look in mysql’s error log.

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 18, 2021, 3:38pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/8 "2021-06-18T15:38:10Z")

</div>

I stopped bootstrap service and restarted. No luck. I cleared /var/lib/mysql , still the same. Seeing this in the log.

2021-06-18T15:09:23.732444Z 0 [Warning] [MY-000000] [Galera] 1.0 (iad\_db03): State transfer to 0.0 (iad\_db01) failed: -125 (Operation canceled)  
2021-06-18T15:09:23.733362Z 0 [ERROR] [MY-000000] [Galera] gcs/src/gcs\_group.cpp:gcs\_group\_handle\_join\_msg():1214: Will never receive state. Need to abort.  
2021-06-18T15:09:23.733388Z 0 [Note] [MY-000000] [Galera] gcomm: terminating thread

iad\_db01 is the failed node. iad\_db03 is one of the other two nodes working ok. not sure what error-125 means.

I tried stopping and starting the other nodes as I found an error in the my.cnf but now nothing will start.

This is node 2:

2021-06-18T15:33:08.426070Z 0 [ERROR] [MY-000000] [Galera] gcs/src/gcs.cpp:gcs\_open():1758: Failed to open channel ‘iad-cluster’ at ‘gcomm://45.56.115.5,45.33.103.216,45.79.213.218’: -110 (Connection timed out)  
2021-06-18T15:33:08.426100Z 0 [ERROR] [MY-000000] [Galera] gcs connect failed: Connection timed out  
2021-06-18T15:33:08.426123Z 0 [ERROR] [MY-000000] [WSREP] Provider/Node (gcomm://45.56.115.5,45.33.103.216,45.79.213.218) failed to establish connection with cluster (reason: 7)  
2021-06-18T15:33:08.426160Z 0 [ERROR] [MY-010119] [Server] Aborting

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 18, 2021, 4:05pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/9 "2021-06-18T16:05:31Z")

</div>

I see “Connection timed out”. You confirm that node2 and node3 are online and connected to each other and that the cluster is in Primary state?

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 18, 2021, 4:55pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/10 "2021-06-18T16:55:24Z")

</div>

I cleared everything and created a new cluster. All is good now. Thanks.

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 18, 2021, 4:57pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/11 "2021-06-18T16:57:58Z")

</div>

Do I need to stop the bootstrap service and start the mysql service at this point?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 18, 2021, 6:42pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/12 "2021-06-18T18:42:18Z")

</div>

No you don’t. Again, bootstrap is just a notion for starting a new cluster. It is not a “state” that a node is in. It simply means “you are the first; don’t look for others to join”

---

<div class="post-metadata">

**Author:** ![Naveen](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@Naveen](https://forums.percona.com/u/Naveen)\
**Post date:** [June 22, 2021, 1:55pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/13 "2021-06-22T13:55:17Z")

</div>

hii @matthewb can u xpln how to move ssl certificates which are generated on bootstraped node to other nodes.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 22, 2021, 4:09pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/14 "2021-06-22T16:09:16Z")

</div>

Hi Naveen, use scp to copy the files to other nodes.

---

<div class="post-metadata">

**Author:** ![Naveen](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@Naveen](https://forums.percona.com/u/Naveen)\
**Post date:** [June 24, 2021, 12:03pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/15 "2021-06-24T12:03:17Z")

</div>

hii @matthewb ,i copied the certificates from bootstraped node to other node and edited my.cnf file on node 2 and given the certificates location.And i started the node 2.Iam getting the below error

 ![ssl1](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/b/bd869493e519eb422121d6fd617a47d40b602ac8.jpeg)

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 24, 2021, 1:56pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/16 "2021-06-24T13:56:40Z")

</div>

Check permissions of the key files. Make sure the paths are correct and you’ve properly configured the paths in my.cnf

---

<div class="post-metadata">

**Author:** ![Naveen](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@Naveen](https://forums.percona.com/u/Naveen)\
**Post date:** [June 27, 2021, 11:16am UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/17 "2021-06-27T11:16:14Z")

</div>

hii @matthewb .i enabled encryption on all nodes.  
 ![enc](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/9/969451e8590d517d9e250785012768b2696f042e.png)  
But when i try to connect to mysql server from any remote machine ,iam able to connect to it without any ssl certificates.Can u explain how can i connect to mysql server only with ssl certificates.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 27, 2021, 1:36pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/18 "2021-06-27T13:36:51Z")

</div>

@Naveen,  
The SSL certificates you copied are for node-\>node communications. If you want to enforce client-\>node SSL, you need to copy the client.\* SSL certs from the node to the client and load the certs. If you want to force SSL, you need to ALTER USER … REQUIRE SSL;

---

<div class="post-metadata">

**Author:** ![Naveen](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@Naveen](https://forums.percona.com/u/Naveen)\
**Post date:** [June 27, 2021, 2:12pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/19 "2021-06-27T14:12:30Z")

</div>

@matthewb i created a user and altered the user as u said.  
 ![enc1](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/c/c0b5577413340abd3ab298bc380329306583d811.png)  
And from other remote machine i tried connecting to mysql server without ssl.

 ![enc2.2](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/5/5842152f4458cea5e08335a5d14ca6028fa81b17.jpeg)  
Can u identify what mistake iam doing.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 28, 2021, 4:53pm UTC](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922/20 "2021-06-28T16:53:09Z")

</div>

Did you confirm that the connection was not SSL? You need to run `\s` to see if it is not ssl.

[Next page](https://forums.percona.com/t/ssl-question-in-cluster-configuration/10922.md?page=2)
