Avamar: How to use the mapall tool
Summary: Avamar has a command-line tool called "mapall" which allows instructions to be issued to one or more nodes within the grid. This article explains how to use the tool.
Instructions
This article demonstrates how to use the Avamar mapall tool to issue commands from the utility node to other nodes.
The mapall tool can reach Avamar nodes which are defined in the probe.xml file.
These scripts are wrappers around the standard secure shell (ssh) tools (ssh) and secure copy protocol (SCP)) and are all written in Perl.
mapall- Sends a command to multiple nodes- SSN - A wrapper around ssh that accepts (physical) node numbers instead of IP addresses or hostname
- SCN - A wrapper around SCP, as above
See the following for more information: Avamar: How to Log in to an Avamar Server and Load Various Keys.
MAPALL:
Specifying which nodes to run the command on:
To run commands on select nodes only:
To run the <command> only on nodes 0.0, 0.2 and 0.3:
mapall --nodes=0.0,0.2,0.3 <command>
To run the <command> on all nodes apart from the utility node and 0.0:
mapall --nodes=all+,-0.s,0.0 <command>
Useful flags:
As with any Avamar command-line task, exercise caution when running.
-
--user=<username> : Specify the user on the remote system that runs the command. -
--verbose : Provides maximum information. -
--quiet : Disable all messages. -
--parallel : Runs the command on all nodes simultaneously. -
--noerror : Do not stop if an error occurs. (This flag should always be used) For legacy reasons, mapall command execution stops if an error occurs. -
--bg : Run the command in the background and does not wait for completion. -
--debug : Enable extended debugging information (for example, which nodes map to which IP addresses). -
--copy : Copies a file from the utility node to remote nodes. -
--get : Pulls a file to the utility node from remote nodes. -
--all : Issues the command on all the data nodes plus the utility node -
--all+ : Issues the command on all the nodes in probe.xml, including NDMP accelerator nodes, spare nodes so forth.
MAPALL Examples:
MAPALL GET: This is the inverse of the copy command.
Get the GSAN binary from each data node and copy it to the Avamar Utility Node to /home/admin/0.*/gsan:
mapall --noerror get 'gsan'
MAPALL COPY:
Copy the /etc/hosts file to /root/etc/hosts on each data node.
mapall --noerror --user=root copy 'etc/hosts'
mapall copy command creates a tarball containing the specified files.
scp to push the tarball to every node.
tarball in the users home directory.
Additional Information
SSN Examples:
Connect to node 0.1 and open an interactive shell.
ssn 0.1
Connect to node 0.2 and issue the date command.
ssn 0.2 'date'
SCN Examples:
Copy the /home/admin/gsan binary from node 0.1 to the btfix directory on the Avamar Utility Node.
scn 0.1:/home/admin/gsan ./btfix
Copy "testscript" from the utility node's /home/admin directory onto node 0.2 and place it as "runscript" in /data01/cur:
scn testscript 0.2:/data01/cur/runscript
scn command cannot be used to copy files from one data node to another data node.
Files would have to be copied using the utility node in a two-step operation, or alternatively, use
scp to transfer files directly between the two nodes.