diff --git a/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst b/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst index d607489a1..f8134d8f5 100644 --- a/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst +++ b/source/guides/admin-guides/large_clusters/databases/mysql_configure.rst @@ -1,2 +1,24 @@ -Configure MySQL -=============== +Configure MySQL/MariaDB +======================= + +Migrate xCAT to use MySQL/MariaDB +--------------------------------- + +The following utility is provided to migrate an existing xCAT database from SQLite to MySQL/MariaDB. :: + + mysqlsetup -i + + +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 + + mysqlsetup -u -f /path/to/file1 + +**While not recommended**, if you wish to manually migrate your xCAT database, see the following documentation: +`Manually set up MySQL `_ + +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 diff --git a/source/guides/admin-guides/large_clusters/databases/mysql_install.rst b/source/guides/admin-guides/large_clusters/databases/mysql_install.rst index fb6187306..30eb3f7dc 100644 --- a/source/guides/admin-guides/large_clusters/databases/mysql_install.rst +++ b/source/guides/admin-guides/large_clusters/databases/mysql_install.rst @@ -1,2 +1,85 @@ -Install MySQL -============= +Install MySQL/MariaDB +===================== + +The MySQL database is supported by xCAT since xCAT 2.1. MariaDB is a fork of the MySQL project which was released around 2009 and is a drop-in replacement for MySQL. MariaDB support within xCAT started in version 2.8.5 and is currently fully supported moving forward. + ++------------+------------+------------+ +| Database | MySQL | MariaDB | ++============+============+============+ +| xCAT 2.1+ | Yes | No | ++------------+------------+------------+ +| xCAT 2.8.5 | Yes | RHEL 7 | ++------------+------------+------------+ +| xCAT 2.9 | Yes | SLES 12 | ++------------+------------+------------+ +| xCAT 2.10+ | Yes | Yes | ++------------+------------+------------+ + +MySQL/MariaDB packages are shipped as part of most Linux Distributions. + + +Redhat Enterprise Linux +----------------------- + +* MySQL - Using ``yum``, ensure that the following packages are installed on the management node: :: + + perl-DBD-MySQL* + mysql-server-5.* + mysql-5.* + mysql-devel-5.* + mysql-bench-5.* + mysql-connector-odbc-* + +* MariaDB - Using ``yum``, ensure that the following packages are installed on the management node: :: + + mariadb-devel-5.* + mariadb-libs-5.* + mariadb-server-5.* + mariadb-bench-5.* + mariadb-5.* + perl-DBD-MySQL* + mysql-connector-odbc-* + unixODBC* + +Suse Linux Enterprise Server +---------------------------- + +* MySQL - Using ``yum``, ensure that the following packages are installed on the management node: :: + + mysql-client-5* + libmysqlclient_r15* + libqt4-sql-mysql-4* + libmysqlclient15-5* + perl-DBD-mysql-4* + mysql-5* + +* MariaDB - Using ``yum``, ensure that the following packages are installed on the management node: :: + + mariadb-client-10.* + mariadb-10.* + mariadb-errormessages-10.* + libqt4-sql-mysql-* + libmysqlclient18-* + perl-DBD-mysql-* + + +Debian/Ubuntu +------------- + +* MySQL - Using ``apt-get``, ensure that the following packages are installed on the management node: :: + + mysql-server + mysql-common + libdbd-mysql-perl + libmysqlclient18 + mysql-client-5* + mysql-client-core-5* + mysql-server-5* + mysql-server-core-5* + +* MariaDB - Using ``apt-get``, ensure that the following packages are installed on the management node: :: + + libmariadbclient18 + mariadb-client + mariadb-common + mariadb-server diff --git a/source/guides/admin-guides/large_clusters/databases/mysql_remove.rst b/source/guides/admin-guides/large_clusters/databases/mysql_remove.rst new file mode 100644 index 000000000..c8531a8c1 --- /dev/null +++ b/source/guides/admin-guides/large_clusters/databases/mysql_remove.rst @@ -0,0 +1,2 @@ +Removing ``xcatdb`` from MySQL/MariaDB +====================================== diff --git a/source/guides/admin-guides/large_clusters/databases/mysql_using.rst b/source/guides/admin-guides/large_clusters/databases/mysql_using.rst new file mode 100644 index 000000000..7d80b15ed --- /dev/null +++ b/source/guides/admin-guides/large_clusters/databases/mysql_using.rst @@ -0,0 +1,2 @@ +Using MySQL/MariaDB +=================== diff --git a/source/guides/admin-guides/large_clusters/databases/postgres_remove.rst b/source/guides/admin-guides/large_clusters/databases/postgres_remove.rst new file mode 100644 index 000000000..16807d1d2 --- /dev/null +++ b/source/guides/admin-guides/large_clusters/databases/postgres_remove.rst @@ -0,0 +1,44 @@ +Removing ``xcatdb`` from PostgreSQL +=================================== + +To remove ``xcatdb`` completely from the PostgreSQL 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 postgres, 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 PostgreSQL: :: + + su - postgres + + drop the xcatdb: :: + + dropdb xcatdb + + remove the xcatadm database owner : :: + + dropuser xcatadm + + clean up the postgresql files (necessary if you want to re-create the database): :: + + cd /var/lib/pgsql/data + rm -rf * + +#. Move, or remove, the ``/etc/xcat/cfglog`` file as it points xCAT to PostgreSQL. (without this file, xCAT defaults to SQLite): :: + + mv /etc/xcat/cfgloc /etc/xcat/cfglog.postgres + +#. Restore the PostgreSQL database into SQLite: :: + + XCATBYPASS=1 restorexCATdb -p ~/xcat-dbback + +#. Restart ``xcatd``: :: + + service xcatd start + diff --git a/source/guides/admin-guides/large_clusters/databases/postgres_using.rst b/source/guides/admin-guides/large_clusters/databases/postgres_using.rst new file mode 100644 index 000000000..b757333c9 --- /dev/null +++ b/source/guides/admin-guides/large_clusters/databases/postgres_using.rst @@ -0,0 +1,39 @@ +Using PostgreSQL +================ + +Refer to ``_ for the latest documentation. + + +Using ``psql``, connect to the xcat database: :: + + su - postgres + psql -h -U xcatadm -d xcatdb (default pw: cluster) + +list the xCAT tables: :: + + xcatdb=> \dt + +show the entries in the nodelist table: :: + + xcatdb=> select * from nodelist; + +quit postgres: :: + + xcatdb=> \q + + +Useful Commands +--------------- + +Show the SQL create statement for a table: :: + + /usr/bin/pg_dump_xcatdb -U xcatadm -t + + # example, for prescripts table: + /usr/bin/pg_dump xcatdb -U xcatadm -t prescripts + +List all databases in postgres: :: + + su - postgres + psql -l +