Update: To cut a long story short, here is the new syntax;
/usr/cluster/lib/sc/ccradm recover -o /etc/cluster/ccr/global/infrastructure
Full skinny follows;
If running SC 3.2u3 or 3.2 Cluster core patch equal to or greater then 126105-36 (5.9) or 126106-36 (5.10) or 126107-36 (5.10 x86) the syntax for regenerating ccr checksums has changed.
Also, if running Solaris Cluster 3.2u2 or higher, the directory path /etc/cluster/ccr is replaced with /etc/cluster/ccr/global. The same applies if running Cluster core patch equal to or greater then 126105-27 (5.9) or 126106-27 (5.10) or 126107-27 (5.10 x86).
#ccradm
usage: ccradm subcommand args ...
where 'subcommand' is one of the following:
recover [-Z zoneclustername] [-f] [-o] ccrtablefile
replace [-Z zoneclustername] -i newdatafile ccrtablefile
addtab [-Z zoneclustername] ccrtablefile
remtab [-Z zoneclustername] ccrtablefile
addkey [-Z zoneclustername] -v value -k key ccrtablefile
changekey [-Z zoneclustername] -v value -k key ccrtablefile
delkey [-Z zoneclustername] -k key ccrtablefile
showkey [-Z zoneclustername] -k key ccrtablefile
Sun Cluster Maintenance Commands ccradm(1M)
NAME
ccradm - CCR table files administration command
SYNOPSIS
******
/usr/cluster/lib/sc/ccradm recover [-Z zoneclustername][-o] ccrtablefile
/usr/cluster/lib/sc/ccradm replace [-Z zoneclustername]-i newdatafile ccrtablefile
/usr/cluster/lib/sc/ccradm addtab [-Z zoneclustername]ccrtablefile
/usr/cluster/lib/sc/ccradm remtab [-Z zoneclustername]ccrtablefile
/usr/cluster/lib/sc/ccradm addkey [-Z zoneclustername]{-s value | -f file} -k key ccrtablefile
/usr/cluster/lib/sc/ccradm delkey [-Z zoneclustername]key ccrtablefile
/usr/cluster/lib/sc/ccradm changekey [-Z zoneclustername]{-s value | -f file} -k key 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 all resides somewhere under /etc/cluster/ccr.
CCR information about the global cluster resides in the
directory /etc/cluster/ccr/global. CCR information about
a zone cluster "zoneclustername" resides in the directory
/etc/cluster/ccr/zoneclustername. CCR information should only
be accessed via 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 an 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. Two special values exist (refer to the
recover subcommand for more information).
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.
"ccrtablefile" 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 no "-Z" option
is specified, the ccrtablefile belongs to the global cluster. Note
that the global cluster and the zone clusters can all have
a ccrtablefile of the same name with different information.
SUBCOMMANDS
The following subcommands are supported:
<< note that the "recover" subcommand replaces "checksum" >>
recover
This option is only for use by engineers who are experts
on the internal operations of the CCR. This option supports
manual recovery operations. Normal users should not use
this option.
This option can be used only in non-cluster mode.
The recover subcommand always sets the value of the ccr_gennum
and re-computes the checksum sets the value of ccr_checksum in
the ccrtablefile.
When used without the "-o" option, the recover subcommand sets the
generation number to INIT_VERSION. 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 ccrtablefile with the contents of ccrtablefile
from another node in the cluster.
A prerequisite is either one of
the following:
1) one of the other nodes in the clus-
ter must have the override version set for the CCR table file, or
2) 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 ccrtablefile 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 used with the "-o" option, the recover subcommand sets the
generation number to OVRD_VERSION. A generation number of OVRS_VERSION
means that the system will propagate the contents of ccrtablefile
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 ccrtablefile with a value
of OVRD_VERSION. If someone makes a mistake and sets OVRD_VERSION
on the same ccrtablefile on multiple nodes, the system will
arbitrarily use one ccrtablefile contents.
replace
This option is only for use by engineers who are experts
on the internal operations of the CCR. This option supports
manual recovery operations. Normal users should not use
this option.
This subcommand can be used only in cluster mode.
Contents of "newdatafile" will replace the contents of
"ccrtablefile".
The checksum will be recomputed and the generation number
will be reset to 0.
addtab
Creates a table in the cluster configuration repository
for the specifid cluster. The table initially contains
just the ccr_gennum and ccr_checksum.
This subcommand can be used only in cluster mode.
remtab
Remove a table in the cluster configuration repository.
This subcommand can be used only in cluster mode.
addkey
Adds a key - value pair to ccrtablefile for the specifid cluster.
This subcommand can be used only in cluster mode.
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.
delkey
Deletes a key - value pair from ccrtablefile based upon
the specified key. If the key is not found in ccrtablefile,
the command returns ESPIPE.
This subcommand can be used only in cluster mode.
changekey
Modify the value of a key in ccrtablefile
based upon the specified key and newvalue.
If the key is not found in ccrtablefile,
the command returns ESPIPE.
This subcommand can be used only in cluster mode.
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.
showkey
Displays the value for the specified key in ccrtablefile.
If the key is not found in ccrtablefile,
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
The following options are supported:
Note -
Both the short and long form of each option is shown in
this section.
-?
--help
Displays help information.
You can specify this option with or without a subcom-
mand.
If you specify this option without a subcommand, the
list of all available subcommands is displayed.
If you specify this option with a subcommand, the usage
for that subcommand is displayed.
-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.
-i newdatafile
--input=newdatafile
--input newdatafile
Specifies the CCR table file you want to use for
recovery operation.
-o
--override
The override option is used with the recover subcommand.
This option can be used only in non-cluster mode.
It sets the generation number to OVRD_VERSION.
This option is used to designate one CCR table
file to be the master copy. This version of the
CCR table file will override 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 will be selected and a warn-
ing message will be printed on the console of one
of the nodes. After recovery the table's genera-
tion number will be reset to 0.
-s {value}
--string={value}
--string {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.
-f {filename}
--filename={filename}
--filename {filename}
Specifies that you want to use the contents of the
file to add or modify the key value that is located
in the filename file. The file must contain exactly one string,
which is to be used as the new value.
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.
USAGE
ccradm can be used for administrative actions on CCR table files.
EXAMPLES
REPAIR PROCEDURE FOR A CCR TABLE
Example 1.
If a CCR table file is manually edited as part of some emer-
gency repair procedure, then the checksum must be recomputed.
Perform these steps to repair a corrupted CCR table only
when directed as part of an emergency repair procedure.
Reboot all nodes in non-cluster mode.
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.
Recompute the checksum and designate this CCR table
file to be the override version by running the follow-
ing command on all nodes. file is the name of the CCR
table.
On each node of the cluster execute the following command:
/usr/cluster/lib/sc/ccradm recover -Z global -o ccrtablefile
Reboot all nodes in cluster mode.
Example 2.
In this example, in order to carry out emergency repairs
the administrator wants ccrtablefile on node 1 to be used
only until the cluster reforms. The administrator wants
the ccrtablefile contents on node 2 to be used on all nodes
once the cluster forms.
In non-cluster mode on node 1, recompute the checksum and set the gen-
eration number to INIT_VERSION for CCR table file www on the
local node:
# ccradm recover -Z global ccrtablefile
In non-cluster mode on node 2, recompute the checksum and set the gen-
eration number to OVRD_VERSION for CCR table file xxx on the
local node:
# ccradm recover -Z global -o ccrtablefile
Example 3.
In this example, in order to carry out emergency repairs
the administrator wants to replace the current contents
of ccrtablefile with the contents from a backup file.
In cluster mode, replace the CCR table yyy with the contents
of its backup version in the file /etc/cluster/ccr/yyy.bak:
# ccradm replace -Z global -i /etc/cluster/ccr/global/yyy.bak yyy
TABLE OPERATIONS
In cluster mode, create a CCR table foo in the global cluster.
# ccradm addtab foo
To create a CCR table foo in zonecluster zc1
# ccradm addtab -Z zc1 foo
To remove a CCR table foo in the global cluster.
# ccradm remtab foo
To modify a CCR table key value in the global cluster
# ccradm modify-key -f /tmp/data1 -k key1 ccrtablefile
# ccradm modify-key -s "NewValue" -k key1 ccrtablefile
To display a CCR table key value in the global cluster
# ccradm show-key -k key1 ccrtablefile
ValueForKey1
#
EXIT STATUS
The following exit values are returned:
0 No errors occurred.
>0 Error occurred.
EINVAL Invalid argument, such as a value string with white space
ESPIPE The specified key does not exist in ccrtablefile
ENOENT The specified file does not exist
Monday, October 18, 2010
Subscribe to:
Comments (Atom)
