SAPHanaSR-showAttr(8)

NAME
SAPHanaSR-showAttr - Shows Linux cluster attributes for SAP HANA system replication.

SYNOPSYS
SAPHanaSR-showAttr [ --help | --version ]
SAPHanaSR-showAttr [ --sid=SID[:INO] ] [ --sort=FIELD ] [ --cib=OFFLINE_CIB_FILE ]

DESCRIPTION
SAPHanaSR-showAttr shows Linux cluster attributes for SAP HANA system replication automation. The overall system replication (SR) state is shown as well as the HANA state on each node. If the HANA srHook method srConnectionChanged() is configured, the respective information is shown as well. The information is fetched from the Linux cluster information base (CIB), not from HANA directly.

The output shows the following section:

Hosts section
    Linux hostname (Hosts)
    state of the Linux cluster resource (clone_state)
    last primary timestamp (lpt_<sid>_lpt)
    state of the Linux cluster node (node_state)
    HANA SR operations mode (op_mode)
    HANA SR remote host (remoteHost)
    actual and configured roles for HANA on that node (roles)
    actual master score on that node (score)
    HANA site where the host sits (site)
    HANA SR mode (srmode)
    maintenance state of Linux cluster node (standby)
    HANA SR status (sync_state)
    HANA version (version)
    HANA virtual host name (vhost)

Some fields are generated dynamically from the CIB. That fields might be missing, if no corresponding attribute exists, e.g. the standby field. An incomplete compilation on field details and purpose follows below.

Hosts - Linux hostname Value: [ HOSTNAME ] See also the fields remoteHost and vhost.

clone_state - state of the Linux cluster resource Value: [ PROMOTED | DEMOTED | UNDEFINED | WAITING4PRIM | WAITING4NODES | WAITING4REG ] This variable is set by the SAPHana resource agent.
PROMOTED marks the master state of the instance, wich makes a HANA SR primary.
DEMOTED makes a HANA SR secondary. The DEMOTED state can be transient, on the way to promoting.
WAITING4PRIM indicates potential risk of a dual primary situation. See section DUPLICATE_PRIMARY_TIMEOUT of ocf_suse_SAPHana(7) and ocf_suse_SAPHanaController(7).

lpa_lpt - last primary timestamp Value: [ UNIX_EPOCH | 30 | 10 ] The node attribute lpa_<sid>_lpt is set by the SAPHana resource agent. When the RA detects a running HANA SR primary on the node, it records the Unix Epoch time. See section DUPLICATE_PRIMARY_TIMEOUT of ocf_suse_SAPHana(7) and ocf_suse_SAPHanaController(7).
Auxiliary values are set for an HANA SR secondary. 30 means the instance is evictable for primary. 10 means: not yet ready.

node_state - state of the Linux cluster node Value: [ online | offline ]

op_mode - HANA SR operations mode Value: [ logreplay | delta_datashipping | logreplay_readaccess ] The node attribute hana_<sid>_op_mode is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHana resource agent for setting up system replication. delta_datashipping is not recommended in the context of Linux clusters.

remoteHost - HANA SR remote host Value: [ HOSTNAME ] The node attribute hana_<sid>_remoteHost is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHana resource agent for setting up system replication. See also the fields Hosts and vhost.

roles - actual and configured roles for HANA on that node The roles field in the Hosts section has up to six sub-fields.
Field 1: return code
Value: [ 4 | 3 | 2 | 1 | 0 ]
This parameter does not tell you if the secondary system is ready for a takeover. The meaning is different from common Linux return codes.
4 = OK - Everything looks perfect on the HANA primary.
3 = WARNING - A HANA Host Auto-Failover is taking place.
2 = INFO - The landscape is completely functional, but the actual role of the host differs from the configured role.
1 = DOWN - There are not enough active hosts.
0 = FATAL - Internal script error, the state could not be determined.
see landscapeHostConfiguration.py
Field 2: HANA SR role
Value: [ "P"rimary | "S"econdary ]
Field 3: NameServer Config Role
Value: [ master1 | master2 | master3 | worker | slave | standby | shtdown ]
Field 4: NameServer Actual Role
Value: [ master | slave | standby | shtdown ]
Field 5: IndexServer Config Role
Value: [ master1 | master2 | master3 | worker | slave | standby | shtdown ]
Field 6: IndexServer Actual Role
Value: [ master | worker | slave | standby | shtdown ]
The sub-fields 3-6 are primarily useful for HANA scale-out. For scale-up that four fields should be master1:master:worker:master.

score - actual master score on that node Value: [ 150 | 140 | 100 | 90 | 80 | 60 | 0 | -1 | -INFINITY ] This is a variable of the SAPHana resource agent. It is calculated based on an internal scoring table. A value of 150 should cause the Linux cluster promoting the local resource instance to HANA SR primary. This field should not be empty.

