Linux FailSafe Administration Tools This chapter describes Linux FailSafe administration tools and their operation. The major sections in this chapter are as follows: The Linux FailSafe Cluster Manager Tools Cluster Manager GUI See Linux FailSafe Cluster Manager GUI GUI See Linux FailSafe Cluster Manager GUIYou can perform the Linux FailSafe administrative tasks using either of the following tools: The Linux FailSafe Cluster Manager Graphical User Interface (GUI) The Linux FailSafe Cluster Manager Command Line Interface (CLI) Although these tools use the same underlying software to configure and monitor a Linux FailSafe system, the GUI provides the following additional features, which are particularly important in a production system: Online help is provided with the Help button. You can also click any blue text to get more information about that concept or input field. The cluster state is shown visually for instant recognition of status, problems, and failovers. The state is updated dynamically for continuous system monitoring. All inputs are checked for correct syntax before attempting to change the cluster database information.In every task, the cluster configuration will not update until you click OK. Tasks and tasksets take you step-by-step through configuration and management operations, making actual changes to the cluster database as the you perform a task. The graphical tools can be run securely and remotely on any computer that has a Java virtual machine, including Windows® computers and laptops. The Linux FailSafe Cluster Manager CLI, on the other hand, is more limited in its functions. It enables you to configure and administer a Linux FailSafe system using a command-line interface only on a Linux system. It provides a minimum of help or formatted output and does not provide dynamic status except when queried. An experienced Linux FailSafe administrator may find the Cluster Manager CLI to be convenient when performing basic Linux FailSafe configuration tasks, isolated single tasks in a production environment, or when running scripts to automate some cluster administration tasks. Using the Linux FailSafe Cluster Manager GUI Linux FailSafe Cluster Manager GUISee Linux FailSafe Cluster Manager GUI Linux FailSafe Cluster Manager GUIoverviewThe Linux FailSafe Cluster Manager GUI lets you configure, administer, and monitor a cluster using a graphical user interface.To ensure that the required privileges are available for performing all of the tasks, you should log in to the GUI as root. However, some or all privileges can be granted to any user by the system administrator using the Privilege Manager, part of the Linux Interactive Desktop System Administration (sysadmdesktop ) product. For more information, see the Personal System Administration Guide. The Cluster Manager GUI consists of the FailSafe Cluster View and the FailSafe Manager and its tasks and tasksets.These interfaces are described in the following sections. The FailSafe Cluster View The FailSafe Cluster View window provides the following capabilities: Shows the relationships among the cluster items (nodes, resources groups, etc.) Gives access to every item's configuration and status details Shows health of the cluster Gives access to the FailSafe Manager and to the SYSLOG Gives access to Help information From the FailSafe Cluster View, the user can click on any item to display key information about it. The items that can be viewed in this way are the following: Clusters Cluster Nodes Resource Types Resources Resource Groups Failover Policies The FailSafe Manager FailSafe Manager overviewThe FailSafe Manager provides access to the tasks that help you set up and administer your highly available cluster. The FailSafe Manager also provides access to the FailSafe Guided Configuration tasksets. Tasksets consist of a group of tasks collected together to accomplish a larger goal. For example, “Set Up a New Cluster” steps you through the process for creating a new cluster and allows you to launch the necessary tasks by simply clicking their titles. FailSafe tasksets let you set up and monitor all the components of a Linux FailSafe cluster using an easy-to-use graphical user interface. Starting the FailSafe Manager GUI You can start the FailSafe Manager GUI by launching either the FailSafe Manager or the FailSafe Cluster View. To launch the FailSafe Manager, use one of these methods: Choose “FailSafe Manager” from the desktop (KDE or GNOME) menu. KDE menus —> Applications —> FailSafe Manager You will need to restart the desktop panel after installing Linux FailSafe to see the FailSafe entry in the appropriate menu. To restart the panel, right-click (ring-click) on the panel, and select restart. In order for this to take effect, the sysadm_failsafe_client package must be installed on the client system. Enter the following command line: % /usr/bin/fstask In your Web browser, enter http://server /FailSafeManager/ (where server is the name of node in the pool or cluster that you want to administer) and press Enter. At the resulting Web page, click on the shield icon. You can use this method of launching FailSafe Manager if you want to administer the Cluster Manager GUI from a non-Linux system. If you are running the Cluster Manager GUI on a Linux system, the preferred method is to use the desktop panel menu or /usr/bin/fstask. This method of launching FailSafe Manager works only if you have installed the Java Plug-in, exited all Java processes, restarted your browser, and enabled Java. If there is a long delay before the shield appears, you can click on the “non plug-in” link, but operational glitches may be the result of running in the browser-specific Java. To launch the FailSafe Cluster View, use one of these methods Choose "FailSafe Manager" from the desktop (KDE or GNOME) menu. You must restart the desktop panel after installingLinux FailSafe to see the FailSafe entry in the appropriate menu. To restart the panel, right-click (ring-click) on the panel, and select restart. In order for this to take effect, the sysadm_failsafe-client package must be installed on the client system. Enter the following command line:% /usr/bin/fsdetail The Cluster Manager GUI allows you to administer the entire cluster from a single point of administration. When Linux FailSafe daemons have been activated in a cluster, you must be sure to connect to a node that is running all the Linux FailSafe daemons to obtain the correct cluster status. When Linux FailSafe daemons have not yet been activated in a cluster, you can connect to any node in the pool. Opening the FailSafe Cluster View window You can open the FailSafe Cluster View window using either of the following methods: Click the “FailSafe Cluster View“ button at the bottom of the FailSafe Manager window. This is the preferred method of opening the FailSafe Cluster View window if you will have both the FailSafe Manager and the FailSafe Cluster View windows open at the same time, since it reuses the existing Java process to open the second window instead of starting a new one, which saves memory usage on the client. Open the FailSafe Cluster View window directly when you start the FailSafe Manager GUI, as described above in . Viewing Cluster Item Details To view the details on any cluster item, use the following procedure: Open the FailSafe Cluster View Window. Click the name or icon of any item. The configuration and status details will appear in a separate window. To see the details in the same window, select Options. When you then click on the Show Details option, the status details will appear in the right side of the window. Performing Tasks FailSafe Cluster Manager GUI active guidesTo perform an individual task with the FailSafe GUI, do the following: Click the name of a category in the left-hand column of the FailSafe Manager window. A list of individual tasksets and taskset topics appears in the right-hand column. Click the title of a task in the right-hand column. The task window appears. You can click any blue text to get more information about that concept or input field. Enter information in the appropriate fields and click OK. to complete the task. (Some tasks consist of more than one window; in these cases, click Next to go to the next window, complete the information there, and then click OK. A dialog box appears confirming the successful completion of the task and displaying additional tasks that you can launch. Continue launching tasks as needed. Using the Linux FailSafe Tasksets Linux FailSafe Cluster Manager GUItasksetsThe FailSafe Manager GUI also provides tasksets to guide you through the steps necessary to complete a goal that encompasses several different tasks. Follow these steps to access the Linux FailSafe tasksets: Click the Guided Configuration category in the lefthand column of the FailSafe Manager window. A list of tasksets appears in the right-hand column. Click a taskset in the right-hand column. A window appears and lists the series of tasks necessary to accomplish the desired goal. Follow the steps shown, launching tasks by clicking them. As you click a task, its task window appears. After you complete all of the tasks listed, you can close the taskset window by double-clicking the upper left corner of its window or clicking Close if there is a Close button on the window. Using the FailSafe Cluster Manager CLI This section documents how to perform cluster administrative tasks by means of the FailSafe Cluster Manager CLI. In order to execute commands with the FailSafe Cluster Manager CLI, you should be logged in as root. To use the cluster manager, enter either of the following: # /usr/lib/failsafe/bin/cluster_mgr or # /usr/lib/failsafe/bin/cmgr After you have entered this command, you should see the following message and the cluster manager CLI command prompt: Do you want it to say” Linux FailSafe Cluster Manager”? It currently says: Welcome to SGI Cluster Manager Command-Line Interface cmgr> Once the command prompt displays, you can enter the cluster manager commands. At any time, you can enter ? or help to bring up the CLI help display. When you are creating or modifying a component of a Linux FailSafe system, you can enter either of the following commands: cancel Abort the current mode and discard any changes you have made. done Commit the current definitions or modifications and return to the cmgr prompt. Entering CLI Commands Directly FailSafe Cluster Manager CLI -c option FailSafe Cluster Manager CLIcommand line execution There are some Cluster Manager CLI command that you can execute directly from the command line, without entering cmgr mode, by using the -c option of the cluster_mgr command. These commands are show, delete, admin, install,  start, stop, test, help, and quit. You can execute these commands directly using the following format: cluster_mgr -c "command" For example, you can execute a show clusters CLI command as follows: % /usr/lib/failsafe/bin/cluster_mgr -c "show clusters" 1 Cluster(s) defined   eagan Invoking the Cluster Manager CLI in Prompt Mode FailSafe Cluster Manager CLI -p option FailSafe Cluster Manager CLIprompt mode CLI See FailSafe Cluster Manager CLI Cluster Manager CLI See FailSafe Cluster Manager CLIThe Cluster Manager CLI provides an option which displays prompts for the required inputs of administration commands that define and modify Linux FailSafe components. You can run the CLI in prompt mode in either of the following ways: Specify a -p option when you enter the cluster_mgr (or cmgr) command, as in the following example: # /usr/lib/failsafe/bin/cluster_mgr -p Execute a set prompting on command after you have brought up the CLI, as in the following example: cmgr> set prompting on This method of entering prompt mode allows you to toggle in and out of prompt mode as you execute individual CLI commands. To get out of prompt mode while you are running the CLI, enter the following CLI command: cmgr> set prompting For example, if you are not in the prompt mode of the CLI and you enter the following command to define a node, you will see a single prompt, as indicated: cmgr> define node A Enter commands, when finished enter either "done" or "cancel" A? At this prompt, you enter the individual node definition commands in the following format (for full information on defining nodes, see ): set hostname to B set nodeid to C set sysctrl_type to D set sysctrl_password to E set sysctrl_status to F set sysctrl_owner to G set sysctrl_device to H set sysctrl_owner_type to I add nic J Then, after you add a network interface, a prompt appears requesting the parameters for the network interface, which you enter similarly. If you are running CLI in prompt mode, however, the display appears as follows (when you provide the appropriate inputs): cmgr> define node A Enter commands, when finished enter either "done" or "cancel" Node Name [A]? Hostname? Node ID [0]? Sysctrl Type <chalL|msc|mmsc>? Sysctrl Password [ ]? Sysctrl Status <enabled|disabled>? Sysctrl Owner? Sysctrl Device? Sysctrl Owner Type <tty> ? Number of Controllers [2]? Controller IP Address? Controller Heartbeat HB (use network for heartbeats) <true|false>? Controller (use network for control messages) <true|false>? Controller Priority <1,2,...>? Using Input Files of CLI Commands FailSafe Cluster Manager CLI -f option FailSafe Cluster Manager CLIusing input files You can execute a series of Cluster Manager CLI commands by using the -f option of the cluster_mgr command and specifying an input file: /usr/lib/failsafe/bin/cluster_mgr -f "input_file " The input file must contain Cluster Manager CLI commands and end with a quit command. For example, the file input.file contains the following: show clusters show nodes in cluster beta3 quit You can execute the following command, which will yield the indicated output: % /usr/lib/failsafe/bin/cluster_mgr -f input.file 1 Cluster(s) defined   eagan Cluster eagan has following 2 machine(s)   cm1   cm2 The cluster_mgr command provides a -i option to be used with the -f option. This is the “ignore” option which indicates that the Cluster Manager should not exit if a command fails while executing a script. CLI Command Scripts command scripts FailSafe Cluster Manager CLI command scriptsYou can use the -f option of the cluster_mgr command to write a script of Cluster Manager CLI commands that you can execute directly. The script must contain the following line as the first line of the script. #!/usr/lib/failsafe/bin/cluster_mgr -f When you use the -i option of the cluster_mgr command to indicate that the Cluster Manager should not exit if a command fails while executing a script, you must use the following syntax in the first line of the script file: #!/usr/lib/failsafe/bin/cluster_mgr -if. It is not necessary to use the -if syntax when using the -i option from the command line directly. Each line of the script must be a valid cluster_mgr command line, similar to a here document. Because the Cluster Manager CLI will run through commands as if entered interactively, you must include done and quit lines to finish a multi-level command and exit out of the Cluster Manager CLI. There are CLI template files of scripts that you can modify to configure the different components of your system. These files are located in the /usr/lib/failsafe/cmgr-templates directory. For information on CLI templates, see . The following shows an example of a CLI command script cli.script . % more cli.script #!/usr/lib/failsafe/bin/cluster_mgr -f show clusters show nodes in cluster beta3 quit % cli.script 1 Cluster(s) defined   eagan Cluster eagan has following 2 machine(s)   cm1   cm2 % For a complete example of a CLI command script that configures a cluster, see in . CLI Template Scripts template files FailSafe Cluster Manager CLI template files cmgr-templates directoryTemplate files of CLI scripts that you can modify to configure the different components of your system are located in the /usr/lib/failsafe/cmgr-templates directory. Each template file contains list of cluster_mgr commands to create a particular object, as well as comments describing each field. The template also provides default values for optional fields. The /usr/lib/failsafe/cmgr-templates directory contains following templates: Available Templates File name Description cmgr-create-cluster Creation of a cluster cmgr-create-failover_policy Creation of failover policy cmgr-create-node Creation of node cmgr-create-resource_group Creation of Resource Group cmgr-create-resource_type Creation of resource type cmgr-create-resource- resource type CLI script template for creation of resource of type resource type
To create a Linux FailSafe configuration, you can concatenate multiple templates into one file and execute the resulting CLI command script. If you concatenate information from multiple template scripts to prepare your cluster configuration, you must remove the quit at the end of each template script, except for the final quit. A cluster_mgr script must have only one quit line. For example: For a 3 node configuration with an NFS resource group containing 1 volume, 1 filesystem, 1 IP address and 1 NFS resource, you would concatenate the following files, removing the quit at the end of each template script except the last one: 3 copies of the cmgr-create-node file 1 copy of the cmgr-create-cluster file 1 copy of the cmgr-create-failover_policy file 1 copy of the cmgr-create-resource_group file 1 copy of the cmgr-create-resource-volume file 1 copy of the cmgr-create-resource-filesystem file 1 copy of the cmgr-create-resource-IP_address file 1 copy of the cmgr-create-resource-NFS file
Invoking a Shell from within CLI FailSafe Cluster Manager CLI invoking a shell You can invoke a shell from within the Cluster Manager CLI. Enter the following command to invoke a shell: cmgr> sh To exit the shell and to return to the CLI, enter exit at the shell prompt.