diff --git a/docs/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst b/docs/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst index ed0ff7271..4b03f9b78 100644 --- a/docs/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst +++ b/docs/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst @@ -27,4 +27,25 @@ where the /tmp/servicenodes contains a host per line: :: Granting/Revoking access to the database for Service Node Clients ----------------------------------------------------------------- -https://sourceforge.net/p/xcat/wiki/Setting_Up_MySQL_as_the_xCAT_DB/#granting-or-revoking-access-to-the-mysql-database-to-service-node-clients +* Log into the MySQL interactive program. :: + + /usr/bin/mysql -r root -p + +* Granting access to the xCAT database. Service Nodes are required for xCAT hierarchical support. Compute nodes may also need access that depends on which application is going to run. (xcat201 is xcatadmin's password for following examples) :: + + MariaDB > GRANT ALL on xcatdb.* TO xcatadmin@ IDENTIFIED BY 'xcat201'; + + Use the wildcards to do a GRANT ALL to every ipaddress or nodename that need to access the database. :: + + MariaDB > GRANT ALL on xcatdb.* TO xcatadmin@'%.cluster.net' IDENTIFIED BY 'xcat201'; + MariaDB > GRANT ALL on xcatdb.* TO xcatadmin@'8.113.33.%' IDENTIFIED BY 'xcat201'; + +* To revoke access, run the following: :: + + MariaDB > REVOKE ALL on xcatdb.* FROM xcatadmin@'8.113.33.%'; + +* To Verify the user table was populated. :: + + MariaDB > SELECT host, user FROM mysql.user; + + diff --git a/docs/source/guides/admin-guides/large_clusters/databases/mysql_remove.rst b/docs/source/guides/admin-guides/large_clusters/databases/mysql_remove.rst index 73c5b07fe..f00fbad56 100644 --- a/docs/source/guides/admin-guides/large_clusters/databases/mysql_remove.rst +++ b/docs/source/guides/admin-guides/large_clusters/databases/mysql_remove.rst @@ -1,21 +1,21 @@ Removing ``xcatdb`` from MySQL/MariaDB ====================================== -For some reason, if you do not want to use MySQL/MariaDB to maintain ``xcatdb``, and like to switch to PostgreSQL or just default SQLite ( **Note:** SQLite does not support xCAT Hierarchy (has service nodes)), you can always to do that with the xCAT command. +If you no longer want to use MySQL/MariaDB to maintain ``xcatdb``, and like to switch to PostgreSQL or just default SQLite ( **Note:** SQLite does not support xCAT Hierarchy (has service nodes)), use the following documentation as guide to remove ``xcatdb``. * Run a backup of the database to save any information that is needed (optional): :: mkdir -p ~/xcat-dbback dumpxCATdb -p ~/xcat-dbback - If you want to restore this database: :: + If you want to restore this database later: :: XCATBYPASS=1 restorexCATdb -p ~/xcat-dbback -* Change to PostgrSQL, please follow link https://xcat-docs.readthedocs.org/en/latest/guides/admin-guides/large_clusters/databases/postgres_install.html +* Change to PostgreSQL, please following documentation: :doc:`/guides/admin-guides/large_clusters/databases/postgres_install` -* Change to default SQLite (**Note**: xCAT Hierarchy cluster will no longer work) +* Change back to default xCAT database, SQLite (**Note**: xCAT Hierarchy cluster will no longer work) #. Stop the ``xcatd`` daemon on the management node. :: diff --git a/docs/source/guides/admin-guides/large_clusters/databases/mysql_using.rst b/docs/source/guides/admin-guides/large_clusters/databases/mysql_using.rst index 430a7d609..899e90a8a 100644 --- a/docs/source/guides/admin-guides/large_clusters/databases/mysql_using.rst +++ b/docs/source/guides/admin-guides/large_clusters/databases/mysql_using.rst @@ -4,12 +4,12 @@ Using MySQL/MariaDB Start/Stop MySQL/MariaDB service -------------------------------- -**[RHEL]** for mariadb: :: +**[RHEL]** for MariaDB: :: service mariadb start service mariadb stop -**[RHEL]** for mysql:: +**[RHEL]** for MySQL:: service mysqld start service mysqld stop @@ -25,31 +25,31 @@ Basic MySQL/MariaDB commands Refer to ``_ for the latest documentation. -Using ``mysql``, connect to the xcat database: :: +* Using ``mysql``, connect to the xcat database: :: mysql -u root -p -list the hosts and users which managed by this xcat MN: :: +* List the hosts and users which managed by this xcat MN: :: MariaDB> SELECT host, user FROM mysql.user; -list the databases: :: +* List the databases: :: MariaDB> SHOW DATABASES; -use the xcatdb: :: +* Use the xcatdb: :: MariaDB> use xcatdb; -list all the tables: :: +* List all the tables: :: MariaDB [xcatdb]> SHOW TABLES; -show the entries in the nodelist table: :: +* Show the entries in the nodelist table: :: MariaDB [xcatdb]> select * from nodelist; -quit mysql: :: +* Quit mysql: :: MariaDB [xcatdb]> quit;