site - HANA site where the host sits Value: [ HANA_SITE ] The node attribute hana_<sid>_site is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHana resource agent for setting up system replication. A dash (-) indicates the RA did not run or did not recognize the site.

srmode - HANA SR mode Value: [ sync | syncmem ] The node attribute hana_<sid>_srmode is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHana resource agent for setting up system replication. SAP HANA knows also async and fullsync (see URLs below). Those do not make sense for automating HANA system replication by an Linux cluster.

standby - maintenance state of Linux cluster node Value: [ on | off ] This is a Linux Cluster node attribute. It is set by an admin. The attribute is shown after it has been changed from the default. The field might appear or disappear, depending on cluster maintenance tasks.

sync_st and sync_state - HANA SR status Value: [ SOK | SFAIL | SWAIT | PRIM ] The cluster property sync_state is set by the SAPHana resource agent. The first three values are representing an HANA system replication status, recognized at latest RA run, see ocf_suse_SAPHana(7) and systemReplicationStatus.py .
The 4th value (PRIM) just indicates an HANA SR primary.

version - HANA version Value: [ HANA_VERSION ] Version of the HANA instance on that node. Of course, should be supported for the given Linux version. Should be same on all nodes, except during specific HANA upgrade procedure.

vhost - HANA virtual hostname Value: [ HANA_VIRT_HOSTNAME ] The virtual hostname is used by the HANA instance instead of Linux hostname. The node attribute hana_<sid>_vhost is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHana resource agent for setting up system replication. See also the fields Hosts and remoteHost. SAPHanaToplogy needs the SAPHOSTAGENT to map from the local hostname to the HANA virtual hostname.

OPTIONS

--help
        show help.

--version
        show version.

--sid=SID[:INO]
    use SAP system ID SID. Should be autodetected, if there is only one SAP HANA instance installed on the local cluster node. The SAP system ID is a three character alphanum string with a valid SAP system name like SLE, HAE, FH1, C11 or P42. Some strings are not allowed, e.g. SAP.
Optional: Use SAP instance number INO. Should be autodetected, if there is only one SAP HANA instance installed on the local cluster node. The SAP instance number must be represented by a two digit numer like 00, 05 or 42. Some numbers are not allowed, e.g. 98.

--sort=FIELD
    sort Hosts section table by field. Allowed values: roles, site. The default sort is by hostnames.

--cib=OFFLINE_CIB_FILE
    read data from given offline CIB file.

RETURN CODES
0 Successful program execution.
>0 Usage, syntax or execution errors.

EXAMPLES

# SAPHanaSR-showAttr --sort roles
    show all SAPHanaSR attributes in the cluster and sort host table output by roles.

# SAPHanaSR-showAttr --sid=HA1:10 --cib=./hb_report-17-07-2019/grauenstein01/cib.xml
    show all SAPHanaSR attributes for SAP system ID HA1 and instance number 10 from given CIB file.

FILES

/usr/sbin/SAPHanaSR-showAttr
        the program itself.

/usr/lib/SAPHanaSR-ScaleOut/SAPHanaSRTools.pm
        needed functions.

/usr/sap/hostctrl/exe/saphostctrl
        the SAP host control command.

BUGS
Formatting and content of this script's output will change, since this script is under development. This script is not intended to be called from monitoring tools. For monitoring please use SAPHanaSR-monitor instead. Feedback is welcome, please mail to feedback@suse.com.

SEE ALSO
ocf_suse_SAPHana(7) , ocf_suse_SAPHanaTopology(7) , SAPHanaSR(7) , ocf_suse_SAPHanaController(7) , SAPHanaSR-ScaleOut(7) , SAPHanaSR-monitor(8) , SAPHanaSR-replay-archive(8) , crm_simulate(8) , cibadmin(8) , crm_mon(8) , cs_convert_time(8) , cs_show_hana_info(8) ,
https://www.suse.com/products/sles-for-sap/resource-library/sap-best-practices.html ,
https://www.susecon.com/doc/2015/sessions/TUT19921.pdf ,
https://wiki.scn.sap.com/wiki/display/SAPHANA/System+Replication ,
https://help.sap.com/viewer/6b94445c94ae495c83a19646e7c3fd56/2.0.02/en-US/123f2c8579fd452da2e7debf7cc2bd93.html ,
https://help.sap.com/viewer/6b94445c94ae495c83a19646e7c3fd56/2.0.03/en-US/c039a1a5b8824ecfa754b55e0caffc01.html ,
https://help.sap.com/viewer/6b94445c94ae495c83a19646e7c3fd56/2.0.03/en-US/627bd11e86c84ec2b9fcdf585d24011c.html

AUTHORS
F.Herschel, L.Pinne.

COPYRIGHT
(c) 2014 SUSE Linux Products GmbH, Germany.
(c) 2015-2019 SUSE LLC
SAPHanaSR-showAttr comes with ABSOLUTELY NO WARRANTY.
For details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html