[MDEV-17787] Unable to backup using mariabackup , if the MariaDB server is using AWS key management service plugin Created: 2018-11-21 Updated: 2019-02-17 Resolved: 2018-11-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | mariabackup, Plugin - AWS key management |
| Affects Version/s: | 10.3.11 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Akshaya Srinivasan | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | mariabackup | ||
| Environment: |
centos7 |
||
| Issue Links: |
|
||||||||
| Description |
|
Hi , My MariaDB server is configured to use AWS key management service encryption plugin. Since xtrabackup is not supported with MariaDB 10.3, I am using mariabackup to take the backup, but it fails with below error. However without encryption mariabackup goes fine. Please can you let me know if any additional options passed to mariabackup will resolve the issue? [root@mongotest2lin bin]# /usr/bin/mariabackup --defaults-file=/etc/my.cnf -p'mysql' --user=root --backup --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --parallel=4 --extra-lsndir="/clone" --databases "testenc" --stream=xbstream >/dev/null |
| Comments |
| Comment by Vladislav Vaintroub [ 2018-11-21 ] |
|
mariabackup process obviously needs to authenticate in AWS. If it uses the same credentials as the server process it would work |
| Comment by Akshaya Srinivasan [ 2018-11-21 ] |
|
Thanks Vladislav. After I exported below values backup succeeded. Is there a way I can pass the aws encryption key id too? here the id was 3 when I created the table. aws_access_key_id = XXXXXXXXXXXXXX MariaDB [test]> create table t1 (id serial, v varchar(32)) ENCRYPTION_KEY_ID=3; |
| Comment by Vladislav Vaintroub [ 2018-11-21 ] |
|
aws_key_management plugin does not have dedicated variables for aws_access_key_id or aws_secret_access_key. Ideally you provide the credentials using one of the methods here But you can set env.variables as per document above. Note that your server already authenticates against AWS, because aws_key_management plugin works. How exactly it works in your case, I do not known, it probably uses profile file. |
| Comment by Vladislav Vaintroub [ 2018-11-21 ] |
|
You do not need to pass key ids, mariabackup can and will backup files using the same keys as server uses them. |
| Comment by Akshaya Srinivasan [ 2018-11-21 ] |
|
Thanks Vladislav. When I created the table, below log line was seen, where key id 3 was loaded. Nov 21 11:42:12 mongotest2lin mysqld[52326]: 2018-11-21 11:42:12 8 [Note] mysqld: AWS KMS plugin: loaded key 3, version 1, key length 128 bit But when I took a backup of the table using mariabackup, below line was seen when key 1 was loaded instead of key 3 2018-11-21 14:20:44 0 [Note] InnoDB: Number of pools: 1 |
| Comment by Vladislav Vaintroub [ 2018-11-21 ] |
|
Do not look at the "loaded" messages, look at what is actually in the table after prepare. USe "SHOW CREATE TABLE" is for that. Different keys can be loaded at different times into the server (or backup), as needed. mariabackup does not have the intelligence to renumber the keys of a table. |