From 35606b55423dfa955767c980978322383bc54153 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 12 Nov 2015 11:53:47 -0500 Subject: [PATCH] Add sections to complete the mysql/mariadb documentation --- .../databases/mysql_configure.rst | 4 +- .../large_clusters/databases/mysql_remove.rst | 37 +++++++++++++ .../large_clusters/databases/mysql_using.rst | 54 +++++++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) 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 f8134d8f5..5278a47b3 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 @@ -11,7 +11,9 @@ The following utility is provided to migrate an existing xCAT database from SQLi If you need to update the database at a later time to give access to your service nodes, you can use the ``mysqlsetup -u -f`` command. A file needs to be provided with all the hostnames and/or IP addresses of the servers that need to access the database on the Management node. Wildcards can be used. :: - TODO: Show an example here of file1 + cat /path/to/file1 + service1 + 10.1.1.1 mysqlsetup -u -f /path/to/file1 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 c8531a8c1..e7f5e2f9e 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,2 +1,39 @@ Removing ``xcatdb`` from MySQL/MariaDB ====================================== + +To remove ``xcatdb`` completely from the MySQL/MariaDB database: + +#. Run a backup of the database to save any information that is needed: :: + + mkdir -p ~/xcat-dbback + dumpxCATdb -p ~/xcat-dbback + +#. Stop the ``xcatd`` daemon on the management node. + **Note:** If you are using *xCAT Hierarchy (service nodes)* and removing ``xcatdb`` from MySQL/MariaDB, hierarchy will no longer work. You will need to configure another database which supports remote database access to continue using the hierarchy feature. :: + + service xcatd stop + +#. Remove the ``xatdb`` from MySQL/MariaDB: :: + + /usr/bin/mysql -u root -p + + drop the xcatdb: :: + + mysql> drop database xcatdb; + + remove the xcatadm database owner : :: + + mysql> drop user xcatadm; + +#. Move, or remove, the ``/etc/xcat/cfglog`` file as it points xCAT to MySQL/MariaDB. (without this file, xCAT defaults to SQLite): :: + + mv /etc/xcat/cfgloc /etc/xcat/cfglog.mysql + +#. Restore the MySQL/MariaDB database into SQLite: :: + + XCATBYPASS=1 restorexCATdb -p ~/xcat-dbback + +#. Restart ``xcatd``: :: + + service xcatd start + 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 7d80b15ed..75b498718 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 @@ -1,2 +1,56 @@ Using MySQL/MariaDB =================== + +Start/Stop MySQL/MariaDB service +-------------------------------- + +**[RHEL]** for mariadb: :: + + service mariadb start + service mariadb stop + +**[RHEL]** for mysql:: + + service mysqld start + service mysqld stop + +**[SLES]** and **[Ubuntu]**: :: + + service mysql start + service mysql stop + + +Basic mysql commands +-------------------------------------- + +Refer to ``_ for the latest documentation. + +Using ``mysql``, connect to the xcat database: :: + + mysql -u root -p + +list the hosts and users which managed by this xcat MN: :: + + MariaDB> SELECT host, user FROM mysql.user; + +list the databases: :: + + MariaDB> SHOW DATABASES; + +use the xcatdb: :: + + MariaDB> use xcatdb; + +list all the tables: :: + + MariaDB [xcatdb]> SHOW TABLES; + +show the entries in the nodelist table: :: + + MariaDB [xcatdb]> select * from nodelist; + +quit mysql: :: + + MariaDB [xcatdb]> quit; + +