wiki:Web/QuattorClientUsage

Version 3 (modified by loomis, 14 years ago) (diff)

--

This page explains some of the basic Quattor commands needed to configure a client node. Command examples generally assume that you are logged on to the node as root (or have equivalent access using sudo).

Fetching profiles

Quattor configuration information is stored in configuration profiles, which are XML files retrieved from a server (normally over HTTP/S). Profiles are usually fetched at regular intervals from the server. If you want to manually pull down a profile on a node, use the following command:

 [root@client-node root]# ccm-fetch

If this command returns almost immediately, then the profile is up to date. If it takes a little longer, then a new profile is being fetched. To force the profile to be retrieved from the server, use the -f flag to ccm-fetch.

Configuring a node

Quattor configuration is performed by components which are named ncm-<component-name>. Examples are ncm-accounts which configures the user accounts on the system. Components are configured like this:

 ncm-ncd --co accounts

This will also configure any components defined as pre- or post-dependencies. For example, the package manager spma is normally defined as a pre-dependency.

Configuring all components

To configure all components defined in the profile, use the <tt>-all</tt> flag to ncm-ncd:

 ncm-ncd --co -all

Configuring a single component

To prevent pre- and post-dependencies from being configured:

  ncm-ncd --co accounts --nodeps --autodeps no

Query configuration

To find out what the currently-active profile contains, use the ncm-query command. You can either query by component name, or by path in the tree. Here's an example of querying the configuration of a component:

 [root@client-node root]# ncm-query --co ccm
 
 [INFO] Subtree: /software/components/ccm
 
 +-ccm
   $ active : (boolean) 'true'
   $ cache_root : (string) '/var/lib/ccm'
   $ configFile : (string) '/etc/ccm.conf'
   $ debug : (long) '0'
   +-dependencies
     +-pre
       $ 0 : (string) 'spma'
   $ dispatch : (boolean) 'true'
   $ force : (long) '0'
   $ get_timeout : (long) '30'
   $ lock_retries : (long) '3'
   $ lock_wait : (long) '30'
   $ profile : (string) 'http://gridinstall02.testgrid/profiles/mpiws/profile_lcg-rb.xml'
   $ retrieve_retries : (long) '3'
   $ retrieve_wait : (long) '30'
   $ world_readable : (long) '1'

And here's an example of querying a specific path:

 [root@client-node root]# ncm-query --dump /hardware/harddisks/hda
 
 [INFO] Subtree: /hardware/harddisks/hda
 
 +-hda
   $ capacity : (long) '40960'
   $ interface : (string) 'ide'
   $ model : (string) 'Generic IDE disk'

Package management

The native quattor package manager is called spma. spma reads a list of packages from the XML profile, generates a file containing the desired package list for the node, and then calls the native packager (usually rpm) to bring the node state up to date.

spma is normally invoked via its controlling component:

 [root@client-node root]# ncm-ncd --co spma
 
 [INFO] NCM-NCD version 1.2.14 started by root at: Tue Feb 5 08:19:37 2008
 [INFO] executing configure on components....
 [INFO] running component: spma
 [OK] updated SPMA target configuration file in /var/lib/spma-target.cf
 running the SPMA: /usr/bin/spma --quiet
 [OK] /usr/bin/spma --quiet finished succesfully (please check spma.log)
 [INFO] configure on component spma executed, 0 errors, 0 warnings

This will (re)generate the package list (/var/lib/spma-target.cf) from the profile and run spma. If this procedure fails, you can see why by inspecting spma's log file at /var/log/spma.log. SPMA runs may fail due to dependency problems as it is very difficult to check dependencies at the time the node templates are compiled. (You may want to look at the checkdeps tool)