2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

:Add cluster maintenance doc

This commit is contained in:
chenglch 2015-12-03 02:15:04 -05:00
parent 2ca3988fe5
commit e51e155ae3
6 changed files with 416 additions and 1 deletions

View File

@ -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 <noderange>
#. Remove the nodes from the DHCP configuration ::
makedhcp -d <noderange>
#. Remove the nodes from the conserver configuration ::
makeconservercf -d <noderange>
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 <newnodename> hosts.ip="x.xx.xx.xx"
# add host/ip records in /etc/hosts from the definition in the xCAT hosts
# table for the <noderange>
makehosts <noderange>
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

View File

@ -6,4 +6,5 @@ Cluster Maintenance
compute_node/index.rst
mgmt_node/index.rst
service_node/index.rst
sw_fw_inventory.rst

View File

@ -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 <newMNname>
* 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=<oldMNip>|xcatadm|xcat20``
with ``Pg:dbname=xcatdb;host=<newMNip>|xcatadm|xcat20``.
- Edit config database config file ``/var/lib/pgsql/data/pg_hba.conf``,
replace ``host all all <oldMNip>/32 md5``
with ``host all all <newMNip>/32 md5``.
Mysql
^^^^^
Edit ``/etc/xcat/cfglooc``, replace ``mysql:dbname=xcatdb;host=<oldMNip>|xcatadmin|xcat20``
with ``mysql:dbname=xcatdb;host=<newMNip>|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=<new mn ip address>
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=<newipaddress>
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 <key=value>
Check Result
^^^^^^^^^^^^^
You can check whether all the old address has been changed using ::
dumpxCATdb -P <new database backup path>
cd <new database backup path>
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 <xxx.csv>
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 <new list>
Change the domain name in the xCAT database site table. ::
chdef -t site -o clustersite domain=<newdomainname>
From xCAT 2.8, multiple domains is supported in the cluster. Update the
networks table definition. ::
lsdef -t network -l
chdef -t network -o <netname> ddnsdomain=<newdomainname1,newdomainname2>
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 <oldMNname>
- Remove the MN from the DHCP configuration ::
makedns -d <oldMNname>
- Remove the MN from the conserver configuration ::
makedns -d <oldMNname>
- Change the MN name in the xCAT database ::
chdef -t node -o <oldMNname> -n <newMNname>
- Add the new MN to DNS ::
makedns -n
- Add the MN to dhcp ::
makedhcp -a
- Add the MN to conserver ::
makeconservercf

View File

@ -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=<new service node ip addresss>
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 <https://localhost/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 <servicenodes> /etc/hosts /etc/hosts
xdsh <servicenodes> makedns -n
Reinstall the nodes to pick up all changes ::
nodeset <noderange> osimage=<osimagename>
Then use your normal command to install the nodes like rinstall,rnetboot,etc.

View File

@ -0,0 +1,7 @@
Service Node
============
.. toctree::
:maxdepth: 2
changing_hostname_ip.rst

View File

@ -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 <https://sourceforge.net/p/xcat/wiki/Setting_Up_MySQL_as_the_xCAT_DB/#configure-mysql-manually>`_
.. _grante_revoke_mysql_access_label:
Granting/Revoking access to the database for Service Node Clients
-----------------------------------------------------------------