

AWS Mainframe Modernization Service （受管執行期環境體驗） 不再向新客戶開放。對於與 AWS Mainframe Modernization Service （受管執行期環境體驗） 類似的功能，探索 AWS Mainframe Modernization Service （自我管理體驗）。現有客戶可以繼續正常使用該服務。如需詳細資訊，請參閱[AWS 大型主機現代化可用性變更](https://docs.aws.amazon.com/m2/latest/userguide/mainframe-modernization-availability-change.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 大型主機執行期 AWS 轉換中可用的 Redis 快取屬性
<a name="ba-runtime-redis-configuration"></a>

您可以使用本文件來了解適用於大型主機執行期的 AWS Transform 中的 Redis 快取，以及 Gapwalk 組態、支援的 Redis 屬性，以及`application-main.yml`檔案如何參考適用於 Redis 快取的秘密 ARN。

## 大型主機執行期 AWS 轉換中的 Redis 快取
<a name="ba-redis-caches-in-runtime"></a>

Redis 伺服器可以做為大型主機 Gapwalk AWS 轉換應用程式中各種功能的快取，例如：


****  

| AWS 使用 Redis 快取之大型主機執行期功能的轉換 | Description | 
| --- | --- | 
| Blusam 快取 | Redis Blusam快取可有效讀取記錄，使用寫入落後策略來最佳化批次承載上遇到的寫入密集型工作負載。 | 
| Blusam 鎖定 | 資料集和記錄的分散式鎖定快取。 | 
| 資料集目錄 | 目錄資料集快取。 | 
| 工作階段快取 | HttpSession 的 Redis 快取。快取會儲存使用者名稱、與角度前端的對話狀態，以及特定的「方向」(BMS、MFS、AS400) 資訊。 | 
| 工作階段追蹤器 | 具有相關聯使用者名稱和工作階段session-creation-time資訊的作用中工作階段快取。 | 
| JICS 快取 | JICS 資源定義的快取。 | 
| TS 佇列 | TS 佇列的儲存體。 | 
| JCL 檢查點 |  JCL 檢查點快取。 | 
| Gapwalk 檔案鎖定 | 依任務的分散式檔案鎖定快取。 | 
| Blu4iv 鎖定 | Blu4iv 記錄鎖定的儲存體。 | 

## Redis Gapwalk 組態
<a name="ba-runtime-redis-gapwalk-configuration"></a>

如果 `redis` 指定為快取機制，且未針對特定功能提供 Redis 組態，則會使用全域 Redis 組態。此組態可讓您同時針對多個 Redis 快取使用相同的組態。

在下列範例中，Blusam資料集快取和 JICS 快取會使用 `gapwalk.redis`(`redis.server1`) 組態，因為其快取類型設定為 `redis`，且在 [JICS 資源定義](#ba-runtime-redis-jics-cache)和 下未指定隱含 Redis 屬性[JICS 資源定義](#ba-runtime-redis-jics-cache)。不過，Blusam鎖定快取將使用不同的 Redis 組態 (`redis.server2`)，因為其 Redis 屬性已明確定義。

```
...
 
 gapwalk:
   redis:
     hostName: redis.server1
 	port: 6379
 ...
 
 bluesam:
   # Redis bluesam cache
   cache: redis
   # Redis locks cache
   locks:
     cache: redis
 	hostName: redis.server2
 	port: 6379
 ...
 # Redis jics cache
 jics:
   resource-definitions:
     store-type: redis
 ...
```

 若要啟用全域 Redis 組態，請在 中新增下列組態`main-application.yml`。

```
 gapwalk:
   redis:
     hostName: localhost
     port: 6379
     mode: standalone                        # Optional
     username:                               # Optional
     password: ""                            # Optional
     useSsl: false                           # Optional
     database: 0                             # Optional
     maxTotal: 128                           # Optional
     maxIdle: 128                            # Optional
     minIdle: 16                             # Optional
     testOnBorrow: true                      # Optional
     testOnReturn: true                      # Optional
     testWhileIdle: true                     # Optional
     testOnCreate: true                      # Optional
     minEvictableIdleTimeMillis: 60000       # Optional
     timeBetweenEvictionRunsMillis: 30000    # Optional
     numTestsPerEvictionRun: -1              # Optional
     blockWhenExhausted: true                # Optional
     nettyThreads: 32                        # Optional
     subscriptionsPerConnection: 10          # Optional
     subscriptionConnectionPoolSize: 100     # Optional
     pageSizeInBytes: 8192                   # Optional
     readTimeout: 2000                       # Optional
```

## 支援的 Redis 屬性
<a name="ba-runtime-redis-supported-properties"></a>

下表顯示適用於大型主機執行期的 AWS Transform 上全域和特定 Redis 快取支援的 Redis 屬性。


****  

| 屬性名稱 | 是否為必要？ | Description | 值 | 預設 | 
| --- | --- | --- | --- | --- | 
| mode | 否 | Redis 執行模式。 | standalone \| cluster | standalone | 
| hostname | 是 | Redis 伺服器的主機名稱或 IP 地址。 | string | null | 
| port | 是 | Redis 伺服器接聽連線的連接埠號碼。 | int | null | 
| username | 否 | 身分驗證的使用者名稱。 | string | null | 
| password | 否 | 身分驗證的密碼。 | string | 空字串 | 
| useSsl  | 否 | 指定是否要為 Redis 連線啟用 SSL/TLS 加密。 | boolean | false | 
| database | 否 | 要使用的 Redis 資料庫號碼。Redis 支援多個邏輯資料庫，此屬性會指定要使用哪個資料庫。 | int | 0 | 
| maxTotal | 否 | Redis 連線集區中允許的連線數目上限。 | int  | 128 | 
| maxIdle | 否 | Redis 連線集區中允許的閒置連線數目上限。 | int | 128 | 
| minIdle | 否 | 要在 Redis 連線集區中維護的閒置連線數目下限。 | int | 16 | 
| testOnBorrow  | 否 | 布林值，指出是否要在從集區借用連線之前驗證連線。 | boolean | true | 
| testOnReturn  | 否 | 布林值，指出是否要在將連線傳回至集區之前驗證連線。 | boolean | true | 
| testWhileIdle  | 否 | 布林值，指出是否要定期驗證集區中的閒置連線。 | boolean | true | 
| testOnCreate  | 否 | 布林值，指出是否在建立連線時驗證連線。 | boolean | true | 
| minEvictableIdleTimeMillis  | 否 | 閒置連線必須保留在集區中才能移出的最短時間量 （以毫秒為單位）。 | long | 60000L  | 
| timeBetweenEvictionRunsMillis  | 否 | 閒置連線偵測器執行緒的連續執行之間的時間 （以毫秒為單位）。 | long | 30000L | 
| numTestsPerEvictionRun  | 否 | 每次執行閒置連線偵測器執行緒時要測試的連線數目上限。 | int | -1 | 
| blockWhenExhausted  | 否 | 布林值，指出是否要在集區用盡時封鎖和等待連線變成可用。 | boolean | true | 
| nettyThreads  | 否 | 用於處理 Redis 連線的 Netty 執行緒數量。 | int | 32 | 
| subscriptionsPerConnection  | 否 | 每個 Redis 連線允許的訂閱數量上限。 | int | 10 | 
| subscriptionConnectionPoolSize  | 否 | Redis 訂閱連線集區中允許的連線數目上限。 | int | 100 | 
| pageSizeInBytes  | 否 | Redis 操作的預設頁面大小，以位元組為單位。 | long | 262144000  | 
| readTimeout | 否 | Redis 操作的讀取逾時，以毫秒為單位。 | long | 2000 | 
| timeToLiveMillis | 否 | 快取項目在被視為過期和移除之前保留在快取中的持續時間 （以毫秒為單位）。如果未指定此屬性，快取項目預設不會自動過期。 | long | -1 | 
| useAsyncBatch | 否 | 為 Redis 大量寫入操作啟用非同步執行，以改善效能。設定為 false 時， 會回到同步執行模式。 | boolean | true | 
| useBatchInMemoryAtomic | 否 | 啟用 Redis 批次讀取操作的In-memory-atomic模式。設定為 false 時， 會回到預設記憶體內批次模式。 | boolean | false | 
| connectionPoolSize | 否 | 用於 Redisson 用戶端連線至 Redis 伺服器的連線集區大小。 | int | 64 | 
| connectionMinimumIdleSize | 否 | Redisson 在其連線集區中維護的閒置連線數目下限。 | int | 24 | 
| idleConnectionTimeout | 否 | 以毫秒為單位的逾時，之後集區中的閒置連線將會關閉。 | int | 10000 | 
| connectTimeout | 否 | 建立 Redis 伺服器連線的逾時，以毫秒為單位。 | int | 10000 | 

## Redis 快取屬性
<a name="ba-runtime-redis-caches-properties"></a>

### Redis Blusam快取
<a name="ba-runtime-redis-blusam-cache"></a>

```
bluesam:
   cache: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
   redis:
     hostName: localhost
     port: 6379
     mode: standalone                        # Optional
     username:                               # Optional
     password: ""                            # Optional
     useSsl: false                           # Optional
     database: 0                             # Optional
     maxTotal: 128                           # Optional
     maxIdle: 128                            # Optional
     minIdle: 16                             # Optional
     testOnBorrow: true                      # Optional
     testOnReturn: true                      # Optional
     testWhileIdle: true                     # Optional
     testOnCreate: true                      # Optional
     minEvictableIdleTimeMillis: 60000       # Optional
     timeBetweenEvictionRunsMillis: 30000    # Optional
     numTestsPerEvictionRun: -1              # Optional
     blockWhenExhausted: true                # Optional
     nettyThreads: 32                        # Optional
     subscriptionsPerConnection: 10          # Optional
     subscriptionConnectionPoolSize: 100     # Optional
     pageSizeInBytes: 8192                   # Optional
     readTimeout: 2000                       # Optional
     timeToLiveMillis: 60000                 # Optional
     connectionPoolSize: 64                  # Optional
     connectionMinimumIdleSize: 24           # Optional
     idleConnectionTimeout: 10000            # Optional
     connectTimeout: 10000                   # Optional
```

### Redis Blusam快取
<a name="ba-runtime-redis-blusame-locks"></a>

```
bluesam:
   locks:
     cache: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
       hostName: localhost
       port: 6379
       mode: standalone                        # Optional
       username:                               # Optional
       password: ""                            # Optional
       useSsl: false                           # Optional
       database: 0                             # Optional
       maxTotal: 128                           # Optional
       maxIdle: 128                            # Optional
       minIdle: 16                             # Optional
       testOnBorrow: true                      # Optional
       testOnReturn: true                      # Optional
       testWhileIdle: true                     # Optional
       testOnCreate: true                      # Optional
       minEvictableIdleTimeMillis: 60000       # Optional
       timeBetweenEvictionRunsMillis: 30000    # Optional
       numTestsPerEvictionRun: -1              # Optional
       blockWhenExhausted: true                # Optional
       nettyThreads: 32                        # Optional
       subscriptionsPerConnection: 10          # Optional
       subscriptionConnectionPoolSize: 100     # Optional
       pageSizeInBytes: 8192                   # Optional
       readTimeout: 2000                       # Optional
```

### 工作階段快取
<a name="ba-runtime-redis-session-cache"></a>

```
 spring:
   session:
     store-type: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
 jics:
   redis:
     hostName: localhost
     port: 6379
     mode: standalone                        # Optional
     username:                               # Optional
     password: ""                            # Optional
     useSsl: false                           # Optional
     database: 0                             # Optional
     maxTotal: 128                           # Optional
     maxIdle: 128                            # Optional
     minIdle: 16                             # Optional
     testOnBorrow: true                      # Optional
     testOnReturn: true                      # Optional
     testWhileIdle: true                     # Optional
     testOnCreate: true                      # Optional
     minEvictableIdleTimeMillis: 60000       # Optional
     timeBetweenEvictionRunsMillis: 30000    # Optional
     numTestsPerEvictionRun: -1              # Optional
     blockWhenExhausted: true                # Optional
     nettyThreads: 32                        # Optional
     subscriptionsPerConnection: 10          # Optional
     subscriptionConnectionPoolSize: 100     # Optional
     pageSizeInBytes: 8192                   # Optional
     readTimeout: 2000                       # Optional
```

### JICS 資源定義
<a name="ba-runtime-redis-jics-cache"></a>

```
jics:
   resource-definitions:
     store-type: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
   redis:
     hostName: localhost
     port: 6379
     mode: standalone                        # Optional
     username:                               # Optional
     password: ""                            # Optional
     useSsl: false                           # Optional
     database: 0                             # Optional
     maxTotal: 128                           # Optional
     maxIdle: 128                            # Optional
     minIdle: 16                             # Optional
     testOnBorrow: true                      # Optional
     testOnReturn: true                      # Optional
     testWhileIdle: true                     # Optional
     testOnCreate: true                      # Optional
     minEvictableIdleTimeMillis: 60000       # Optional
     timeBetweenEvictionRunsMillis: 30000    # Optional
     numTestsPerEvictionRun: -1              # Optional
     blockWhenExhausted: true                # Optional
     nettyThreads: 32                        # Optional
     subscriptionsPerConnection: 10          # Optional
     subscriptionConnectionPoolSize: 100     # Optional
     pageSizeInBytes: 8192                   # Optional
     readTimeout: 2000                       # Optional
```

### JICS TS 佇列
<a name="ba-runtime-jics-ts-queues"></a>

```
jics:
   parameters:
     tsqimpl: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
   queues:
     ts:
       redis:
         hostName: localhost
         port: 6379
         mode: standalone                        # Optional
         username:                               # Optional
         password: ""                            # Optional
         useSsl: false                           # Optional
         database: 0                             # Optional
         maxTotal: 128                           # Optional
         maxIdle: 128                            # Optional
         minIdle: 16                             # Optional
         testOnBorrow: true                      # Optional
         testOnReturn: true                      # Optional
         testWhileIdle: true                     # Optional
         testOnCreate: true                      # Optional
         minEvictableIdleTimeMillis: 60000       # Optional
         timeBetweenEvictionRunsMillis: 30000    # Optional
         numTestsPerEvictionRun: -1              # Optional
         blockWhenExhausted: true                # Optional
         nettyThreads: 32                        # Optional
         subscriptionsPerConnection: 10          # Optional
         subscriptionConnectionPoolSize: 100     # Optional
         pageSizeInBytes: 8192                   # Optional
         readTimeout: 2000                       # Optional
```

### 工作階段追蹤器
<a name="ba-runtime-session-tracker"></a>

```
session-tracker:
   store-type: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
   redis:
     hostName: localhost
     port: 6379
     mode: standalone                        # Optional
     username:                               # Optional
     password: ""                            # Optional
     useSsl: false                           # Optional
     database: 0                             # Optional
     maxTotal: 128                           # Optional
     maxIdle: 128                            # Optional
     minIdle: 16                             # Optional
     testOnBorrow: true                      # Optional
     testOnReturn: true                      # Optional
     testWhileIdle: true                     # Optional
     testOnCreate: true                      # Optional
     minEvictableIdleTimeMillis: 60000       # Optional
     timeBetweenEvictionRunsMillis: 30000    # Optional
     numTestsPerEvictionRun: -1              # Optional
     blockWhenExhausted: true                # Optional
     nettyThreads: 32                        # Optional
     subscriptionsPerConnection: 10          # Optional
     subscriptionConnectionPoolSize: 100     # Optional
     pageSizeInBytes: 8192                   # Optional
     readTimeout: 2000                       # Optional
```

### JCL 檢查點
<a name="ba-runtime-jcl-checkpoint"></a>

```
jcl:
   checkpoint:
     provider: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
   redis:
     hostname: localhost
     port: 6379
     mode: standalone                        # Optional
     username:                               # Optional
     password: ""                            # Optional
     useSsl: false                           # Optional
     database: 0                             # Optional
     maxTotal: 128                           # Optional
     maxIdle: 128                            # Optional
     minIdle: 16                             # Optional
     testOnBorrow: true                      # Optional
     testOnReturn: true                      # Optional
     testWhileIdle: true                     # Optional
     testOnCreate: true                      # Optional
     minEvictableIdleTimeMillis: 60000       # Optional
     timeBetweenEvictionRunsMillis: 30000    # Optional
   	 numTestsPerEvictionRun: -1              # Optional
     blockWhenExhausted: true                # Optional
     nettyThreads: 32                        # Optional
     subscriptionsPerConnection: 10          # Optional
     subscriptionConnectionPoolSize: 100     # Optional
     pageSizeInBytes: 8192                   # Optional
     readTimeout: 2000                       # Optional
```

### Gapwalk 檔案鎖定
<a name="ba-runtime-gapwalk-file-locks"></a>

```
filesLocks:
   enabled: true
   retryTime: 1000
   MaxRetry: 5
   provider: redis
 # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
   redis:
     hostName: localhost
     port: 6379
     mode: standalone                          # Optional
     username:                                 # Optional
     password: ""                              # Optional
     useSsl: false                             # Optional
     database: 0                               # Optional
     pool:
       maxTotal: 128                           # Optional
       maxIdle: 128                            # Optional
       minIdle: 16                             # Optional
       testOnBorrow: true                      # Optional
       testOnReturn: true                      # Optional
       testWhileIdle: true                     # Optional
       testOnCreate: true                      # Optional
       minEvictableIdleTimeMillis: 60000       # Optional
       timeBetweenEvictionRunsMillis: 30000    # Optional
       numTestsPerEvictionRun: -1              # Optional
       blockWhenExhausted: true                # Optional
       nettyThreads: 32                        # Optional
       subscriptionsPerConnection: 10          # Optional
       subscriptionConnectionPoolSize: 100     # Optional
       pageSizeInBytes: 8192                   # Optional
       readTimeout: 2000                       # Optional
```

### Blu4iv 鎖定
<a name="ba-runtime-blu4iv-locks"></a>

```
 blu4iv.lock: redis
 blu4iv.lock.timeout: 10 #(in millisecondes)
 	# If the following redis properties are not specified gapwalk.redis configuration will be used for this cache 
 blu4iv.lock.redis:
       hostName: localhost
       port: 6379
       mode: standalone                        # Optional
       username:                               # Optional
       password: ""                            # Optional
       useSsl: false                           # Optional
       database: 0                             # Optional
       maxTotal: 128                           # Optional
       maxIdle: 128                            # Optional
       minIdle: 16                             # Optional
       testOnBorrow: true                      # Optional
       testOnReturn: true                      # Optional
       testWhileIdle: true                     # Optional
       testOnCreate: true                      # Optional
       minEvictableIdleTimeMillis: 60000       # Optional
       timeBetweenEvictionRunsMillis: 30000    # Optional
       numTestsPerEvictionRun: -1              # Optional
       blockWhenExhausted: true                # Optional
       nettyThreads: 32                        # Optional
       subscriptionsPerConnection: 10          # Optional
       subscriptionConnectionPoolSize: 100     # Optional
       pageSizeInBytes: 8192                   # Optional
       readTimeout: 2000                       # Optional
```

### 資料集目錄
<a name="ba-runtime-dataset-catalog"></a>

```
datasimplifier:   
   catalogImplementation: redis
   # If the following redis properties are not specified gapwalk.redis configuration will be used for this cache    
   redis:
     hostName: localhost
     port: 6379
     mode: standalone                        # Optional
     username:                               # Optional
     password: ""                            # Optional
     useSsl: false                           # Optional
     database: 0                             # Optional
     maxTotal: 128                           # Optional
     maxIdle: 128                            # Optional
     minIdle: 16                             # Optional
     testOnBorrow: true                      # Optional
     testOnReturn: true                      # Optional
     testWhileIdle: true                     # Optional
     testOnCreate: true                      # Optional
     minEvictableIdleTimeMillis: 60000       # Optional
     timeBetweenEvictionRunsMillis: 30000    # Optional
     numTestsPerEvictionRun: -1              # Optional
     blockWhenExhausted: true                # Optional
     nettyThreads: 32                        # Optional
     subscriptionsPerConnection: 10          # Optional
     subscriptionConnectionPoolSize: 100     # Optional
     pageSizeInBytes: 8192                   # Optional
     readTimeout: 2000                       # Optional
```

## Redis 快取的 Secret Manager
<a name="ba-runtime-redis-secrets-properties"></a>

`application-main.yaml` 檔案可以參考 Redis 快取的秘密 ARN。如需如何在執行時間整合 AWS Secrets Manager 以安全地擷取 Redis 連線詳細資訊的詳細資訊，請參閱 [AWS 大型主機執行期秘密的轉換](ba-runtime-config-app-secrets.md)。