Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mariadb backup as optional option for wsrep_sst_method #64

Merged
merged 5 commits into from
May 5, 2021

Conversation

eRadical
Copy link
Collaborator

mariabackup is an alternative to rsync that does not block the donor node

@mrlesmithjr
Copy link
Owner

@eRadical - I merged some PR's from @elcomtik which caused some conflicts with this PR. Do you mind rebasing to resolve these and we can get this PR merged as well?

@elcomtik
Copy link
Collaborator

@eRadical Did it worked? I use mariabackup when SST encryption is needed. What I found is that mariabackup needs to authenticate on the donor node, so I had to create a user for that. I don't see that you use any SST authentication.

You may see respective code at

mariadb_sst_user:
- name: "{{ mariadb_sst_username }}"
hosts:
- "localhost"
plugin: "unix_socket"
password: "{{ mariadb_sst_password }}"
priv: "*.*:RELOAD,PROCESS,LOCK TABLES,BINLOG MONITOR"

and
- "{{ galera_sst_tls_enabled | ternary( mariadb_mysql_users | union( mariadb_sst_user ), mariadb_mysql_users ) }}"
and in any galera config file, eg.
wsrep_sst_auth="{{ mariadb_sst_user }}:{{ mariadb_sst_password }}"

@eRadical
Copy link
Collaborator Author

Haven't had any time yesterday as i was distracted by other chores.
Today I'll spin up a cluster w/ the above to test.

Thanx @elcomtik for those. Will incorporate!

@eRadical eRadical force-pushed the use-MariaDB-backup branch from c5970a1 to 895dbf2 Compare March 30, 2021 07:27
@eRadical
Copy link
Collaborator Author

eRadical commented Mar 30, 2021

You're right @elcomtik, it does need authentication.

I've changed the logic to create user & use mariabackup without tls.
The tls part is still there but can be enabled separately.

What do you both think about this form? cc @mrlesmithjr

@elcomtik
Copy link
Collaborator

elcomtik commented Mar 30, 2021

This looks almost perfect, although it removed functionality to automatically use mariabackup if sst encryption is enabled.
I would like if variable galera_sst_method default would be conditional which will switch on mariabackup if SST TLS is used.

Something like this (I have not tested this code yet)

galera_sst_method = "mariadb_tls_files and mariadb_tls_files|length == 3 and galera_sst_tls_enabled | ternary( "mariabackup", "rsync" )"

This could be overridden by the user if needed

@eRadical
Copy link
Collaborator Author

In defaults/main.yml I would change galera_sst_method to galera_sst_default_method:

galera_sst_default_method: rsync

In vars/main.yaml I would add:

galera_sst_method: "{{ mariadb_tls_files and mariadb_tls_files|length == 3 and galera_sst_tls_enabled | ternary( "mariabackup", galera_sst_default_method ) }}"

Thoughts ? cc @mrlesmithjr

@eRadical
Copy link
Collaborator Author

Done as @elcomtik suggested!

@mrlesmithjr - this is ready to be merged!

I have some clusters to spin up! :)

Copy link
Collaborator

@elcomtik elcomtik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks, good. Please look at my last comment about xtrabackup-v2

# This option defines the wsrep_sst_method that should be used by the cluster.
# Possible options:
# - mariabackup - recommended for MariaDB - default if TLS is enabled via galera_sst_tls_enabled,
# - xtrabackup-v2 - there are limitations, please see https://mariadb.com/kb/en/xtrabackup-v2-sst-method/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not list xtrabackup-v2, because install of respective packages is not handled yet

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could just say it's unsupported by the role!

@elcomtik
Copy link
Collaborator

elcomtik commented May 5, 2021

@eRadical I just found an issue with WSREP auth. It affects your PR, you should rebase it when my PR is merged.

@eRadical
Copy link
Collaborator Author

eRadical commented May 5, 2021

As soon as @mrlesmithjr can help us merge both of them!

@mrlesmithjr
Copy link
Owner

Merged #68

@eRadical eRadical force-pushed the use-MariaDB-backup branch from 8b9df62 to 7ca7887 Compare May 5, 2021 19:03
@eRadical
Copy link
Collaborator Author

eRadical commented May 5, 2021

rebased and added also a note that xtrabackup-v2 is not implemented by this role

@elcomtik
Copy link
Collaborator

elcomtik commented May 5, 2021

Perfect job @eRadical. LGTM @mrlesmithjr

@mrlesmithjr mrlesmithjr merged commit 2a36114 into mrlesmithjr:master May 5, 2021
@mrlesmithjr
Copy link
Owner

Merged and thanks to you both as always!

@eRadical eRadical deleted the use-MariaDB-backup branch May 6, 2021 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants