redhat-sap / sap-hana-deployment

Deploys SAP HANA on the given hosts
Apache License 2.0
13 stars 20 forks source link

Define syntax for scale-out cluster / scale-up cluster #12

Closed rhmk closed 1 year ago

rhmk commented 4 years ago

The goal is to deploy Hana scaleout with the same role. The difference is one parameter: --add_hosts="hana2:role=worker,hana3:role=worker,hana4:role=standby"

It would be nice if we can define the complete cluster name my_hana_cluster in one file in group_vars/my_hana_cluster

and the inventory looks like

[my_hana_cluster]
hana1
hana2
hana3
hana4
rhmk commented 4 years ago

The solution approach would be to introduce the following variables:

sap_hana_preconfigure_primary_host: host1
sap_hana_preconfigure_add_hosts:
  - hana2:role=worker
  - hana3:role=worker 
  - hana4:role=standby

The variables are defined as unset/empty in the defaults/main.yml

compile the add_host variable back in an additional parameter --add_hosts="hana2:role=worker,hana3:role=worker,hana4:role=standby"

In the role then following decisions can be executed like this run a module when: sap_hana_preconfigure_primary host == sap_hostname or sap_hana_preconfigure_primary_host is unset

CAUTION: We cannot cover a cluster extension or exchange of a broken node with that

rhmk commented 4 years ago

Another possible option would be to create the inventory with role variables:

[my_hana_cluster]
hana1 scaleout_role=primary
hana2 scaleout_role=worker
hana3 scaleout_role=worker
hana4 scaleout_role=standby

then it could be easier to extend if possible, the when statement to execute install is: when scaleout_role is undefined or scaleout_role == "primary"

Drawback: it is more difficult to compile the add_hosts parameter: You get the names of the group, but maybe not of particular variables

berndfinger commented 2 years ago

Hi @rhmk - Would the solution I proposed in https://github.com/berndfinger/sap-hana-deployment/commit/c5ec9616544f42009d4547feac40693502844e74 solve this problem? You just would have to provide a supported argument to the --addhosts parameter, which then would be copied as it is into the configfile.