Skip Navigation Links
Exit Print View
| Oracle Solaris Cluster Reference Manual Oracle Solaris Cluster 4.1

Search Scope:

- This Document
- Entire Library

### ccradm

- CCR table files administration command

### Synopsis

    /usr/cluster/lib/sc/ccradm subcommand [-?]

    /usr/cluster/lib/sc/ccradm addkey [-Z zoneclustername] -v value -k key ccrtablefile

    /usr/cluster/lib/sc/ccradm addtab [-Z zoneclustername] ccrtablefile

    /usr/cluster/lib/sc/ccradm changekey [-Z zoneclustername] -v value -k key ccrtablefile

    /usr/cluster/lib/sc/ccradm delkey [-Z zoneclustername] -k key ccrtablefile

    /usr/cluster/lib/sc/ccradm recover [-Z zoneclustername] -f -o ccrtablefile

    /usr/cluster/lib/sc/ccradm remtab [-Z zoneclustername] ccrtablefile

    /usr/cluster/lib/sc/ccradm replace [-Z zoneclustername] -i newdatafile ccrtablefile

    /usr/cluster/lib/sc/ccradm showkey [-Z zoneclustername] -k key ccrtablefile

## Description

The `ccradm` command supports administration of Cluster Configuration Repository (CCR) information.

The CCR information resides under the `/etc/cluster/ccr` directory. CCR information about the global cluster resides in the `/etc/cluster/ccr/global` directory. CCR information about a zone cluster zoneclustername resides in the `/etc/cluster/ccr/zoneclustername` directory. CCR information should only be accessed through the supported programming interfaces. The file permissions are intentionally set to prevent direct access to CCR information.

CCR information is stored in the form of a table, with one table stored in its own file. Each line of the CCR table file consists of two ASCII strings, where one is the key and the other is the value. Each CCR file starts with a generation number, `ccr_gennum` and a checksum, `ccr_checksum`.

The `ccr_gennum` indicates the current generation number of the CCR table file. The system manages the `ccr_gennum`. The highest number is the latest version of the file.

The `ccr_checksum` indicates the checksum of the CCR table contents, and provides a consistency check of the data in the table. The system will not use a CCR table file with an invalid checksum.

The ccrtablefile file is the name of the file representing the CCR table on the local node. When the `-Z` option is specified, the ccrtablefile belongs to the specified zone cluster. When `-Z` option is not specified, the ccrtablefile belongs to the global cluster. Note that the global cluster and the zone clusters can each have a ccrtablefile of the same name with different information.

You can use this command only in the global zone.

## Sub-commands

This command has the following subcommands:

`addkey`

  Adds a key-value pair to the CCR table file for the specified cluster. When used with the `-s` option, the data is a string value. When used with the `-f` option, the value is the first string in the file and the file contains exactly one string. The command returns an error if the file is not in this format.

  This subcommand can be used only in cluster mode.

`addtab`

  Creates a table in the CCR for the specified cluster. The table initially contains just the `ccr_gennum` and `ccr_checksum`.

  This subcommand can be used only in cluster mode.

`changekey`

  Modifies the value of a key in CCR table file based upon the specified key and new value. If the key is not found in CCR table file, the command returns `ESPIPE`. When used with the `-s` option, the data is a string value. When used with the `f` option, the value is the first string in the file and the file contains exactly one string. The command returns an error if the file is not in this format.

  This subcommand can be used only in cluster mode.

`delkey`

  Deletes a key-value pair from CCR table file based upon the specified key. If the key is not found in the CCR table file, the command returns `ESPIPE`.

  This subcommand can be used only in cluster mode.

`recover`

  | Caution - This subcommand is only for use by engineers who are experts on the internal operations of the CCR. This subcommand supports manual recovery operations. Normal users should not use this subcommand.

  The `recover` subcommand always sets the value of the `ccr_gennum` and recomputes the checksum and sets the value of `ccr_checksum` in the CCR table file.

  When you use the `recover` subcommand without the `-o` option, the `recover` subcommand sets the generation number to `INIT_VERSION`, which is `-1`. A generation number of `INIT_VERSION` means that the CCR table file is valid only until the local node rejoins the cluster, at which time the cluster will replace the contents of CCR table file with the contents of CCR table file from another node in the cluster. A prerequisite is that either one of the other nodes in the cluster must have the override version set for the CCR table file, or at least one of the other nodes must have a valid copy of the CCR table file. A CCR table file is valid if it has a valid checksum and its generation number is greater than or equal to zero.

  If the CCR table file has a generation number of `INIT_VERSION` on all nodes, then the CCR table will remain invalid after recovery has completed. Therefore, do not use the init subcommand without the `-o` option on a CCR table file on all nodes in the cluster.

  When you use the recover subcommand with the `-o` option, the `recover` subcommand sets the generation number to `OVRD_VERSION`, which is `-2`. A generation number of `OVRD_VERSION` means that the system will propagate the contents of CCR table file on the local node to all other cluster nodes. After propagating the contents to other nodes, the system will change the generation number to 0. Only one node should have a CCR table file with a value of `OVRD_VERSION`. If `OVRD_VERSION` is set on the same CCR table file on multiple nodes, the system will arbitrarily use one CCR table file contents.

  This subcommand can be used only in noncluster mode.

