Skip to content

Commit

Permalink
Merge pull request #60 from varkoly/SLE-15-SP4
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 7, 2025
2 parents e7f0b19 + e1def48 commit 440c829
Show file tree
Hide file tree
Showing 10 changed files with 41 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 @@
-------------------------------------------------------------------
Thu Feb 6 08:58:53 UTC 2025 - Peter Varkoly <[email protected]>

- 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.
- 4.4.11

-------------------------------------------------------------------
Wed Jan 29 10:54:19 UTC 2025 - Peter Varkoly <[email protected]>

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: 4.4.10
Version: 4.4.11
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 @@ -118,6 +118,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
30 changes: 26 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,34 @@ 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}\n"
end
end
end
report_error(flag, message, 'SID', value)
report_error(flag, message, '', '')
end

# Check if a HANA db is running
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 +391,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 440c829

Please sign in to comment.