4017 Martin Skold 2010-12-15
WL#5482 Distribute MySQL Cluster Users: Updated HOWTO file
modified:
HOWTO_distribute_privileges.txt
4016 Martin Skold 2010-12-15
WL#5482 Distribute MySQL Cluster Users: Added new functionality, test cases and HOWTO file
added:
HOWTO_distribute_privileges.txt
mysql-test/suite/ndb/r/ndb_distribute_user.result
mysql-test/suite/ndb/t/ndb_distribute_user.test
mysql-test/suite/rpl_ndb/r/rpl_ndb_distribute_user.result
mysql-test/suite/rpl_ndb/t/rpl_ndb_distribute_user.test
scripts/mysql_load_distribute_privilege_procedures.sql
modified:
mysql-test/include/restart_mysqld.inc
scripts/Makefile.am
sql/ha_ndbcluster.cc
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.h
sql/ha_ndbcluster_tables.h
sql/handler.h
sql/sql_acl.cc
=== modified file 'HOWTO_distribute_privileges.txt'
--- a/HOWTO_distribute_privileges.txt 2010-12-15 10:40:24 +0000
+++ b/HOWTO_distribute_privileges.txt 2010-12-15 13:04:20 +0000
@@ -1,15 +1,15 @@
HOWTO distribute user privileges in a MySQL Cluster.
This text is a short description how to distribute MySQL
-privilege tables to all connect MySQL servers belonging to
+privilege tables to all connected MySQL servers belonging to
a MySQL Cluster. This enables adding and removing users to
the system as well as defining grants for various privileges
in a more or less transparent manner. Flushing of grants
might be needed to make changes visible on already opened
connections.
-The procedure is based on move the privilege tables from local
-storage (MyISAM) to distyributed storage (ndbcluster). To
+The procedure is based on moving the privilege tables from local
+storage (MyISAM) to distributed storage (ndbcluster). To
simplify the procedure a number of store procedures have been
defined to more or less automate the procedure.
The procedures can be loaded by:
@@ -17,21 +17,32 @@ The procedures can be loaded by:
IMPORTANT: Prior to performing the actual distribution it is recommended
to backup the current privilege tables, using for example mysqldump:
-mysqldump <connect-options> --user root mysql user db tables_priv columns_priv procs_priv
+"mysqldump <connect-options> --user root mysql user db tables_priv columns_priv procs_priv"
The actual procedure can be initiated by running the stored procedure
-mysql_cluster_move_privilege_tables once in any connected MySQL server:
+mysql_cluster_move_privilege_tables once on any connected MySQL server:
"call mysql.mysql_cluster_move_privileges();"
NOTE: This procedure will create two sets of backups of the privilege tables
as well, one local and one distributed. These are used to revert the tables
if anything goes wrong during the distribution process.
-To verify that the procedure was succesful one can do the following query:
+To verify that the procedure was successful one can do the following query:
"select mysql.mysql_cluster_privileges_are_distributed();"
-which should return 1 if procedure was succesful.
+which should return 1 if procedure was successful.
-NOTE: In case cluster being restarted with resetting of all tables (--inital)
+NOTE: If a MySQL server is disconnected from the cluster while the privilege
+tables are being moved the local privilege tables will need to be dropped and
+refreshed when the MySQL server has reconnected:
+use mysql;
+select mysql_cluster_privileges_are_distributed();
+0
+drop table if exists user db tables_priv columns_priv procs_priv;
+show tables;
+select mysql_cluster_privileges_are_distributed();
+1
+
+In case cluster being restarted with resetting of all tables (--inital)
the privilege tables will be lost after the they have been moved. If no
MySQL server is available to revert the tables (either from the local backup
tables or from a mysqldump file). If a new MYSQL server needs to be connected
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.1 branch (Martin.Skold:4016 to 4017) WL#5482 | Martin Skold | 15 Dec |