From e51e155ae37e46d327d94f07b573b51bfb5a1f0e Mon Sep 17 00:00:00 2001 From: chenglch Date: Thu, 3 Dec 2015 02:15:04 -0500 Subject: [PATCH] :Add cluster maintenance doc --- .../compute_node/changing_hostname_ip.rst | 76 +++++ .../advanced/cluster_maintenance/index.rst | 1 + .../mgmt_node/changing_hostname_ip.rst | 271 +++++++++++++++++- .../service_node/changing_hostname_ip.rst | 60 ++++ .../service_node/index.rst | 7 + .../hierarchy/databases/mysql_configure.rst | 2 + 6 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst create mode 100644 docs/source/advanced/cluster_maintenance/service_node/index.rst diff --git a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst index 04ea388d7..2b7ef02b2 100644 --- a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst +++ b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst @@ -1,2 +1,78 @@ Changing the hostname/IP address ================================ + +Background +---------- + +If the hostname or ip address has already been modified on compute nodes, you +can follow the steps to change the configuration in xcat. + +Remove Old Provision Environment +-------------------------------- + +#. Remove the nodes from DNS configuration :: + + makedns -d + +#. Remove the nodes from the DHCP configuration :: + + makedhcp -d + +#. Remove the nodes from the conserver configuration :: + + makeconservercf -d + +Change Definition +----------------- + +#. Change netwoks table definitions :: + + lsdef -t network -l + + The output may be like :: + + 10_0_0_0-255_0_0_0 (network) + fd03:2e76:8631::/64 (network) + + Change the networks table definitions, take ``10_0_0_0-255_0_0_0`` as a example :: + + chdef -t network 10_0_0_0-255_0_0_0 gateway=10.0.0.103 + +#. Change the hostname in the xCAT database (This command only supports one node + at a time). For many nodes you will have to write a script. :: + + # changes node1 to node2 in the database + chdef -t node -o node1 -n node2 + +#. Change the hostname and ip address in the ``/etc/hosts`` file + + - If you do not use the hosts table in xCAT to create the ``/etc/hosts`` file, + edit the ``/etc/hosts`` file and change your hostnames/ipaddresses entries + directly. + - If you use the xCAT hosts table, and your nodes are defined by name in the + hosts table, the hosts table must be updated with the new names when + we changed the node name using chdef command. If the hosts tables contains + regular expression, you have to rewrite the regular expression to + match your new hostnames/ip addresses. + - If these is no regular expression in the hosts table, you can run :: + + # change the ip address for the new hostname in the hosts table. + nodech hosts.ip="x.xx.xx.xx" + # add host/ip records in /etc/hosts from the definition in the xCAT hosts + # table for the + makehosts + +Update The Provision Environment +-------------------------------- + +#. Configure the new names in DNS :: + + makedns -n + +#. Configure the new names in DHCP :: + + makedhcp -a + +#. Configure the new names in conserver :: + + makeconservercf diff --git a/docs/source/advanced/cluster_maintenance/index.rst b/docs/source/advanced/cluster_maintenance/index.rst index 6419d475e..e4fcb7ff7 100644 --- a/docs/source/advanced/cluster_maintenance/index.rst +++ b/docs/source/advanced/cluster_maintenance/index.rst @@ -6,4 +6,5 @@ Cluster Maintenance compute_node/index.rst mgmt_node/index.rst + service_node/index.rst sw_fw_inventory.rst diff --git a/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst index 0716dc9e1..8d343e866 100644 --- a/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst +++ b/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst @@ -1,4 +1,273 @@ Changing the hostname/IP address ================================ -There may be times when it is required to change the hostname or IP address of the xCAT management nodes. This document helps to outline the steps required to ensure successfully changing this attribute on the management node. +Overview +-------- + +This document is intended to describe the steps that must be taken if you need +to change your Linux Management Node's hostname and/or IP address +after the cluster is installed and configured by xCAT. This documentation will +only cover the changes by xCAT and will not try to cover any other changes by +any other tools. + +Backup your xCAT data +--------------------- + +It is good to backup all your xCAT data at first if necessary. Clean up the +database by running the following: :: + + tabprune -a auditlog + tabprune -a eventlog + +Now take a snapshot of the Management Node. This will also create a database +backup. You can use this data as reference if needed. :: + + xcatsnap -d + +Stop xCAT +--------- + +You need to stop the xcat daemon and any other applications that are using the +xCAT database on the Management Node and the Service Nodes. To determine your +database, run :: + + lsxcatd -a | grep dbengine + +To stop xCAT: :: + + service xcatd stop + +Stop The Database +----------------- + +For all databases except SQlite, you should stop the database. +For example :: + + service postgresql stop + service mysqld stop + +Change the Management Host name +------------------------------- + +* hostname command :: + + hostname + +* Edit hostname configuration file + + Add hostname in ``/etc/hostname`` + Add HOSTNAME attribute in ``/etc/sysconfig/network`` (only for [RHEL]) + +Update Database Files +--------------------- + +You need to update the new MN hostname or ip address in several database +configuration files. + +SQLite +^^^^^^ + +Nothing to do. + +Postgresql +^^^^^^^^^^ + +- Edit ``/etc/xcat/cfgloc`` file, replace ``Pg:dbname=xcatdb;host=|xcatadm|xcat20`` + with ``Pg:dbname=xcatdb;host=|xcatadm|xcat20``. + +- Edit config database config file ``/var/lib/pgsql/data/pg_hba.conf``, + replace ``host all all /32 md5`` + with ``host all all /32 md5``. + +Mysql +^^^^^ + +Edit ``/etc/xcat/cfglooc``, replace ``mysql:dbname=xcatdb;host=|xcatadmin|xcat20`` +with ``mysql:dbname=xcatdb;host=|xcatadmin|xcat20``. + +Start the database +------------------ + +:: + + service postgresql start + service mysqld start + +Start xCAT + +:: + + service xcatd start + +Verify your new database setup :: + + lsxcatd -a | grep dbengine + tabdump site # if output exists + +Change The Definition In xCAT Database +-------------------------------------- + +Change the site table master attribute +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +:: + + chdef -t site master= + +Change all ip address attribute relevant to the MN ipaddress +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For example, old address was "10.6.0.1" + +* Query the attributes with old address :: + + lsdef -t node -l | grep "10.6.0.1" + # the output may looks like + conserver=10.6.0.1 + conserver=10.6.0.1 + conserver=10.6.0.1 + conserver=10.6.0.1 + nfsserver=10.6.0.1 + servicenode=10.6.0.1 + xcatmaster=10.6.0.1 + kcmdline=quiet repo=http://10.6.0.1/install/rhels6/ppc64/ ks=http://10.6.0.1/install/autoinst + /slessn ksdevice=d6:92:39:bf:71:05 + nfsserver=10.6.0.1 + servicenode=10.6.0.1 + tftpserver=10.6.0.1 + xcatmaster=10.6.0.1 + servicenode=10.6.0.1 + xcatmaster=10.6.0.1 + +* As the attribute with the old ip address is list above, take conserver as + a example, query the nodes with ``conserver=10.6.0.1``. + + :: + + lsdef -t node -w conserver="10.6.0.1" + # the output looks like + cn1 (node) + cn2 (node) + cn3 (node) + cn4 (node) + +* Change the conserver address for cn1,cn2,cn3,cn4 :: + + chdef -t node cn1-cn4 conserver= + +Repeat the same process for the other attributes. + +Change networks table +^^^^^^^^^^^^^^^^^^^^^^ + +Check your networks table to see if the network definitions are still correct, +if not edit accordingly :: + + lsdef -t network -l + chdef -t network + +Check Result +^^^^^^^^^^^^^ + +You can check whether all the old address has been changed using :: + + dumpxCATdb -P + cd + fgrep "10.6.0.1" *.csv + +If the old address still exists in the ``*.csv` file, you can edit this file, +then use the following command to restore the records :: + + tabrestore + +Generate SSL credentials(optional) +---------------------------------- + +If you do not generate new credentials, skip this section. +If you decide generate new credentials, then you will use the following +command. + +* Generate new credentials :: + + xcatconfig -c + +* Update the policy table with new MN name, + replace ``"1.4","oldMNname",,,,,,"trusted",,`` with + ``"1.4","newMNname",,,,,,"trusted",,`` + +* Setup up conserver with new credentials :: + + makeconservercf + +External DNS Server Changed +--------------------------- + +* Update nameserver entries in ``/etc/resolv.conf`` +* Update nameserver attribute in ``site`` table :: + + chdef -t site -o clustersite nameservers="newipaddress1,newipaddress2" + +* Update site forwarders in DB :: + + chdef -t site -o clustersite forwarders="newipaddress1,newipaddress2" + +* Run command ``makedns -n`` + +Domain Name Changed +------------------- + +Change the entries in ``/etc/hosts``. + +Change the ``/etc/resolv.conf``, forwarders attribute in site table. :: + + lsdef -t site -o clustersite -i forwarders + chdef -t site -o clustersite forwarders + +Change the domain name in the xCAT database site table. :: + + chdef -t site -o clustersite domain= + +From xCAT 2.8, multiple domains is supported in the cluster. Update the +networks table definition. :: + + lsdef -t network -l + chdef -t network -o ddnsdomain= + +Update the Provision Environment +-------------------------------- + +Determine if the Management node is defined in the database, assuming it was +done correctly using xcatconfig -m, by running: :: + + lsdef __mgmtnode + +If it exists, then use the return name and do the following: + + - Remove the MN from DNS configuration :: + + makedns -d + + - Remove the MN from the DHCP configuration :: + + makedns -d + + - Remove the MN from the conserver configuration :: + + makedns -d + + - Change the MN name in the xCAT database :: + + chdef -t node -o -n + + - Add the new MN to DNS :: + + makedns -n + + - Add the MN to dhcp :: + + makedhcp -a + + - Add the MN to conserver :: + + makeconservercf + diff --git a/docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst new file mode 100644 index 000000000..2a80f7e8b --- /dev/null +++ b/docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst @@ -0,0 +1,60 @@ +Changing the hostname/IP address +================================ + +Change compute node definition relevant to the service node +----------------------------------------------------------- + +Change the settings in database. Below shows a method to find out where the old +ip address settings (take 10.6.0.1 as a example) are used in Hierarchy +environment. + +* Query the old attribute :: + + lsdef -t node -l | grep "10.6.0.1" + # below is output of the above command. We can find out that nfsserver + # and servicenode are using the old ip address setting. + nfsserver=10.6.0.1 + servicenode=10.6.0.1 + + +* Query the nodes whose nfsserver is 10.6.0.1 :: + + lsdef -w nfsserver==10.6.0.1 + # below is output of the above command + cn1 (node) + cn2 (node) + cn3 (node) + cn4 (node) + +* Change the nfsserver address for cn1,cn2,cn3,cn4 by running the following + command: :: + + chdef -t node cn1-cn4 nfsserver= + +Database Connection Changes +--------------------------- + +Granting or revoking access privilege in the database for the service node. + +* For mysql, please refer to :ref:`grante_revoke_mysql_access_label`. +.. There is no procedure in old document on sourceforge for postgress to + grant or revoke the access privilege for service node. + +* For postgress, please refer to `TODO `_. + +Update Provision Environment on Service Node +-------------------------------------------- + +If you are using service nodes to install the nodes and using ``/etc/hosts`` +for hostname resolution, you need to copy the new ``/etc/hosts`` from the +management node to the service nodes, then run ``makedns -n`` on the service +nodes. For example: :: + + xdcp /etc/hosts /etc/hosts + xdsh makedns -n + +Reinstall the nodes to pick up all changes :: + + nodeset osimage= + +Then use your normal command to install the nodes like rinstall,rnetboot,etc. \ No newline at end of file diff --git a/docs/source/advanced/cluster_maintenance/service_node/index.rst b/docs/source/advanced/cluster_maintenance/service_node/index.rst new file mode 100644 index 000000000..bf5a4e05d --- /dev/null +++ b/docs/source/advanced/cluster_maintenance/service_node/index.rst @@ -0,0 +1,7 @@ +Service Node +============ + +.. toctree:: + :maxdepth: 2 + + changing_hostname_ip.rst diff --git a/docs/source/advanced/hierarchy/databases/mysql_configure.rst b/docs/source/advanced/hierarchy/databases/mysql_configure.rst index 4b03f9b78..beb24ebb4 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_configure.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_configure.rst @@ -24,6 +24,8 @@ where the /tmp/servicenodes contains a host per line: :: **While not recommended**, if you wish to manually migrate your xCAT database, see the following documentation: `Manually set up MySQL `_ +.. _grante_revoke_mysql_access_label: + Granting/Revoking access to the database for Service Node Clients -----------------------------------------------------------------