Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 

Background:

 

I had to upgrade the HANA One (Developer Edition) in AWS from Rev 48 to Rev 56 as part of the openSAP Introduction to Software Development on SAP HANA class.

Rev 48 client setup:

My Win7, C:\Windows\system32\drivers\etc\hosts file had the entry, aa.bb.cc.dd     imdbhdb, where aa.bb.cc.dd is the Elastic IP of the HANA Instance in AWS. 

 

I added the system in HANA studio using the entries below:

     Hostname: imdbhdb

     Instance Number: 00

     DB User Name: SYSTEM

     Password: <your password>   

Rev 56 Error:

After the upgrade to Rev 56, the above setup resulted in the Error "Database connection is not available" within a few minutes after adding the system in the HANA Studio.

Problem Analysis:

I activated the JDBC trace as below for Rev 56 (See http://help.sap.com/hana_platform SAP HANA Developer's Guide):

JDBC would initially connect to the HANA server:

new Connection 'jdbc:sap://imdbhdb:30015'
locale=en_US
user=SYSTEM
password=***
timeout=0
reconnect=true
validateCertificate=false
encrypt=false
HOSTLIST: [imdbhdb:30015,]

After a few minutes, the JDBC connect string would be replaced by the internal IP of the AWS HANA server and the connection would fail: 
new Connection 'jdbc:sap://10.29.1.187:30015'
locale=en_US
user=SYSTEM
password=***
timeout=0
reconnect=true
validateCertificate=false
encrypt=false
HOSTLIST: [10.29.1.187:30015,]
new RTEException: -813 Cannot connect to host 10.29.1.187:30015 [Connection timed out: connect], -813.
whereAmIjava.lang.Throwable
at com.sap.db.util.Tracer.whereAmI(Tracer.java:348)
at com.sap.db.rte.comm.RTEException.<init>(RTEException.java:66)
at com.sap.db.rte.comm.SocketComm.openSocket(SocketComm.java:125)
at com.sap.db.rte.comm.SocketComm.<init>(SocketComm.java:58)
at com.sap.db.rte.comm.SocketComm$1.open(SocketComm.java:42)
at com.sap.db.jdbc.topology.Topology.getSession(Topology.java:145)
at com.sap.db.jdbc.Driver.openByURL(Driver.java:1016)
at com.sap.db.jdbc.Driver.connect(Driver.java:230)
at com.sap.ndb.studio.jdbc.JDBCPlugin$3.run(JDBCPlugin.java:642)
using null
=> FAILED

Rev 48 JDBC Connect

Rev 56 JDBC Connect

First three Connection attempts: new Connection 'jdbc:sap://imdbhdb:30015'

HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts:

new Connection 'jdbc:sap://imdbhdb:30015'

HOSTLIST:

[imdbhdb:30015,imdbhdb.sapcoe.sap.com:30015,
10.30.128.6:30015,]

First three Connection attempts: new Connection 'jdbc:sap://imdbhdb:30015' HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts:

new Connection 'jdbc:sap://10.29.1.187:30015'

HOSTLIST: [10.29.1.187:30015,]

I looked at some of the SQL commands in the JDBC trace files:
SELECT "HOST","PORT",
"SERVICE_NAME","ACTIVE_STATUS","PROCESS_ID",
"COORDINATOR_TYPE","SQL_PORT" FROM SYS.M_SERVICES

Rev 48 Output

Rev 56 Output

SELECT "HOST","KEY","VALUE" FROM SYS.M_HOST_INFORMATION WHERE
UPPER("HOST") = 'IMDBHDB' AND (UPPER("KEY") = 'SID' OR UPPER("KEY") = 'SAPSYSTEM'

Rev 48 Output

Rev 56 Output

SELECT "HOST","KEY","VALUE" FROM SYS.M_HOST_INFORMATION WHERE UPPER("KEY") LIKE 'NET_%'

Rev 48 Output

Rev 56 Output

Workaround:

#1) Someone in openSAP forum suggested using hanaserver in the hosts file entry and in adding the system in HANA studio. While this worked, I did not like this option since hanaserver has no relationship to the actual hostname -- imdbhdb.

#2) I have been suggesting to folks -- in the openSAP forum and in the AWS upgrade blog (http://scn.sap.com/docs/DOC-30980) -- to use AWS Elastic IP  for hostname in HANA studio while adding the system and to NOT add any entry in the hosts file. While this might be the lesser of the two evils, both options had the yellow-icon problem for the sapstartsrv process in the HANA studio.The SAP HANA Systems (Navigator) tab/view would also say "Some services are not started" (with an yellow icon) or "System state cannot be determined" (with a gray icon) for the system.

Fix:

When you compared the outputs of the SQL commands between Rev 48 and Rev 56 listed above, the only difference is the new key net_publicname added in Rev 56 in the View SYS.M_HOST_INFORMATION.

I had to wait until SPS06 documents were published to see what this new key was.

"Public host name that should be used by client interfaces. Can contain a host name, FQDN or IP address". (See http://help.sap.com/hana_platform SAP HANA System Views Reference)

The public_hostname_resolution parameter is documented in the SAP HANA Administration Guide (http://help.sap.com/hana_platform). This is a new parameter that has obviously been introduced after Rev 48. The values for this parameter are no,ip,name,fqdn with ip being the default in Rev 56. That is probably why the net_publichostname was set to the internal IP of the AWS HANA Instance. This raises another question as to why this was not set to the public IP (aka AWS Elastic IP) of the AWS Instance. The prudent thing at this point seems to be to disable this feature for the aforementioned reason and for backward compatibility.

Change this parameter value to no (disable feature and use internal hostname) when you are in HANA Studio (configured using the workaround #2 above).

The changed parameters are stored at the OS level as shown below.

The original *.ini files are at the OS level as shown below.

Let us run the SQL command now.

SELECT "HOST","KEY","VALUE" FROM SYS.M_HOST_INFORMATION WHERE UPPER("KEY") LIKE 'NET_%'

Now the net_publicname is set to imdbhdb.

Delete the system from the HANA studio, add the AWS ELASTIC IP-to-host (imdbhdb) mapping in the hosts file, and re-add the system in the HANA studio using the hostname ibmdbhdb.

Now the sapstartsrv process has the green icon as above.

Let us compare the JDBC Connections.

Rev 48 JDBC Connect

Rev 56 JDBC Connect

First three Connection attempts: new Connection 'jdbc:sap://imdbhdb:30015' HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts:

new Connection 'jdbc:sap://imdbhdb:30015' HOSTLIST:

[imdbhdb:30015,imdbhdb.sapcoe.
sap.com:30015,10.30.128.6:30015,]

First three Connection attempts: new Connection 'jdbc:sap://imdbhdb:30015'

HOSTLIST: [imdbhdb:30015,]

Subsequent Connection attempts: new Connection 'jdbc:sap://imdbhdb:30015'

HOSTLIST:

[imdbhdb:30015,imdbhdb.sapcoe.sap.com:30015,
10.29.1.187:30015,]

You are done. :smile:

[Please note that I have tested this fix only in AWS. I am not sure if Rev 56 systems hosted by other HANA Cloud hosting providers like CloudShare would have the same issue or if the fix would work if they did.]

7 Comments
Labels in this area