7.3. キャッシュストアマイグレーターの設定

migrator.properties ファイルを使用して、ソースおよびターゲットのキャッシュストアのプロパティーを設定します。

手順

  1. migrator.properties ファイルを作成します。
  2. migrator.properties ファイルを使用して、ソースおよびターゲットのキャッシュストアのプロパティーを設定します。

    1. source. 接頭辞をソースキャッシュストアの全設定プロパティーに追加します。

      ソースキャッシュストアの例

      source.type=SOFT_INDEX_FILE_STORE
      source.cache_name=myCache
      source.location=/path/to/source/sifs
      source.version=<version>

      重要

      セグメント化されたキャッシュストアからデータを移行するには、source.segment_count プロパティーを使用してセグメント数も設定する必要があります。セグメント数は、Data Grid 設定の clustering.hash.numSegments と一致する必要があります。キャッシュストアのセグメント数が対応するキャッシュのセグメント数と一致しない場合、Data Grid はキャッシュストアからデータを読み取ることができません。

    2. target. 接頭辞をターゲットキャッシュストアの全設定プロパティーに追加します。

      ターゲットキャッシュストアの例

      target.type=SINGLE_FILE_STORE
      target.cache_name=myCache
      target.location=/path/to/target/sfs.dat

7.3.1. キャッシュストアマイグレーターの設定プロパティー

ソースおよびターゲットのキャッシュストアを StoreMigrator プロパティーで設定します。

表7.1 キャッシュストアタイププロパティー

プロパティー説明必須/オプション

type

ソースまたはターゲットのキャッシュストアのタイプを指定します。

.type=JDBC_STRING

.type=JDBC_BINARY

.type=JDBC_MIXED

.type=LEVELDB

.type=ROCKSDB

.type=SINGLE_FILE_STORE

.type=SOFT_INDEX_FILE_STORE

.type=JDBC_MIXED

必須

表7.2 一般的なプロパティー

プロパティー説明値の例必須/オプション

cache_name

バックアップするキャッシュの名前。

.cache_name=myCache

必須

segment_count

セグメンテーションを使用できるターゲットキャッシュストアのセグメント数。

セグメント数は、Data Grid 設定の clustering.hash.numSegments と一致する必要があります。キャッシュストアのセグメント数が対応するキャッシュのセグメント数と一致しない場合、Data Grid はキャッシュストアからデータを読み取ることができません。

.segment_count=256

Optional

表7.3 JDBC プロパティー

プロパティー説明必須/オプション

dialect

基礎となるデータベースのダイアレクトを指定します。

必須

version

ソースキャッシュストアのマーシャラーバージョンを指定します。
以下のいずれかの値を設定します。

* Data Grid 7.2.x の場合は 8

* Data Grid 7.3.x の場合は 9

* Data Grid 8.0.x の場合は 10

* Data Grid 8.1.x の場合は 11

* Data Grid 8.2.x の場合は 12

* Data Grid 8.3.x の場合は 13

ソースストアにのみ必要です。

marshaller.class

カスタムマーシャラークラスを指定します。

カスタムマーシャラーを使用する場合に必要です。

marshaller.externalizers

[id]:<Externalizer class> 形式で読み込むカスタム AdvancedExternalizer 実装のコンマ区切りリストを指定します。

Optional

connection_pool.connection_url

JDBC 接続 URL を指定します。

必須

connection_pool.driver_class

JDBC ドライバーのクラスを指定します。

必須

connection_pool.username

データベースユーザー名を指定します。

必須

connection_pool.password

データベースユーザー名のパスワードを指定します。

必須

db.disable_upsert

データベース upsert を無効にします。

Optional

db.disable_indexing

テーブルインデックスが作成されるかどうかを指定します。

Optional

table.string.table_name_prefix

テーブル名の追加接頭辞を指定します。

Optional

table.string.<id|data|timestamp>.name

列名を指定します。

必須

table.string.<id|data|timestamp>.type

列タイプを指定します。

必須

key_to_string_mapper

TwoWayKey2StringMapper クラスを指定します。

Optional

注記

Binary キャッシュストアから古い Data Grid バージョンの移行には、以下のプロパティーで table.string.*table.binary.\* に変更します。

  • source.table.binary.table_name_prefix
  • source.table.binary.<id\|data\|timestamp>.name
  • source.table.binary.<id\|data\|timestamp>.type
# Example configuration for migrating to a JDBC String-Based cache store
target.type=STRING
target.cache_name=myCache
target.dialect=POSTGRES
target.marshaller.class=org.example.CustomMarshaller
target.marshaller.externalizers=25:Externalizer1,org.example.Externalizer2
target.connection_pool.connection_url=jdbc:postgresql:postgres
target.connection_pool.driver_class=org.postrgesql.Driver
target.connection_pool.username=postgres
target.connection_pool.password=redhat
target.db.disable_upsert=false
target.db.disable_indexing=false
target.table.string.table_name_prefix=tablePrefix
target.table.string.id.name=id_column
target.table.string.data.name=datum_column
target.table.string.timestamp.name=timestamp_column
target.table.string.id.type=VARCHAR
target.table.string.data.type=bytea
target.table.string.timestamp.type=BIGINT
target.key_to_string_mapper=org.infinispan.persistence.keymappers. DefaultTwoWayKey2StringMapper

表7.4 RocksDB プロパティー

プロパティー説明必須/オプション

location

データベースディレクトリーを設定します。

必須

圧縮

使用する圧縮タイプを指定します。

Optional

# Example configuration for migrating from a RocksDB cache store.
source.type=ROCKSDB
source.cache_name=myCache
source.location=/path/to/rocksdb/database
source.compression=SNAPPY

表7.5 SingleFileStore プロパティー

プロパティー説明必須/オプション

location

キャッシュストア .dat ファイルが含まれるディレクトリーを設定します。

必須

# Example configuration for migrating to a Single File cache store.
target.type=SINGLE_FILE_STORE
target.cache_name=myCache
target.location=/path/to/sfs.dat

表7.6 SoftIndexFileStore プロパティー

プロパティー説明

必須/オプション

location

データベースディレクトリーを設定します。

必須

index_location

データベースインデックスディレクトリーを設定します。

# Example configuration for migrating to a Soft-Index File cache store.
target.type=SOFT_INDEX_FILE_STORE
target.cache_name=myCache
target.location=path/to/sifs/database
target.location=path/to/sifs/index