forked from logicalclocks/ndb-chef
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HOPSWORKS-1387] Upgrade to NDB 8 (logicalclocks#55)
- Loading branch information
Showing
5 changed files
with
15 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +0,0 @@ | ||
action :install_distributed_privileges do | ||
# load the users using distributed privileges | ||
# http://dev.mysql.com/doc/refman/5.5/en/mysql-cluster-privilege-distribution.html | ||
new_resource.updated_by_last_action(false) | ||
if node['ndb']['enabled'] == "true" | ||
|
||
ndb_waiter "wait_mysql_started" do | ||
action :wait_until_cluster_ready | ||
end | ||
|
||
ndb_mysql_basic "mysqld_start_hop_install" do | ||
wait_time 10 | ||
action :wait_until_started | ||
end | ||
|
||
distusers = "#{node['mysql']['version_dir']}/share/ndb_dist_priv.sql" | ||
bash 'create_distributed_privileges' do | ||
user node['ndb']['user'] | ||
code <<-EOF | ||
#{node['ndb']['scripts_dir']}/mysql-client.sh < #{distusers} | ||
# Test that it works | ||
#{node['ndb']['scripts_dir']}/mysql-client.sh -e "CALL mysql.mysql_cluster_move_privileges();" | ||
echo "Verifying successful conversion of tables.." | ||
#{node['ndb']['scripts_dir']}/mysql-client.sh -e "SELECT CONCAT('Conversion ', IF(mysql.mysql_cluster_privileges_are_distributed(), 'succeeded', 'failed'), '.') AS Result;" | grep "Conversion succeeded" | ||
EOF | ||
new_resource.updated_by_last_action(true) | ||
not_if "#{node['ndb']['scripts_dir']}/mysql-client.sh -e \"SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME LIKE 'mysql_cluster%'\" | grep mysql_cluster", :user => "#{node['ndb']['user']}" | ||
end | ||
|
||
end | ||
end | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
actions :install_distributed_privileges | ||
|
||
default_action :install_distributed_privileges | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
# Give access from this IP | ||
|
||
GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'localhost' identified by '<%= node['mysql']['password'] %>'; | ||
GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'127.0.0.1' identified by '<%= node['mysql']['password'] %>'; | ||
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'localhost' identified by '<%= node['mysql']['password'] %>'; | ||
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'127.0.0.1' identified by '<%= node['mysql']['password'] %>'; | ||
CREATE USER if not exists '<%= node['mysql']['user'] %>'@'localhost' identified by '<%= node['mysql']['password'] %>'; | ||
CREATE USER if not exists '<%= node['mysql']['user'] %>'@'127.0.0.1' identified by '<%= node['mysql']['password'] %>'; | ||
|
||
GRANT NDB_STORED_USER ON *.* to '<%= node['mysql']['user'] %>'@'localhost'; | ||
GRANT NDB_STORED_USER ON *.* to '<%= node['mysql']['user'] %>'@'127.0.0.1'; | ||
|
||
GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'localhost'; | ||
GRANT ALL PRIVILEGES ON *.* to '<%= node['mysql']['user'] %>'@'127.0.0.1'; | ||
|
||
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'localhost'; | ||
GRANT GRANT OPTION ON *.* to '<%= node['mysql']['user'] %>'@'127.0.0.1'; |