User Tools

Site Tools


cobi.wms:hana_proxy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cobi.wms:hana_proxy [2022/10/31 11:44] – [Update] tkammercobi.wms:hana_proxy [2023/11/21 19:55] (current) tkammer
Line 2: Line 2:
  
 The HANA Proxy is needed if you want the app to make direct database connections to HANA.  For example, if you use HANA on-premises or in a private cloud and you want the app to connect to the [[Management Database]] that you created on the HANA server. The HANA Proxy is needed if you want the app to make direct database connections to HANA.  For example, if you use HANA on-premises or in a private cloud and you want the app to connect to the [[Management Database]] that you created on the HANA server.
 +
 +**WARNING:  The communication between the Android App and HANA Proxy is NOT encrypted.  You should only be using it within an internal network, or through a VPN tunnel that encrypts all traffic.**
  
 The Proxy is a very small Java program with an accompanying systemd service unit to allow for easy installation as a service on a GNU/Linux distribution.  Typically it is installed on the same server as HANA. The Proxy is a very small Java program with an accompanying systemd service unit to allow for easy installation as a service on a GNU/Linux distribution.  Typically it is installed on the same server as HANA.
Line 12: Line 14:
  
 <code bash> <code bash>
-v=1.5.1+version=1.7.0  # Don't forget to set this variable! It's used in the following commands.
 cd /root cd /root
-wget https://docs.cobisoft.de/wiki/_media/cobi.wms/hanaproxy-$v.tar +wget https://docs.cobisoft.de/wiki/_media/cobi.wms/hanaproxy-$version.tar 
-tar -xf hanaproxy-$v.tar +tar -xf hanaproxy-$version.tar 
-ln -s hanaproxy-$hanaproxy+ln -s hanaproxy-$version hanaproxy
 systemctl enable /root/hanaproxy/hanaproxy.service systemctl enable /root/hanaproxy/hanaproxy.service
 +systemctl start hanaproxy
 </code> </code>
  
-After that, you should be able to start it and check its status to make sure it's running:+The ''systemctl enable'' command makes sure that the service will be started on a reboot, and the ''systemctl start'' command starts it right now.  You can check its status with the following command to make sure it started properly:
  
 <code bash> <code bash>
-systemctl start hanaproxy 
 systemctl status hanaproxy systemctl status hanaproxy
 </code> </code>
  
-The ''status'' command should say ''active (running)'' in green text.+The output should say ''active (running)'' in green text.
  
 ===== Control / Monitor ===== ===== Control / Monitor =====
Line 47: Line 49:
  
 <code bash> <code bash>
-v=1.5.1+version=1.7.0
 cd /root cd /root
-wget https://docs.cobisoft.de/wiki/_media/cobi.wms/hanaproxy-$v.tar +wget https://docs.cobisoft.de/wiki/_media/cobi.wms/hanaproxy-$version.tar 
-tar -xf hanaproxy-$v.tar+tar -xf hanaproxy-$version.tar
 rm hanaproxy rm hanaproxy
-ln -s hanaproxy-$hanaproxy+ln -s hanaproxy-$version hanaproxy
 systemctl daemon-reload systemctl daemon-reload
 systemctl restart hanaproxy systemctl restart hanaproxy
 </code> </code>
  
-===== Troubleshoot =====+===== Troubleshooting =====
  
-If you suspect that HANA Proxy may not be working properly even though it is running, you can test a few things.+If you suspect that HANA Proxy may not be working properly even though it is running, you can test a few things.  Note that some of these instructions are quite technical and require some IT knowledge.
  
-First of all see if it'reachable from another machine.  Let's say the IP Address of the HANA server is ''192.168.16.30'' The port used by HANA Proxy is ''30075'' Using Nmap, we can try:+==== TCP Port Probing ==== 
 + 
 +First of all, test if HANA Proxy is reachable from another machine.  Let's say the IP Address of the HANA server is ''192.168.16.30'' The port used by HANA Proxy by default is ''30075'' Using [[https://nmap.org/|Nmap]], we can try:
  
 <code bash> <code bash>
Line 67: Line 71:
 </code> </code>
  
-On MS Windows you could also use ''Test-NetConnection'' aka ''tnc'' instead of Nmap:+On MS Windowsyou could also use ''Test-NetConnection'' aka ''tnc'' instead of Nmap:
  
 <code powershell> <code powershell>
Line 75: Line 79:
 If the port doesn't seem open, a firewall could be blocking the connection. If the port doesn't seem open, a firewall could be blocking the connection.
  
-Once you've made sure that the port itself is reachable, you can test if HANA Proxy can execute queries.  This can be done with a ''netcat'' utility.  If you have Nmap installed, you should have the ''ncat'' command which can do this, otherwise if you're on a GNU/Linux distro you should also have a simple ''nc'' tool that is capable enough.+==== Test Query ====
  
-First copy the following HANA Proxy command into a text file, let's say ''hptest.json'', with the correct password in place of "secret":+Once you've made sure that the port itself is reachable, you can test if HANA Proxy can execute queries.  This can be done with a ''netcat''-style program.  If you have Nmap installed, you should have the ''ncat'' command.  Otherwise, if you're on a GNU/Linux distro, you should have an ''nc'' command that is capable enough. 
 + 
 +**Note:** It's important that the ''netcat'' implementation you're using executes a TCP shutdown command after it's done sending data.  The ''nc'' command which is available on SuSE Linux Enterprise Server by default doesn't do this, unless you provide the ''-N'' command-line switch. 
 + 
 +Firstcopy the following HANA Proxy command into a text file, let's say ''hptest.json'', with the correct password in place of "secret":
  
 <code json> <code json>
Line 89: Line 97:
 </code> </code>
  
-(The host can be "localhost" when the HANA Proxy is running on the same server as the HANA database.  Port ''30015'' is default for HANA.  The ''SYSTEM'' user should have permissions to query any database.)+The host can be "localhost" when the HANA Proxy is running on the same server as the HANA database; otherwise, it will have to be the IP address or hostname of the HANA server.  Port ''30015'' is default for HANA.  Note that this example queries ''SBOCOMMON'' for testing purposes; COBI.wms never actually queries the ''SBOCOMMON'' database.
  
-Now you can send the command to HANA Proxy with the following command:+Now you can send the command to HANA Proxy with the following command, assuming that ''192.168.16.30'' is the IP address of the server on which HANA Proxy is installed:
  
 <code bash> <code bash>
Line 97: Line 105:
 </code> </code>
  
-The results of the queryor at least an error messageshould be returned in JSON format.+Alternatively, if you're running this command directly on the SLES/HANA serverand using the default ''nc'' tool found on ityou can run this command instead: 
 + 
 +<code bash> 
 +nc -N localhost 30075 < hptest.json 
 +</code>
  
 +When you execute the command, the results of the query (or at least an error message) should be returned in JSON format.
cobi.wms/hana_proxy.1667213092.txt.gz · Last modified: 2022/10/31 11:44 by tkammer

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki