### Example: Bring node2 online Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=operations-online-node An example command to bring the node named node2 online. ```bash clvt online node node2 ``` -------------------------------- ### NETWORK_UP_LOCAL Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=tests-network-up-local-node-network-comments An example of the NETWORK_UP_LOCAL command syntax, specifying the node, network, and a user-defined comment. ```text NETWORK_UP_LOCAL, node6, hanet1, Start hanet1 on node 6 ``` -------------------------------- ### cllssvcpprc command usage examples Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=clusters-cllssvcpprc-command Examples showing how to list all resources, a specific resource, and formatted output. ```bash [/usr/es/sbin/cluster/svcpprc/cmds]> cllssvcpprc< HASVC1 ``` ```bash [/usr/es/sbin/cluster/svcpprc/cmds]> cllssvcpprc -n HASVC1 svcpprc_consistencygrp PrimaryCluster AuxiliaryCluster relationships HASVC1 svc78 svc9A svcrel1 ``` ```bash [/usr/es/sbin/cluster/svcpprc/cmds]> cllssvcpprc -n HASVC1 -ca #NAME:PRIMARY:AUXILIARY:RELATIONSHIPS HASVC1:svc78:svc9A:svcrel1 ``` -------------------------------- ### cl_getsite Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-getsite-routine Example demonstrating how to call cl_getsite and handle the returned status code. ```c int clusterid = 1113325332; int status; int siteid = 1; struct cl_site site; status = cl_getsite(clusterid, siteid, &site); if (status == CLE_OK) { printf("site %s (%d) has %d nodes and is priority %d\n", site.clsite_name, site.clsite_id, site.clsite_numnodes, site.clsite_priority); } else { cl_perror(status,"can't get site information"); } ``` -------------------------------- ### Application Controller Start Script Option Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=program-smit-general-application-smart-assist-modify-stanzas Configuration for the required application start script path. ```text sm_cmd_opt: id_seq_num = "40" id = "clsa_gasa_modify_opts" disc_field_name = "start" name = "Application Controller Start Script" name_msg_file = "cluster.cat" name_msg_set = 43 name_msg_id = 4 op_type = "" entry_type = "t" entry_size = 256 required = "+" prefix = "-R" cmd_to_list_mode = "" cmd_to_list = "" cmd_to_list_postfix = "" multi_select = "" value_index = 0 disp_values = "" values_msg_file = "" values_msg_set = 0 values_msg_id = 0 aix_values = "" help_msg_id = "30,4" help_msg_loc = "cluster_hlp.cat" help_msg_base = "" help_msg_book = "" ``` -------------------------------- ### cl_getsitebypriority usage example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-getsitebypriority-routine An example demonstrating how to call cl_getsitebypriority and check the returned status. ```c enum cl_site_priority priority = CL_SITE_PRI_PRIMARY; int clusterid = 1113325332; int status; struct cl_site site; status = cl_getsitebypriority(clusterid, priority, &site); if (status == CLE_OK) printf("site %s (%d) has %d nodes and is priority %d\n", site.clsite_name, site.clsite_id, site.clsite_numnodes, site.clsite_priority); ``` -------------------------------- ### Example: Bring node2 offline Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=operations-offline-node An example command to bring node2 offline. ```bash Clvt offline node node2 ``` -------------------------------- ### Check and start clinfoES Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=problems-snmp-based-status-commands-issues Verify if the clinfoES daemon is running and start it if necessary. ```bash lssrc -s clinfoES ``` ```bash startsrc -s clinfoES ``` -------------------------------- ### Example: Bind interface to network Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=operations-modify-interface An example showing how to bind the interface named mylabel to the network ether2. ```bash clvt modify interface mylabel NETWORKNAME=ether2 ``` -------------------------------- ### CL_cluster::CL_getallinfo Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-clustercl-getallinfo-routine Example demonstrating how to initialize the cluster object, call CL_getallinfo, and iterate through the returned node information. ```cpp CL_cluster cluster; CL_status status; CL_node nodes[8]; CL_node *ret = &nodes[0]; int numnodes; cluster.clc_clusterid = 1113325332; numnodes = cluster.CL_getallinfo(ret, status); if (status < 0) { cl_perror(status, progname); } else { printf("number of nodes in cluster: %d\n", numnodes); for (int i=0; iclsite_clusterid); for (i=0; isin6_addr), addr, INET6_ADDRSTRLEN); } ``` -------------------------------- ### CL_netif::CL_isavail6 usage example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-netifcl-isavail6-routine Example demonstrating how to initialize a CL_netif object and call the CL_isavail6 routine to check interface availability. ```cpp CL_status status; CL_netif netif; char *addr = "fe80::1"; netif.cli_clusterid = 1113325332; strcpy(netif.cli_name.name, "geotest9"); netif.cli_addr6.sin6_family = AF_INET6; inet_pton (AF_INET6, addr, &(((struct sockaddr_in6 *)&netif.cli_addr6)->sin6_addr)); strcpy(netif.cli_nodename.name, "node1"); status = netif.CL_isavail6(); if (status < 0) { cl_perror(status,"netif.CL_isavail6 failed"); } printf("status = %d\n", status); ``` -------------------------------- ### Examples of query resource_group usage Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=class-query-resource-group Examples showing how to list all resource groups and how to query the detailed attributes of a specific resource group named RG1. ```bash clvt query resource_group rg1 rg2 rg3 clvt query resource_group RG1 DISK= "hdisk3" EXPORT_FILESYSTEM="/FSa1" FALLBACK="FBHPN" FALLOVER="FNPN" FILESYSTEM="/FSa1" FORCED_VARYON="false" FSCHECK_TOOL="fsck" FS_BEFORE_IPADDR="true" MOUNT_FILESYSTEM="/mnt1;/FSa1" NAME="RG1" NFS_NETWORK="" NODES="regaa11 regaa12" RECOVERY_METHOD="sequential" SERVICE_LABEL="alias_svc1" SSA_DISK_FENCING="false" STARTUP="OHN" STATE="" VG_AUTO_IMPORT="true" VOLUME_GROUP="vg1" ``` -------------------------------- ### Example configuration for agentAddress property Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=configuring-restricting-use-ip-address-in-gui A practical example showing how to map multiple cluster IDs and their respective node labels to specific IP addresses in the configuration-server.json file. ```json “agentAddress” : { “1358561171” { “nodeA”: “192.168.10.123”, “nodeB”: “192.168.10.127” }, “1351137691” { “MyNode”: “192.168.10.214”, “YourNode” : “192.168.10.226” } }, ``` -------------------------------- ### Example /etc/hosts configuration Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=61-prerequisites-migrating-from-powerha-systemmirror Example format for /etc/hosts entries where the FQDN resolvable long name is placed next to the IP address. ```text 1.1.1.1 node111.xxx.yyy.com node111 1.1.1.2 node222.xxx.yyy.com node222 ``` -------------------------------- ### CL_netif::CL_getifaddr Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-netifcl-getifaddr-routine Example demonstrating how to initialize a CL_netif object, call CL_getifaddr, and handle the returned status and address. ```cpp CL_status status; CL_ifaddr ifaddr; CL_netif netif; char cbuf[CL_ERRMSG_LEN]; netif.cli_clusterid = 1113325332; strcpy(netif.cli_name.name, "geotest9"); ifaddr = netif.CL_getifaddr(status); if (status < 0) { cl_errmsg(status); } else { printf("ifaddr = %s\n", inet_ntoa(ifaddr.sin_addr)); } ``` -------------------------------- ### Delete network example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=operations-delete-network An example command to delete a network named ether1 from the cluster. ```bash clvt delete network ether1 ``` -------------------------------- ### Delete application controller example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=use-delete-application Example command to delete the application controller named MyApp. ```bash clvt delete application MYApp ``` -------------------------------- ### CL_netif::CL_getnodeaddr6 Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-netifcl-getnodeaddr6-routine Example demonstrating how to initialize a CL_netif object, call CL_getnodeaddr6, and handle the returned status and address. ```cpp CL_status status; CL_netif netif; CL_ifaddr6 ifaddr; char cbuf[CL_ERRMSG_LEN]; char *addr; netif.cli_clusterid = 1113325332; strcpy(netif.cli_name.name, "geotest9"); ifaddr = netif.CL_getnodeaddr6(status); if (status < 0) { cl_errmsg(status); } else { printf("ifaddr = %s\n", inet_ntop(AF_INET6, &((struct sockaddr_in6 *) &ifaddr->sin6_addr), addr, INET6_ADDRSTRLEN); } ``` -------------------------------- ### CL_cluster::CL_getgroupinfo Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-clustercl-getgroupinfo-routine Example demonstrating how to initialize the cluster ID, call CL_getgroupinfo, and iterate through the returned resource group information. ```cpp CL_status status; CL_cluster cluster; CL_group groups[MAXGROUPS]; int numgroups; cluster.clc_clusterid = 1113325332; numgroups = cluster.CL_getgroupinfo(&groups[0], status); if (status < 0) { cl_perror(status, progname); } else { printf("There are %d groups in cluster %d\n", numgroups, cluster.clc_clusterid); for (int i=0; i lshostvol.sh ``` -------------------------------- ### Example syslog configuration entries Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=cluster-aix-files-modified-by-powerha-systemmirror Sample entries for syslog configuration files defining log destinations and rotation policies. ```text mail.debug /usr/spool/mqueue/syslog *.debug /dev/console *.crit * *.debug /tmp/syslog.out rotate size 100k files 4 *.crit /tmp/syslog.out rotate time 1d local0.crit /dev/console local0.info /var/hacmp/adm/cluster.log user.notice /var/hacmp/adm/cluster.log daemon.notice /var/hacmp/adm/cluster.log ``` -------------------------------- ### cl_isnodeavail Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-isnodeavail-routine An example demonstrating how to call cl_isnodeavail and handle the returned status code. ```c int clusterid = 1113325332; int status; char nodename[CL_MAXNAMELEN] = "node1"; status = cl_isnodeavail (clusterid, nodename); if (status != CLE_OK) { cl_perror(status,"node is unavailable"); } else { printf ("node %s on cluster %d is available\n", nodename, clusterid); } ``` -------------------------------- ### cl_getsitebyname Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-getsitebyname-routine An example demonstrating how to call cl_getsitebyname and check the returned status before accessing the site structure fields. ```c int clusterid = 1113325332; int status; char sitename[CL_MAXNAMELEN] = "geo9"; struct cl_site site; status = cl_getsitebyname(clusterid, sitename, &site); if (status == CLE_OK) printf("site %s (%d) has %d nodes and is priority %d\n", site.clsite_name, site.clsite_id, site.clsite_numnodes, site.clsite_priority); ``` -------------------------------- ### Sample rsyslog.conf entries Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=cluster-aix-files-modified-by-powerha-systemmirror Example configuration entries for the /etc/rsyslog.conf file. ```text aso.notice /var/log/aso/aso.log aso.info /var/log/aso/aso_process.log aso.debug /var/log/aso/aso_debug.log caa.debug;caa. /var/adm/ras/syslog.caa .info /var/adm/ras/syslog.txt local0.info;user.notice;daemon.notice /var/hacmp/adm/cluster.log ``` -------------------------------- ### CL_netif::CL_getnodeaddr Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-netifcl-getnodeaddr-routine Example demonstrating how to initialize a CL_netif object, call CL_getnodeaddr, and handle the returned status and IP address. ```cpp CL_status status; CL_netif netif; CL_ifaddr ifaddr; char cbuf[CL_ERRMSG_LEN]; netif.cli_clusterid = 1113325332; strcpy(netif.cli_name.name, "geotest9"); ifaddr = netif.CL_getnodeaddr(status); if (status < 0) { cl_errmsg(status); } else { printf("ifaddr = %s\n", inet_ntoa(ifaddr.sin_addr)); } ``` -------------------------------- ### CL_group::CL_getinfo Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=cca-cl-groupcl-getinfo-routine Example demonstrating how to initialize a CL_group object with a cluster ID and name, call CL_getinfo, and handle the returned status. ```cpp CL_status status; CL_group group; CL_group ret; group.clg_clusterid = 1113325332; strcpy(group.clg_name.name, "rg01"); ret = group.CL_getinfo(status); if (status < 0) { cl_perror(status, progname); } else { printf("There are %d nodes in group %s\n", ret.clg_num_nodes, ret.clg_name.name); } ``` -------------------------------- ### cllsrelationship command usage examples Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=clusters-cllsrelationship-command Examples showing how to list all relationships, retrieve details for a specific relationship, and display output in a colon-delimited format. ```bash [/usr/es/sbin/cluster/svcpprc/cmds]> cllsrelationship svcrel1 [/usr/es/sbin/cluster/svcpprc/cmds]> cllsrelationship -n svcrel1 relationship_name PrimaryVdisk_info AuxiliaryVdisk_info svcrel1 c48f1rp06_075@svc78 c48f2rp08_095@svc9A [/usr/es/sbin/cluster/svcpprc/cmds]> cllsrelationship -n svcrel1 -c #RELATIONSHIP:PRIMARYVDISK:AUXVDISK svcrel1:c48f1rp06_075@svc78:c48f2rp08_095@svc9A ``` -------------------------------- ### CL_node::CL_isavail Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-nodecl-isavail-routine An example demonstrating how to initialize a CL_node object with a cluster ID and node name, then check its availability using CL_isavail. ```cpp CL_status status; CL_node node; node.cln_clusterid = 1113325332; strcpy(node.cln_nodename.name, "node1"); status = node.CL_isavail(); printf("status = %d\n", status); ``` -------------------------------- ### CL_cluster::CL_getprimary Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-clustercl-getprimary-routine Example demonstrating how to initialize a CL_cluster object, call CL_getprimary, and handle the returned status. ```cpp CL_cluster cluster; CL_status status; CL_nodename name; cluster.clc_clusterid = 1; name = cluster.CL_getprimary(status); if (status < 0) { cl_errmsg(status); } else { printf( "cluster %d's primary node is %s\n", cluster.clc_clusterid, cluster.clc_primary.name); } ``` -------------------------------- ### netmon.cf configuration for specific adapter targets Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=conditions-virtual-networks-in-powerha-systemmirror This example demonstrates how to define availability for specific adapters using hostnames and IP addresses as targets. ```text !REQD host1.ibm 100.12.7.9 !REQD host1.ibm host4.ibm !REQD 100.12.7.20 100.12.7.10 !REQD 100.12.7.20 host5.ibm !REQD 100.12.7.20 host5.ibm 8080 NO_PING ``` -------------------------------- ### NODE_DOWN_TAKEOVER command example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=tests-node-down-takeover-node-comments An example of the NODE_DOWN_TAKEOVER command used to gracefully stop cluster services on node4 with a provided comment. ```text NODE_DOWN_TAKEOVER, node4, Bring down node4 gracefully with takeover ``` -------------------------------- ### Launch SMIT for PowerHA Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=configuration-discovering-configuring-db2-resources Start the SMIT interface for PowerHA SystemMirror configuration. ```bash smit hacmp ``` -------------------------------- ### CL_netif::CL_getifname6 Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-netifcl-getifname6-routine Example demonstrating how to retrieve an interface name using a cluster ID and node name. ```cpp // CL_netif::CL_getifname get interfacename given clusterid and nodename CL_status status; char cbuf[CL_ERRMSG_LEN]; CL_ifname ifname; CL_netif netif; netif.cli_addr6.sin6_addr.s6_addr = NULL; netif.cli_clusterid = 1113325332; strcpy (netif.cli_nodename.name, "node1"); ifname = netif.CL_getifname6(status); if (status < 0) { cl_errmsg(status); } else { printf("ifname = %s\n", ifname.name); } ``` -------------------------------- ### cl_perror Implementation Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=utilities-cl-perror-routine A practical example showing how to use cl_perror to handle an error returned by the cl_getnode function. ```c struct cl_node nodebuf; int clusterid = 99999999; /* invalid cluster id */ int status; char nodename[CL_MAXNAMELEN]; if ( (status = cl_getnode (clusterid, nodename, &nodebuf)) < 0 ) { cl_perror(status, "can't get node information"); } ``` -------------------------------- ### CL_getclusterid Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-clustercl-getclusterid-routine Example demonstrating how to initialize a cluster object, call CL_getclusterid, and handle the returned status. ```cpp CL_cluster cluster; CL_status status; CL_clusterid clusterid; char cbuf[CL_ERRMSG_LEN]; strcpy(cluster.clc_name.name, "site1"); clusterid = cluster.CL_getclusterid(status); if (status < 0) { cl_errmsg(status); } else { printf("clusterid = %d\n", clusterid); } } ``` -------------------------------- ### Example clcomd.log output Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=files-logging-clcomd Sample output from the clcomd.log file, showing daemon startup, connection attempts, and discovery process entries. ```text Wed May 7 12:43:13 2003: Daemon was successfully started Wed May 7 12:44:10 2003: Trying to establish connection to node temporarynode0000001439363040 Wed May 7 12:44:10 2003: Trying to establish connection to node temporarynode0000002020023310 Wed May 7 12:44:10 2003: Connection to node temporarynode0000002020023310, success, 192.0.24.4-> Wed May 7 12:44:10 2003: CONNECTION: ACCEPTED: test2: 192.0.24.4->192.0.24.4 Wed May 7 12:44:10 2003: WARNING: /usr/es/sbin/cluster/etc/rhosts permissions must be -rw------- Wed May 7 12:44:10 2003: Connection to node temporarynode0000001439363040: closed Wed May 7 12:44:10 2003: Connection to node temporarynode0000002020023310: closed Wed May 7 12:44:10 2003: CONNECTION: CLOSED: test2: 192.0.24.4->192.0.24.4 Wed May 7 12:44:11 2003: Trying to establish connection to node test1 Wed May 7 12:44:11 2003: Connection to node test1, success, 192.0.24.4->192.0.24.5 Wed May 7 12:44:11 2003: Trying to establish connection to node test3. ``` -------------------------------- ### cl_getcluster Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-getcluster-routine An example demonstrating how to call cl_getcluster, check the return status, and access fields within the returned cl_cluster structure. ```c int clusterid = 1113325332; int status; struct cl_cluster cluster; status = cl_getcluster(clusterid, &cluster); if (status != CLE_OK) { cl_perror(status, "Can't get cluster information"); } else { printf("cluster id: printf("cluster name: printf("state= %d [%s]\n", cluster.clc_state, get_state(cluster.clc_state)); printf("substate= printf("primary= < printf("nodes= %d, sites= %d, groups= %d, networks= %d\n", cluster.clc_number_of_nodes, cluster.clc_number_of_sites, cluster.clc_number_of_groups, cluster.clc_number_of_networks); } ``` -------------------------------- ### CL_netif::CL_getclusterid6 usage examples Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-netifcl-getclusterid6-routine Examples demonstrating how to retrieve a cluster ID using either a network interface name or an IPv6 address. ```cpp CL_status status; CL_clusterid clid; CL_netif netif; strcpy(netif.cli_name.name, "geotest9"); netif.cli_addr6.sin6_addr.s6_addr = NULL; clid = netif.CL_getclusterid6(status); if (status < 0) { cl_errmsg(status); } else { printf("clusterid = %d\n", clid); } // example using interface address CL_status status; CL_clusterid clusterid; CL_netif netif; char *addr = "fe80::1”; ((struct sockaddr_in6)netif.cli_addr6).sin6_family = AF_INET6; inet_pton (AF_INET6, addr, &(((struct sockaddr_in6 *)&netif.cli_addr6)->sin6_addr)); netif.cli_name.name[0] = NULL; clusterid = netif.CL_getclusterid6(status); if (status < 0) { cl_errmsg(status); } else { printf("clusterid = %d\n", clusterid); } ``` -------------------------------- ### Output of SRCsubsys configuration Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=cluster-aix-files-modified-by-powerha-systemmirror Example output showing the path to the enabled syslog daemon. ```text SRCsubsys: subsysname = "syslogd" synonym = "" cmdargs = "" path = "/usr/sbin/rsyslogd" <<<< rsyslogd is enabled uid = 0 auditid = 0 standin = "/dev/console" standout = "/dev/console" standerr = "/dev/console" action = 1 multi = 1 contact = 3 svrkey = 0 svrmtype = 0 priority = 20 signorm = 0 sigforce = 0 display = 1 waittime = 20 grpname = "ras" ``` -------------------------------- ### Create a JFS file system Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=commands-cli-crfs-command Example command to create a JFS file system on an existing logical volume named lv01. ```bash cli_crfs -v jfs -d lv01 -m /tstvg -a 'size=32768' ``` -------------------------------- ### Example usage of cl_getnodenamebyifaddr Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-getnodenamebyifaddr-routine Demonstrates how to initialize the address structure and call cl_getnodenamebyifaddr to retrieve a node name. ```C int clusterid = 1113325332; int status; char nodename[CL_MAXNAMELEN]; struct sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr ("9.57.28.23"); status = cl_getnodenamebyifaddr (clusterid, &addr, nodename); if (status !=CLE_OK) { cl_perror(status,"can't get node name"); } else { printf("node name of interface w/ address %s on cluster %d is %s\n", inet_ntoa(addr.sin_addr), clusterid, nodename); } ``` -------------------------------- ### Add a process monitor named pmon1 Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=class-add-application-monitor Example command to add a process-based application monitor. ```bash clvt add application monitor pmon1 APPLICATIONSERVERNAME="appserver1" MONITORMODE="longrunning" FAILUREACTION="notify" PROCESSMONITORS="pmon1." PROCESSOWNER="" INSTANCECOUNT="5" STABILIZATION="50" RESTARTCOUNT="5" RESTARTINTERVAL="50" NOTIFYMETHOD="" ``` -------------------------------- ### cl_ccv_comparator example comparing resource groups Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=commands-cl-ccv-comparator-command Example command that compares resource group configuration between two clusters and writes the result to a user-defined output file. The -d rg flag limits comparison to resource groups, and -o specifies the output file. ```shell cl_ccv_comparator --f1 /home/cluster1.json --f2 /home/cluster2.json -d rg -o /var/hacmp/log/rg_comparison_data.json ``` -------------------------------- ### CL_netif::CL_getifname example: get interface name from cluster ID and node name Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-netifcl-getifname-routine Shows how to call CL_getifname with a cluster ID and node name. It sets cli_addr.sin_addr.s_addr to NULL, sets the cluster ID and node name, then calls the routine. If the status is negative, it prints an error message; otherwise it prints the interface name. ```cpp // CL_netif::CL_getifname get interfacename given clusterid and nodename CL_status status; char cbuf[CL_ERRMSG_LEN]; CL_ifname ifname; CL_netif netif; netif.cli_addr.sin_addr.s_addr = NULL; netif.cli_clusterid = 1113325332; strcpy (netif.cli_nodename.name, "node1"); ifname = netif.CL_getifname(status); if (status < 0) { cl_errmsg(status); } else { printf("ifname = %s\n", ifname.name); } ``` -------------------------------- ### Start Cluster Services SMIT panel Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=groups-configure-powerha-systemmirror-receive-handle-snmp-traps The initial SMIT panel for starting cluster services where the Startup Cluster Information Daemon field is accessed. ```text Start Cluster Services Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Start now, on system restart or both now + Start Cluster Services on these nodes [A2] + * Manage Resource Groups Automatically + BROADCAST message at startup? true + Startup Cluster Information Daemon? false + Ignore verification errors? false + Automatically correct errors found during Interactively + cluster start? F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do ``` -------------------------------- ### cl_getnodeaddr Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-getnodeaddr-routine An example demonstrating how to call cl_getnodeaddr and handle the returned status code, including printing the retrieved address on success or an error message on failure. ```c int clusterid = 1113325332; int status; char* interfacename = "geotest9"; struct sockaddr_in addr; status = cl_getnodeaddr(clusterid, interfacename, &addr); if (status != CLE_OK) { cl_perror(status, "can't get node addr"); } else { printf("address of interface %s on cluster %d is %s\n", interfacename, clusterid, inet_ntoa(addr.sin_addr)); } ``` -------------------------------- ### netmon.cf configuration for all adapters and specific overrides Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=conditions-virtual-networks-in-powerha-systemmirror This example shows how to use the !ALL keyword to apply targets to all adapters, while also specifying an additional target for a specific adapter and a health check override. ```text !REQD !ALL 100.12.7.9 !REQD !ALL 110.12.7.9 !REQD !ALL 111.100.1.10 !REQD en1 9.12.11.10 !REQD 100.12.7.20 host5.ibm 8080 NO_PING ``` -------------------------------- ### Remove all information about MyApp Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=query-clrmsaapp-command Example command to remove all information associated with the application named MyAPP. ```text Clrmsaapp -a MyAPP ``` -------------------------------- ### cl_registereventnotify, cl_unregistereventnotify, and cl_getevent usage example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-registereventnotify-routine This example demonstrates registering for a SIGUSR1 signal notification for a FAILING_NETWORK event on node2 of cluster 83. It includes setting up a signal handler, waiting for the event, retrieving event details, and unregistering. ```c #include #include #include #include volatile int no_signal = 1; /* Signal handler for catching event notification signal */ void catch_sig(int sig) { no_signal = 0; } int main(int argc, char *argv[]) { int ret_code, i; struct cli_enr_req_t en_req; /* Event notification request */ struct cli_en_msg_t en_msg; /* Event notification message */ en_req.event_id = CL_FAILING_NETWORK; /* specify a failing network event */ en_req.cluster_id = 83; strcpy (en_req.node_name,"node2"); en_req.net_id = 1; /* no net id necessary for this event */ en_req.signal_id = SIGUSR1;/* Request to register for event notification */ if(ret_code = cl_registereventnotify((int) 1, &en_req)!=CLE_OK ) { printf("cl_en_test: cl_registereventnotify failed with error exit(1); } /* Set up a signal handler to catch the event notification signal from Clinfo */ ret_code = signal(SIGUSR1, catch_sig); if ( ret_code < 0 ){ perror("cl_en_test"); exit(1); } /* Wait for signal */ printf("cl_en_test: waiting for signal from Clinfo."); while (no_signal){ pause();} /* Execution will start here after catch_sig executes when the signal is received. Get the event notification message. */ if ( ret_code = cl_getevent(&en_msg) != CLE_OK ) { printf("cl_en_test: cl_getevent failed with error %d.", ret_code); exit(1); } /* Print out the event notification information received */ printf("cl_en_test: Event notification message received from Clinfo:"); printf("cl_en_test: Event id = %d", en_msg.event_id); printf("cl_en_test: Cluster id = %d", en_msg.cluster_id); printf("cl_en_test: Node name = %s", en_msg.node_name); printf("cl_en_test: Net id = %d", en_msg.net_id); /* Request to unregister the event notification */ if ( (ret_code = cl_unregistereventnotify((int) 1,&en_req))!=CLE_OK) { printf("cl_en_test: cl_unregistereventnotify failed with error %d.", ret_code); exit(1); } } ``` -------------------------------- ### Run the clchipdev utility Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=networks-configuring-application-service-interface Execute the sample utility to configure the application service interface. ```bash /usr/es/sbin/cluster/samples/appsvclabel/clchipdev ``` -------------------------------- ### SSA_FENCE process_resources execution log Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=processing-job-type-ssa-fence Example log output showing the initiation of the SSA_FENCE job type within the process_resources script. ```text :process_resources[1476] clRGPA FENCE :clRGPA[48] [[ high = high ]] :clRGPA[55] clrgpa FENCE :clRGPA[56] exit 0 :process_resources[1476] eval JOB_TYPE= SSA_ FENCE ACTION= ACQUIRE HDISKS=" hdisk6" RESOURCE_GROUPS=" conc_ rg1 " HOSTS=" electron" :process_ resources[1476] JOB_TYPE= SSA_FENCE ACTION= ACQUIRE HDISKS= hdisk6 RESOURCE_GROUPS= conc_rg1 HOSTS=electron :process_ resources[1478] RC= 0 :process_ resources[1479] set +a :process_ resources[1481] [ 0 -ne 0 ] :process_ resources[1675] export GROUPNAME= conc_ rg1 conc_ rg1 :process_ resources[1676] process_ ssa_ fence ACQUIRE ``` -------------------------------- ### Add a custom monitor named cmon1 Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=class-add-application-monitor Example command to add a custom script-based application monitor. ```bash clvt add application monitor cmon1 APPLICATIONSERVERNAME="appserver1" MONITORMODE="longrunningandstartup" MONITORMETHOD="/script/to/monitor" MONITORINTERVAL="1024" HUNGSIGNAL="60" STABILIZATION="3600" RESTARTCOUNT="100" RESTARTINTERVAL="2400" FAILUREACTION="fallover" ``` -------------------------------- ### Example usage of cl_getclusteridbyifname Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=api-cl-getclusteridbyifname-routine Demonstrates how to call the routine and handle potential error status codes. ```c int clusterid; char interfacename[CL_MAXNAMELEN] = "geotest9"; clusterid = cl_getclusteridbyifname (interfacename); if (clusterid < 0) { cl_perror (clusterid, "can't get cluster id"); } else { printf ("cluster id w/ interface named %s is %d\n", interfacename, clusterid); } ``` -------------------------------- ### Create the certificates directory Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=configuring-enabling-third-party-certificate Create the directory to store certificate files. ```bash mkdir /tmp/certificates ``` -------------------------------- ### Add physical partitions to lv01 Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=commands-cli-mklvcopy-command Example command to increase the total number of copies to three for the logical volume named lv01. ```bash cli_mklvcopy lv01 3 ``` -------------------------------- ### Example output for listing LDAP users Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=cluster-listing-aix-ldap-users-all-nodes This output displays the user account information retrieved when specifically listing LDAP users in the cluster. ```text COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear. [TOP] daemon 1/etc bin 2/bin sys 3/usr/sys adm 4/var/adm uucp 5/usr/lib/uucp guest 100 /home/guest nobody -2 / lpd 9/ nuucp 6/var/spool/uucppublic [MORE...18] ``` -------------------------------- ### Display node-centric report from a start date Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=commands-cl-availability-command Uses -n and -b to filter events starting from a specific date. ```bash cl_availability -n ALL -b 2019-11-01T10:26 ``` -------------------------------- ### cl_perror Usage Example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=utilities-cl-perror-routine An example of calling cl_perror with a specific error code and message, followed by the resulting output. ```c cl_perror(CLE_IVNODENAME, "Can't service this request"); ``` ```text Can't service this request:Illeagle Node Name. ``` -------------------------------- ### Usage example of cl_errmsg Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=utilities-cl-errmsg-routine Example demonstrating how to call cl_errmsg with a status code and handle the returned error message. ```c char *msg; msg = cl_errmsg(CLE_BADARGS); if (strcmp(msg, "Invalid status") != 0) { printf("CLE_BADARGS means %s", msg); } else { printf("Can't lookup CLE_BADARGS"); } ``` -------------------------------- ### clvt online node Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=operations-online-node Starts the Cluster Manager on the specified node. If the Cluster Manager is already started, the command is ignored. ```APIDOC ## clvt online node ### Description Starts the Cluster Manager on the specified node. If the Cluster Manager is already started, the command is ignored. ### Syntax ``` clvt online node _node_name_ ``` ### Parameters - **node_name** (string) - Required - Node to bring online. ### Required Objects - cluster - node ### Errors - The cluster is not defined - The node does not exist. ### Example To bring node2 online: ``` clvt online node node2 ``` ``` -------------------------------- ### Startup Cluster Information Daemon selection menu Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=groups-configure-powerha-systemmirror-receive-handle-snmp-traps The selection menu displayed after pressing F4 on the Startup Cluster Information Daemon field, showing options for enabling consistency group support. ```text Start Cluster Services Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Start now, on system restart or both now + Start Cluster Services on these nodes [A2] + BROADCAST message at startup? true + Startup Cluster Information Daemon? false + Ignore verification errors? false + ----------------------------------------------------------------- | Startup Cluster Information Daemon? | | | | Move cursor to desired item and press Enter. | | | | false | | true | | true with consistency group support | | | | F1=Help F2=Refresh F3=Cancel | F1| F8=Image F10=Exit Enter=Do | F5| /=Find n=Find Next | F9 ---------------------------------------------------------------- ``` -------------------------------- ### Navigate to the certificates directory Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=configuring-enabling-third-party-certificate Change the current working directory to the newly created certificates folder. ```bash cd /tmp/certificates ``` -------------------------------- ### clpasswd command example Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=commands-clpasswd-command An example of using the clpasswd command to change a password for a specific user within a resource group named rg1. ```bash clpasswd -g rg1 myusername ``` -------------------------------- ### List file systems Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=clusters-handy-aix-commands Displays all existing file systems on the system. ```bash lsfs ``` -------------------------------- ### View system CoD configuration Source: https://www.ibm.com/docs/en/powerha-aix/7.2.x?topic=availability-troubleshooting-roha View the systems CoD configuration. ```bash lscod ```