Preparing PostgreSQL to be Used by the CData Virtuality Server
CData Virtuality はPostgreSQL への最大100接続の接続プールを使用します。PostgreSQL インスタンスのmax_connections
パラメータが適切に設定されていることを確認してください。
構成データベースは、PostgreSQL のホストベース認証機能を使用して、Data Virtuality Server 以外のクライアントからのアクセスを禁止することで、外部からのアクセスに対して保護する必要があります。ホストベース認証機能は、PostgreSQLのpg_hba構成ファイル(pg_hba.conf)を介してネットワーク認証と認可を制御します。Configuration Database サーバーホスト上のpg_hba.confファイルは、CData Virtuality Server からの接続のみを許可するものとします。
Setting Up the CData Virtuality Server to use an External PostgreSQL
- CData Virtuality Server を停止します。
- /path/to/dvserver/bin/dvconfig.conf.props(Linux)またはpathto/dvserver/bin/dvconfig.conf.props.bat(Windows)ファイルを編集します:
組み込みPostgreSQLの構成と起動を行うセクションを無効化/コメントアウトしてください。
Windows (dvconfig.conf.props.bat)rem
# Configure embedded PostgreSQL as configuration database
rem
set
"JAVA_OPTS=%JAVA_OPTS% -Ddv.dvconfig.type=psql -Ddv.dvlogs.type=psql -Ddv.dvconfig.ds=dvconfig_pg -Ddv.dvlogs.ds=dvconfig_pg"
rem
set
"JAVA_OPTS=%JAVA_OPTS% -Ddv.dvconfig.host=localhost -Ddv.dvconfig.port=54322 -Ddv.dvconfig.db=dvconfig -Ddv.dvconfig.user=dvconfig -Ddv.dvconfig.pwd=dvconfig -Ddv.dvconfig.schema=public -Ddv.dvlogs.schema=public"
rem
# Configure embedded PostgreSQL as configuration database
rem
# Start embedded PostgreSQL
rem
set
PGDATADIR=
"%DVSERVERROOTDIR%\pgsql\data"
rem IF NOT EXIST %PGDATADIR% ( call
"%DVSERVERROOTDIR%\pgsql\embeddedPg_init.bat"
>
"%DVSERVERROOTDIR%\standalone\log\embeddedPg_init.log"
)
rem call
"%DVSERVERROOTDIR%\pgsql\embeddedPg_start.bat"
>
"%DVSERVERROOTDIR%\standalone\log\embeddedPg_start.log"
rem
# Start embedded PostgreSQL
Linux (dvconfig.conf.props)# # Configure embedded PostgreSQL as configuration database
# JAVA_OPTS="$JAVA_OPTS -Ddv.dvconfig.type=psql -Ddv.dvlogs.type=psql -Ddv.dvconfig.ds=dvconfig_pg -Ddv.dvlogs.ds=dvconfig_pg"
# JAVA_OPTS="$JAVA_OPTS -Ddv.dvconfig.host=localhost -Ddv.dvconfig.port=54322 -Ddv.dvconfig.db=dvconfig -Ddv.dvconfig.user=dvconfig -Ddv.dvconfig.pwd=dvconfig -Ddv.dvconfig.schema=public -Ddv.dvlogs.schema=public"
# # Configure embedded PostgreSQL as configuration database
# # Start embedded PostgreSQL
# PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
# PGDATAFOLDER="${PARENT_PATH}"/../pgsql/data
# if [ ! -d "${PGDATAFOLDER}" ]; then
# "${PARENT_PATH}"/../pgsql/embeddedPg_init.sh > "${PARENT_PATH}"/../standalone/log/embeddedPg_init.log
# fi
# "${PARENT_PATH}"/../pgsql/embeddedPg_start.sh > "${PARENT_PATH}"/../standalone/log/embeddedPg_start.log
# # Start embedded PostgreSQL
外部PostgreSQLを構成するセクションを有効化/コメント解除します。PostgreSQLの設定に応じて調整してください:
Windows (dvconfig.conf.props.bat)rem
# Configure PostgreSQL as configuration database
set
"JAVA_OPTS=%JAVA_OPTS% -Ddv.dvconfig.type=psql -Ddv.dvlogs.type=psql -Ddv.dvconfig.ds=dvconfig_pg -Ddv.dvlogs.ds=dvconfig_pg"
set
"JAVA_OPTS=%JAVA_OPTS% -Ddv.dvconfig.host= -Ddv.dvconfig.port= -Ddv.dvconfig.db= -Ddv.dvconfig.user= -Ddv.dvconfig.pwd= -Ddv.dvconfig.schema= -Ddv.dvlogs.schema="
rem
# Configure PostgreSQL as configuration database
Linux (dvconfig.conf.props)# # Configure PostgreSQL as configuration database
JAVA_OPTS=
"$JAVA_OPTS -Ddv.dvconfig.type=psql -Ddv.dvlogs.type=psql -Ddv.dvconfig.ds=dvconfig_pg -Ddv.dvlogs.ds=dvconfig_pg"
JAVA_OPTS=
"$JAVA_OPTS -Ddv.dvconfig.host= -Ddv.dvconfig.port= -Ddv.dvconfig.db= -Ddv.dvconfig.user= -Ddv.dvconfig.pwd= -Ddv.dvconfig.schema= -Ddv.dvlogs.schema="
# # Configure PostgreSQL as configuration database
dv.dvconfig.host
PostgreSQL ホストdv.dvconfig.port
PostgreSQL ポート (デフォルトは 5432)dv.dvconfig.db
接続先データベースdv.dvconfig.user
PostgreSQLユーザー名。dv.dvconfig.pwd
対応するUserパスワード。
- 外部のPostgreSQLが起動していることを確認します。
- CData Virtuality Server を起動します。