2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

add access/revoke subsetion

This commit is contained in:
Casandra Qiu 2015-11-16 11:36:47 -05:00
parent 98a55f1ea4
commit 00a0dea615
3 changed files with 35 additions and 14 deletions

View File

@ -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@<servicenode(s)> 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;

View File

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

View File

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