fix mysql replication

This commit is contained in:
Matthew Mosesohn 2013-07-03 18:41:01 +04:00 committed by Vladimir Kuklin
parent 38c9ecc1be
commit dc987a89a4

View File

@ -1,4 +1,14 @@
USE mysql; USE mysql;
grant REPLICATION_SLAVE on *.* to '<%= rep_user %>'@'%' IDENTIFIED by '<%= rep_pass %>'; grant <%= replication_roles %> on *.* to '<%= rep_user %>'@'%' IDENTIFIED by '<%= rep_pass %>';
grant SUPER on *.* to '<%= rep_user %>'@'localhost' IDENTIFIED by '<%= rep_pass %>'; grant <%= replication_roles %> on *.* to '<%= rep_user %>'@'localhost' IDENTIFIED by '<%= rep_pass %>';
<% @galera_nodes.each do |node| -%>
grant <%= replication_roles %> on *.* to '<%= rep_user %>'@'<%= node %>' IDENTIFIED by '<%= rep_pass %>';
<% end -%>
<%- interfaces.split(',').each do |int|
if has_variable?("ipaddress_#{int}") then %>
grant <%= replication_roles %> on *.* to '<%= rep_user %>'@'<%= scope.lookupvar("ipaddress_#{int}") %>' IDENTIFIED by '<%= rep_pass %>';
<%- end
end %>
grant <%= replication_roles %> on *.* to '<%= rep_user %>'@'<%= internal_address %>' IDENTIFIED by '<%= rep_pass %>';
grant <%= replication_roles %> on *.* to '<%= rep_user %>'@'<%= server_id %>' IDENTIFIED by '<%= rep_pass %>';
flush privileges; flush privileges;