Skip to content

Commit

Permalink
Merge pull request #55 from varkoly/master
Browse files Browse the repository at this point in the history
Check if HANA DB is running on the nodes
  • Loading branch information
varkoly authored Feb 3, 2025
2 parents 875aa1e + 8f731e6 commit b8a9f82
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 5 deletions.
7 changes: 7 additions & 0 deletions package/yast2-sap-ha.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Feb 3 13:18:25 UTC 2025 - Peter Varkoly <varkoly@suse.com>

- yast sap_ha should check if HDB is running on primary
(bsc#1235773) Build in a check if the DB is running on both nodes.
- 6.0.4

-------------------------------------------------------------------
Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly <varkoly@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-sap-ha.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-sap-ha
Version: 6.0.3
Version: 6.0.4
Release: 0
BuildArch: noarch
Source0: %{name}-%{version}.tar.bz2
Expand Down
1 change: 1 addition & 0 deletions src/data/sap_ha/help_prereq_hana_su_co.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ <h3>SAP HANA System Replication Scale Up: Cost-Optimized</h3>
There are two machines with SAP HANA installed.
<br/> Note that the machine you run the wizard on becomes the primary node in the cluster.
</li>
<li>Verify that both databases are up and running.</li>
<li>
You have created one of the following:
<ul type="square">
Expand Down
1 change: 1 addition & 0 deletions src/data/sap_ha/help_prereq_hana_su_co_azure.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ <h3>SAP HANA System Replication Scale Up: Cost-Optimized in Microsoft&reg; Azure
There are two machines with SAP HANA installed.
<br/> Note that the machine you run the wizard on becomes the primary node in the cluster.
</li>
<li>Verify that both databases are up and running.</li>
<li>
The master node SSH public key is authorized for SSH access to the secondary node. This is needed when SSH password access is disabled, which is the default on Microsoft Azure.
</li>
Expand Down
1 change: 1 addition & 0 deletions src/data/sap_ha/help_prereq_hana_su_mt.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ <h3>SAP HANA System Replication Scale Up: Multi-Tier</h3>
There are two machines with SAP HANA installed.
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
</li>
<li>Verify that both databases are up and running.</li>
<li>
You have created one of the following:
<ul type="square">
Expand Down
1 change: 1 addition & 0 deletions src/data/sap_ha/help_prereq_hana_su_mt_azure.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ <h3>SAP HANA System Replication Scale Up: Multi-Tier in Microsoft&reg; Azure&reg
There are two machines with SAP HANA installed.
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
</li>
<li>Verify that both databases are up and running.</li>
<li>
The master node SSH public key is authorized for SSH access to the secondary node. This is needed when SSH password access is disabled, which is the default on Microsoft Azure.
</li>
Expand Down
1 change: 1 addition & 0 deletions src/data/sap_ha/help_prereq_hana_su_po.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ <h3>SAP HANA System Replication Scale Up: Performance-Optimized</h3>
There are two machines with SAP HANA installed.
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
</li>
<li>Verify that both databases are up and running.</li>
<li>
You have created one of the following:
<ul type="square">
Expand Down
1 change: 1 addition & 0 deletions src/data/sap_ha/help_prereq_hana_su_po_azure.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ <h3>SAP HANA System Replication Scale Up: Performance-Optimized in Microsoft&reg
There are two machines with SAP HANA installed.
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
</li>
<li>Verify that both databases are up and running.</li>
<li>
The master node SSH public key is authorized for SSH access to the secondary node. This is needed when SSH password access is disabled, which is the default on Microsoft Azure.
</li>
Expand Down
1 change: 1 addition & 0 deletions src/lib/sap_ha/configuration/hana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def configured?
def validate(verbosity = :verbose)
SemanticChecks.instance.check(verbosity) do |check|
check.hana_is_installed(@system_id, @global_config.cluster.all_nodes)
check.hana_is_running(@system_id, @instance, @global_config.cluster.all_nodes)
check.ipv4(@virtual_ip, "Virtual IP")
check.nonneg_integer(@virtual_ip_mask, "Virtual IP mask")
check.integer_in_range(@virtual_ip_mask, 1, 32, "CIDR mask has to be between 1 and 32.",
Expand Down
29 changes: 25 additions & 4 deletions src/lib/sap_ha/semantic_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,33 @@ def hana_is_installed(value, nodes)
end
if status != 0
flag = false
message += "No SAP HANA #{value} is installed on #{node}\n"
message += "<br>No SAP HANA #{value} is installed on #{node}"
end
end
end
report_error(flag, message, 'SID', value)
report_error(flag, message, '', '')
end

def hana_is_running(system_id, instance_number, nodes)
flag = true
message = ''
my_ips = SapHA::System::Network.ip_addresses
procname = "hdb.sap#{system_id.upcase}_HDB#{instance_number}"
if @no_test
nodes.each do |node|
log.debug("node #{node} #{my_ips}")
if my_ips.include?(node)
status = exec_status("pidof", procname)
else
status = exec_status("ssh", "-o", "StrictHostKeyChecking=no", node, "pidof", procname)
end
if status != 0
flag = false
message += "<br>No SAP HANA #{system_id} is running on #{node}"
end
end
end
report_error(flag, message, '', '')
end

# Check if string is a block device
Expand Down Expand Up @@ -368,11 +390,10 @@ def error_string(field_name, explanation, value = nil)
explanation = explanation[0..-2] if explanation.end_with? "."
explanation = explanation
if field_name.empty?
"Invalid input: #{explanation}"
"Error detected: #{explanation}"
elsif value.nil? || (value.is_a?(::String) && value.empty?)
"Invalid entry for #{field_name}: #{explanation}."
else

"Invalid entry for #{field_name} (\"#{ERB::Util.html_escape(value)}\"): #{explanation}."
end
end
Expand Down

0 comments on commit b8a9f82

Please sign in to comment.