2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-01 00:57:37 +00:00

Add sections to complete the mysql/mariadb documentation

This commit is contained in:
Casandra Qiu
2015-11-12 11:53:47 -05:00
parent 4adbafdc2d
commit 35606b5542
3 changed files with 94 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 `<https://www.mariadb.org/>`_ 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;