The Ansible Role sap_ha_install_hana_hsr is used to configure and enable SAP HANA System Replication between 2 nodes.
Managed nodes:
- Same Operating system version
- SAP HANA is installed with same version on both nodes.
It is recommended to execute this role together with other roles in this collection, in the following order:
- sap_general_preconfigure
- sap_hana_preconfigure
- sap_install_media_detect
- sap_hana_install
sap_ha_install_hana_hsr
- Assert that required inputs were provided.
- Verify connection between nodes.
- Update /etc/hosts, hdbuserstore, Log mode, PKI
- Execute database backup
- Configure SAP HANA System Replication
---
- name: Ansible Play for SAP HANA System Replication setup
hosts: hana_primary, hana_secondary
become: true
tasks:
- name: Execute Ansible Role sap_ha_install_hana_hsr
ansible.builtin.include_role:
name: community.sap_install.sap_ha_install_hana_hsr
vars:
sap_ha_install_hana_hsr_cluster_nodes:
- node_name: h01hana0
node_ip: "10.10.10.10"
node_role: primary
hana_site: DC01
- node_name: h01hana1
node_ip: "10.10.10.11"
node_role: secondary
hana_site: DC02
sap_ha_install_hana_hsr_sid: H01
sap_ha_install_hana_hsr_instance_number: "01"
sap_ha_install_hana_hsr_hdbuserstore_system_backup_user: "HDB_SYSTEMDB"
sap_ha_install_hana_hsr_db_system_password: "My_HANA_Password"
sap_ha_install_hana_hsr_domain: example.comFor more examples on how to use this role in different installation scenarios, refer to the ansible.playbooks_for_sap playbooks.
Apache 2.0
- Type:
string - Default:
present
Set the desired state of the HSR configuration.
present - Creates and enables the HSR configuration.
absent - Removes the HSR configuration.
Removal of existing configuration requires correctly configured sap_ha_install_hana_hsr_cluster_nodes.
- Type:
string
SAP HANA Database System ID (SID) in capital letters.
This can be inherited from the variable sap_hana_sid.
- Type:
string
SAP HANA Database Instance Number.
This can be inherited from the variable sap_hana_instance_number.
- Type:
listofdictionarytype
List of dictionaries defining the nodes in the HSR setup.
This can be inherited from the variable sap_hana_cluster_nodes.
- node_name
Short hostname of the node (String). - node_ip
IP address of the node (String). - node_role
Role of the node in the HSR setup (String).
Available options:primary,secondary. - hana_site
A unique logical site name (e.g., DC01, EU-WEST) (String).
Example:
sap_ha_install_hana_hsr_cluster_nodes:
- node_name: 'node01'
node_ip: '192.168.1.11'
node_role: 'primary'
hana_site: 'DC01'
- node_name: 'node02'
node_ip: '192.168.1.12'
node_role: 'secondary'
hana_site: 'DC02'- Type:
string - Default:
HDB_SYSTEMDB
The hdbuserstore key used for connecting to the SYSTEMDB for administrative tasks like backups.
- Type:
string
Password for the HANA SYSTEM user.
This can be inherited from the variable sap_hana_install_master_password.
- Type:
string
The DNS domain name for the HANA nodes.
This is not required if 'node_name' in sap_ha_install_hana_hsr_cluster_nodes is a Fully Qualified Domain Name (FQDN).
Originally called as sap_ha_install_hana_hsr_fqdn.
If not set, the role attempts to use the value of sap_domain or ansible_facts['domain'].
- Type:
string - Default:
sync
HSR Replication mode.
Available values: sync, syncmem, async
- Type:
string - Default:
logreplay
HSR Operation mode.
Available values: delta_datashipping, logreplay, logreplay_readaccess
- Type:
bool - Default:
True
Set to true to update /etc/hosts on all nodes with the IP addresses and hostnames of all other nodes in the cluster.
- Type:
string
(Optional) SAP HANA HOME directory path
If not set, it defaults to /usr/sap/<SID>/home.
- Type:
string
(Optional) Directory path for the safety backup created before HSR is configured.
If not specified, the default HANA backup location is used.
Required sub-directories (SYSTEMDB and DB_<SID>) will be created automatically within this path
The backup created will have a file prefix of <SID>_PRE_HSR_<TIMESTAMP>.