Hi everyone.
I have a 3-node cluster set up on Ubuntu 18.04 LTS (Bionic Beaver) with PXC 5.7 and bundled MySQL 5.7: version: 5.7.27-30-57-log
version_comment: Percona XtraDB Cluster (GPL), Release rel30, Revision 64987d4, WSREP version 31.39, wsrep_31.39
It worked just fine until I wanted to test automatic keyring_file donation. The features I had enabled beforehand are:
[LIST]
[]PXC automatic SSL communication channel (pxc_encrypted_cluster_traffic=1) on every node,
[]basic xtrabackup SST, with identical sst user on each node,
[*]my nodes have non-conflicting names, etc.
[/LIST] I shut down all of the nodes, checked /var/lib.mysql/grastate.dat to find the node that was safe to bootstrap and on this one node, I added the below configuration to /etc/mysql/my.cnf under:
[mysqld]
pxc_encrypted_cluster_traffic=1
early-plugin-load=/usr/lib/mysql/plugin/keyring_file.so
keyring_file_data=/var/lib/mysql-keyring/keyring
I bootstrapped it and logged into MySQL as root on all nodes. The keyring_plugin plugin on was loaded on the bootstrapped node only, keyring_datafile variable was correct there and I could create a table with enabled encryption with the query:
CREATE TABLE demo.enctab (id INT PRIMARY KEY, nick VARCHAR(20) NOT NULL) ENCRYPTION='Y';
The table was then succesfully created. I checked if it was visible on the other 2 nodes - it wasn’t. Neither was there any keyring_file configuration enabled on them, despite what the user guide states: “If user has bootstrapped node with keyring enabled, then upcoming nodes of the cluster (…) will generate it (starting from Percona XtraDB Cluster 5.7.22).”
I had also read that “Actual keyring is generated only when node starts using encrypted tablespace.” So I tried to insert a row into said table on the first node:
INSERT INTO demo.enctab(nick) VALUES (‘ABC’);
MySQL refused to accept the transaction. The other 2 nodes shut down and the bootstrapped one transitioned into non-primary state, so I tried to recover the cluster in MySQL as PXC User Guide suggests:
SET GLOBAL wsrep_provider_options='pc.bootstrap=true';
It worked for the first node but the other 2 still couldn’t connect to the cluster, so I checked for .pids and .sock.locks in /var/run/mysqld/ - there was a sock lock present on both crashed nodes - I removed it. That didn’t help. I added
early-plugin-load=/usr/lib/mysql/plugin/keyring_file.so
keyring_file_data=/var/lib/mysql-keyring/keyring
to their my.cnf files - didn’t help. Now I don’t know what to do. Any help would be appreciateed.