mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 19:32:31 +00:00 
			
		
		
		
	Add sections to complete the mysql/mariadb documentation
This commit is contained in:
		| @@ -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 | ||||
|  | ||||
|   | ||||
| @@ -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  | ||||
|  | ||||
|   | ||||
| @@ -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; | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user