データベース認証のためのグラフ・サーバーの準備
インストールのpgx.confファイルを見つけます。
RPMを使用してグラフ・サーバーをインストールした場合、ファイルは/etc/oracle/graph/pgx.confにあります。
webappsパッケージを使用してTomcatまたはWebLogic Serverにデプロイする場合、pgx.confファイルは、Webアプリケーション・アーカイブ・ファイル(WARファイル)内のWEB-INF/classes/pgx.confにあります。
vim graph-server-<version>-pgx<version>.warpgx.confファイル内で、レルム・オプションのjdbc_url行を見つけます。
...
"pgx_realm": {
"implementation": "oracle.pg.identity.DatabaseRealm",
"options": {
"jdbc_url": "<REPLACE-WITH-DATABASE-URL-TO-USE-FOR-AUTHENTICATION>",
"token_expiration_seconds": 3600,
...前のステップで構成したデータベースを指すJDBC URLにテキストを置き換えます。たとえば:
...
"pgx_realm": {
"implementation": "oracle.pg.identity.DatabaseRealm",
"options": {
"jdbc_url": "jdbc:oracle:thin:@myhost:1521/myservice",
"token_expiration_seconds": 3600,
...
次に、rootユーザーとして、またはsudoを使用して次のコマンドを実行して、グラフ・サーバーを起動します。
sudo systemctl start pgxAutonomous Databaseに接続するためのグラフ・サーバー(PGX)の準備
Autonomous Databaseインスタンスに接続するようにグラフ・サーバー(PGX)を構成できます。
グラフ・サーバー(PGX)インスタンスがオンプレミスで実行されているか、Oracle Cloud Infrastructure (OCI)で実行されているかに関係なく、次のステップを実行してAutonomous Databaseインスタンスに接続するためのサービス名を特定し、/etc/oracle/graph/pgx.confファイルのJDBC URLを更新することができます。
前提条件として、グラフ・サーバー(PGX)が実行されている環境に安全にログインするために、公開キーと秘密キーで構成されるSSHキー・ペアを生成する必要があります。
- Oracle Cloud Infrastructure (OCI)コンソールからAutonomous Databaseインスタンスのウォレットをダウンロードして保存します。詳細は、クライアント資格証明(ウォレット)のダウンロードを参照してください。
- 次のように、
scpコマンドを使用して、ウォレットをローカル・マシンからグラフ・サーバー・インスタンスが実行されている環境にアップロードします。scp -i <path_to_ssh_private_key> <path_to_Wallet_DBname>.zip <username>@<public_ip>:/etc/oracle/graph/wallets前述のコマンドは、
ssh秘密キーを使用して、ウォレットをグラフ・サーバー・インスタンスの/etc/oracle/graph/walletsディレクトリに安全にコピーします。 - 次のように、
ssh秘密キーを使用してグラフ・サーバー・インスタンスに接続します。ssh -i <ssh_private_key> <username>@<public_ip> - 次のように、ウォレットを
/etc/oracle/graph/walletsディレクトリに解凍し、グループ権限を変更します。cd /etc/oracle/graph/wallets/ unzip <Wallet_DBname>.zip chgrp oraclegraph * /etc/oracle/graph/walletsディレクトリのtnsnames.oraファイルから接続識別子を特定します。たとえば、エントリは次のようになります。graphdb_low = description= (retry_count=20)(retry_delay=3) (address= (protocol=tcps)(port=1522) (host=adwc.example.oraclecloud.com) ) (connect_data=(service_name=graphdb_low.adwc.oraclecloud.com)) (security=(ssl_server_cert_dn="CN=adwc.example.oraclecloud.com, OU=Oracle BMCS US, O=Oracle Corporation, L=Redwood City, ST=California, C=US")) )前述の例では、
graphdb_lowが接続識別子です。/etc/oracle/graph/pgx.confファイルのJDBC URLを、前のステップで特定した接続識別子と解凍したウォレット・ファイルへのディレクトリ・パスを使用して更新します。たとえば:... "pgx_realm": { "implementation": "oracle.pg.identity.DatabaseRealm", "options": { "jdbc_url": "jdbc:oracle:thin:@graphdb_low?TNS_ADMIN=/etc/oracle/graph/wallets", "token_expiration_seconds": 3600, ...- 最後に、次のように、グラフ・サーバーを再起動します。
sudo systemctl restart pgx
親トピック: ユーザーの認証および認可