Skip to content

Commit 7e1c6cf

Browse files
authored
Merge pull request #57 from varkoly/SLE-15-SP6
Check if HANA DB is running on the nodes
2 parents ef41271 + 7abdefc commit 7e1c6cf

10 files changed

+40
-5
lines changed

package/yast2-sap-ha.changes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
-------------------------------------------------------------------
2+
Mon Feb 3 13:18:25 UTC 2025 - Peter Varkoly <varkoly@suse.com>
3+
4+
- yast sap_ha should check if HDB is running on primary
5+
(bsc#1235773) Build in a check if the DB is running on both nodes.
6+
- 4.6.5
7+
18
-------------------------------------------------------------------
29
Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly <varkoly@suse.com>
310

package/yast2-sap-ha.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
Name: yast2-sap-ha
20-
Version: 4.6.4
20+
Version: 4.6.5
2121
Release: 0
2222
BuildArch: noarch
2323
Source0: %{name}-%{version}.tar.bz2

src/data/sap_ha/help_prereq_hana_su_co.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ <h3>SAP HANA System Replication Scale Up: Cost-Optimized</h3>
55
There are two machines with SAP HANA installed.
66
<br/> Note that the machine you run the wizard on becomes the primary node in the cluster.
77
</li>
8+
<li>Verify that both databases are up and running.</li>
89
<li>
910
You have created one of the following:
1011
<ul type="square">

src/data/sap_ha/help_prereq_hana_su_co_azure.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ <h3>SAP HANA System Replication Scale Up: Cost-Optimized in Microsoft&reg; Azure
1818
There are two machines with SAP HANA installed.
1919
<br/> Note that the machine you run the wizard on becomes the primary node in the cluster.
2020
</li>
21+
<li>Verify that both databases are up and running.</li>
2122
<li>
2223
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.
2324
</li>

src/data/sap_ha/help_prereq_hana_su_mt.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ <h3>SAP HANA System Replication Scale Up: Multi-Tier</h3>
55
There are two machines with SAP HANA installed.
66
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
77
</li>
8+
<li>Verify that both databases are up and running.</li>
89
<li>
910
You have created one of the following:
1011
<ul type="square">

src/data/sap_ha/help_prereq_hana_su_mt_azure.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ <h3>SAP HANA System Replication Scale Up: Multi-Tier in Microsoft&reg; Azure&reg
1818
There are two machines with SAP HANA installed.
1919
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
2020
</li>
21+
<li>Verify that both databases are up and running.</li>
2122
<li>
2223
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.
2324
</li>

src/data/sap_ha/help_prereq_hana_su_po.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ <h3>SAP HANA System Replication Scale Up: Performance-Optimized</h3>
55
There are two machines with SAP HANA installed.
66
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
77
</li>
8+
<li>Verify that both databases are up and running.</li>
89
<li>
910
You have created one of the following:
1011
<ul type="square">

src/data/sap_ha/help_prereq_hana_su_po_azure.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ <h3>SAP HANA System Replication Scale Up: Performance-Optimized in Microsoft&reg
1818
There are two machines with SAP HANA installed.
1919
<br> Note that the machine you run the wizard on becomes the primary node in the cluster.
2020
</li>
21+
<li>Verify that both databases are up and running.</li>
2122
<li>
2223
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.
2324
</li>

src/lib/sap_ha/configuration/hana.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def configured?
118118
def validate(verbosity = :verbose)
119119
SemanticChecks.instance.check(verbosity) do |check|
120120
check.hana_is_installed(@system_id, @global_config.cluster.all_nodes)
121+
check.hana_is_running(@system_id, @instance, @global_config.cluster.all_nodes)
121122
check.ipv4(@virtual_ip, "Virtual IP")
122123
check.nonneg_integer(@virtual_ip_mask, "Virtual IP mask")
123124
check.integer_in_range(@virtual_ip_mask, 1, 32, "CIDR mask has to be between 1 and 32.",

src/lib/sap_ha/semantic_checks.rb

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,33 @@ def hana_is_installed(value, nodes)
282282
end
283283
if status != 0
284284
flag = false
285-
message += "No SAP HANA #{value} is installed on #{node}\n"
285+
message += "<br>No SAP HANA #{value} is installed on #{node}"
286286
end
287287
end
288288
end
289-
report_error(flag, message, 'SID', value)
289+
report_error(flag, message, '', '')
290+
end
291+
292+
def hana_is_running(system_id, instance_number, nodes)
293+
flag = true
294+
message = ''
295+
my_ips = SapHA::System::Network.ip_addresses
296+
procname = "hdb.sap#{system_id.upcase}_HDB#{instance_number}"
297+
if @no_test
298+
nodes.each do |node|
299+
log.debug("node #{node} #{my_ips}")
300+
if my_ips.include?(node)
301+
status = exec_status("pidof", procname)
302+
else
303+
status = exec_status("ssh", "-o", "StrictHostKeyChecking=no", node, "pidof", procname)
304+
end
305+
if status != 0
306+
flag = false
307+
message += "<br>No SAP HANA #{system_id} is running on #{node}"
308+
end
309+
end
310+
end
311+
report_error(flag, message, '', '')
290312
end
291313

292314
# Check if string is a block device
@@ -368,11 +390,10 @@ def error_string(field_name, explanation, value = nil)
368390
explanation = explanation[0..-2] if explanation.end_with? "."
369391
explanation = explanation
370392
if field_name.empty?
371-
"Invalid input: #{explanation}"
393+
"Error detected: #{explanation}"
372394
elsif value.nil? || (value.is_a?(::String) && value.empty?)
373395
"Invalid entry for #{field_name}: #{explanation}."
374396
else
375-
376397
"Invalid entry for #{field_name} (\"#{ERB::Util.html_escape(value)}\"): #{explanation}."
377398
end
378399
end

0 commit comments

Comments
 (0)