LoginSignup
1
1

【SAP HANA Cloud】DBクライアントツール(DBeaver等)からSAP HANA Cloudに接続できない原因

Last updated at Posted at 2024-05-27

概要

受託開発企業で働くfussasyといいます。普段は、SAP BTP(PaaS)上でSAP Fioriアプリケーション開発をしています。参画しているプロジェクトにおける資料作成のために、DBクライアントツールであるDBeaverを利用してSAP HANA Cloud(SAP HANA Schemas & HDI Containers)へ接続しようとしたところ、「確立された接続がホスト コンピューターのソウトウェアによって中止されました。」と接続エラーが発生してしまったので、事象と原因について記録したいと思います。

事象

  1. HDIコンテナーのインスタンスを準備
    image.png
  2. インスタンスでサービスキーを作成し、「host」、「port」、「user」、「password」の情報を控える。(ダブルコーテーションは不要です。)
    image.png
  3. インストールしたDBeaverで新規接続する際、「HANA」を選択する。
    image.png
  4. 「一般」タブから「Edition」を「HANA Cloud」にする。「host」、「port」、「user」、「password」を入力してテスト接続する。
    image.png
  5. 「確立された接続がホスト コンピューターのソウトウェアによって中止されました。」と接続エラーが発生してしまう。
    image.png

SAP DBTech JDBC: Cannot connect to jdbc:sap://
...
:443 [Data receive failed. java.io.IOException: 確立された接続がホスト コンピューターのソウトウェアによって中止されました。:
192.168.0.xxx:xxx -> xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.hana.prod-jp10.hanacloud.ondemand.com:443 ConnectionID:0 SessionID:0].

※一部、伏字にしています。

原因

https://community.sap.com/t5/technology-blogs-by-sap/secure-connection-from-dbeaver-to-sap-hana-cloud/ba-p/13446553
上記記事によると、DBクライアントツールを用いて、SAP HANA Cloudインスタンスへ接続するためには、SAP BTP管理者に連絡してIPアドレスをホワイトリストに登録してもらわないといけないみたいです。

SAP HANA Cloud...
... is the new cloud-native SAP HANA product, used in my previous post or in the recent live coding episode by thomas.jung.
Two quick notes before we start:

  1. As of today, it is available only as a paid service in SAP Cloud Platform, but (usual disclaimer about forward-looking statement applies) the trial version should be available later this year.
  2. As a reminder, the IP address of a machine from which a DB client tries to connect to SAP HANA Cloud instance -- should be whitelisted by your administrator.

また、記事によると、プロパティで「encrypt=true」を設定しないと接続ができない場合もあるみたいです。

"Receive of connect failed."? Why? Of course, you know, if you read the previous post
Clients can establish only secure connections to SAP HANA Cloud!
Let's add this encrypt parameter to the connection. Unfortunately, this is where I found DBevaer UI somewhat unintuitive.
Switch to Driver properties and right-click on User Properties to add a new property.
Unfortunately, DBevar did not allow me to put encrypt=true just right here. Instead, I added encrypt property, and then (it took me half an hour to figure our) double-click next to my property in Value column to edit. Type true there.

結果

VPNツールでIPアドレスを固定化し、管理者に連絡して、そのIPアドレスをホワイトリストに登録してもらいました。その後、テスト接続を実行してみたところ、無事にSAP HANA Cloudに接続することができました!良かった!
image.png

補足・参考

本件で利用したDBeaverはDBeaver Communityとなります。DBeaver Communityは無料版ですがOSSとなりますのでバージョンリリースサイクルも早く、前バージョンとの差異は利用者自身で確認しなければいけません。以下、DBeaver Communityのリリースノートと、Issuesになります。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1