`remtab`

  Removes a table from the CCR.

  This subcommand can be used only in cluster mode.

`replace`

  | Caution - This subcommand is only for use by engineers who are experts on the internal operations of the CCR. This subcommand supports manual recovery operations. Normal users should not use this subcommand.

  Replaces the contents of ccrdatafile with the contents of newdatafile. The checksum is recomputed and the generation number is reset to 0.

  This subcommand can be used only in cluster mode.

`showkey`

  Displays the value for the specified key in CCR table file. If the key is not found in CCR table file, the command returns `ESPIPE`. The `showkey` command writes to standard output just the value string followed by an end of line for the specified key. When an error occurs, the command writes nothing.

  This subcommand can be used only in cluster mode.

## Options

This command has the following options:

`-?`
`--help`

  Displays help information.

  You can specify this option with or without a subcommand.

  If you do not specify a subcommand, the list of all available subcommands is displayed.

  If you specify a subcommand, the usage for that subcommand is displayed.

  If you specify this option and other options, the other options are ignored.

`-f`
`--force`

  Specifies that you want to force the `recover` subcommand when the node is booted as a cluster member.

`-i` newdatafile
`--input=`newdatafile
`--input` newdatafile

  Specifies the CCR table file you want to use for the recovery operation.

`-k`
`--key`

  Specifies the name of the key to be added, removed, or modified.

`-o`
`--override`

  The override option is used with the `recover` subcommand. It sets the generation number to `OVRD_VERSION`.

  This option is used to designate one CCR table file to be the master copy. This master version of the CCR table file overrides other versions of the file that are on the remaining nodes during recovery. If a CCR table file has a generation number of `OVRD_VERSION` on more than one node, then only one of the files is selected and a warning message is printed on the console of one of the nodes. After recovery, the table's generation number is reset to 0.

  This option can be used only in noncluster mode.

`-v` value
`--value=`value
`--value` value

  Specifies the value for the key of a CCR table. There can be no white space characters in the value string. This means that there can be no spaces, tabs, carriage returns, or line feeds.

`-Z` `{zoneclustername | global}`
`--zoneclustername=``{zoneclustername | global}`
`--zoneclustername` `{zoneclustername | global}`

  Specifies the cluster in which the CCR transactions has to be carried out. This option is supported by all subcommands. If you specify this option, you must also specify one argument from the following list:

  zoneclustername

    Specifies that the command with which you use this option is to operate on all specified resource groups in only the zone cluster named zoneclustername.

  `global`

    Specifies that the command with which you use this option is to operate on all specified resource groups in the global cluster only.

  The `-Z` option can be used only in cluster mode.

## Operands

Only the following operand is supported:

ccrtablefile

  Specifies the CCR table file that is to be managed. Only one ccrtablefile can be specified.

## Usage

The `ccradm` command can be used for administrative actions on CCR table files.

## Examples

Example 1 Repairing a Corrupted CCR Table and Recomputing the `checksum`

Perform these steps to repair a corrupted CCR table only when directed by authorized Oracle personnel as part of an emergency repair procedure.

This example repairs the CCR table `ccr-file`.

1. Reboot all nodes in noncluster mode.

2. Edit the file on all nodes to contain the correct data. The file must be identical on all nodes. Because the file is identical on all nodes, it also can be designated as the override version on all nodes.

3. Recompute the checksum and designate this CCR table file to be the override version by running the following command on all nodes, where `ccr-file` is the name of the CCR table.

       # ccradm recover -o ccr-file

4. Reboot all nodes into cluster mode.

Example 2 Restoring a Corrupted CCR Table From a Backup Version

This example replaces the CCR table `yyy` with the contents of its backup version, the file `yyy.bak`. The command is run from one node in cluster mode.

    # ccradm replace -Z global -i /etc/cluster/ccr/global/yyy.bak /etc/cluster/ccr/global/yyy

Example 3 Creating a CCR Table

This example creates a temporary CCR table `foo` in the zone cluster `zc1`. The command is run from one node in cluster mode.

    # ccradm addtab -Z zc1 foo

Example 4 Removing a CCR Table

This example shows the removal of the CCR table `foo` from the global cluster. The command is run from one node in cluster mode.

    # ccradm remtab foo

Example 5 Modifying a CCR Table

This example changes to `5400` the value of the `Pingpong_interval` property in the global cluster CCR table `rgm_rg_nfs-rg`. The command is run from one node in cluster mode.

    # ccradm changekey -s 5400 -k Pingpong_interval rgm_rg_nfs-rg

Example 6 Displaying a Key Value From the CCR Table

This example displays the value of the `Pingpong_interval` property from the CCR table `rgm_rg_nfs-rg`.

    # ccradm showkey -k Pingpong_interval rgm_rg_nfs-rg
    5400

## Exit Status

The following exit values are returned:

0

  No errors occurred.

>0

  Errors occurred.

## Attributes

See `attributes`(5) for descriptions of the following attributes.

ATTRIBUTE TYPE | ATTRIBUTE VALUE
--- | ---
Availability | ha-cluster/system/core
Interface Stability | Evolving

Copyright © 2000, 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices |