新 - 您現在可以使用 AWS 轉換加速遷移和現代化。閱讀 AWS 轉換使用者指南中的入門。
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
AWS Blu Age Runtime 中的可用 Redis 快取屬性
您可以使用本文件來了解 AWS Blu Age Runtime 中的 Redis 快取,以及 Gapwalk 組態、支援的 Redis 屬性,以及application-main.yml檔案如何參考 Redis 快取的秘密 ARN。
Blu AWS Age Runtime 中的 Redis 快取
Redis 伺服器可用於 AWS Blu Age Gapwalk 應用程式中各種功能的快取,例如:
AWS 使用 Redis 快取的 Blu Age Runtime 功能 |
描述 |
|---|---|
| Blusam 快取 | Redis Blusam快取可有效讀取記錄,使用寫入落後策略來最佳化批次承載上遇到的寫入密集型工作負載。 |
| Blusam 鎖定 | 資料集和記錄的分散式鎖定快取。 |
| 資料集目錄 | 目錄資料集快取。 |
| 工作階段快取 | HttpSession 的 Redis 快取。快取會儲存使用者名稱、與角度前端的對話狀態,以及特定的「面向」(BMS、MFS、AS400) 資訊。 |
| 工作階段追蹤器 | 具有相關聯使用者名稱和工作階段session-creation-time資訊的作用中工作階段快取。 |
| JICS 快取 | JICS 資源定義的快取。 |
| TS 佇列 | TS 佇列的儲存體。 |
| JCL 檢查點 | JCL 檢查點快取。 |
| Gapwalk 檔案鎖定 | 依任務的分散式檔案鎖定快取。 |
| Blu4iv 鎖定 | Blu4iv 記錄鎖定的儲存體。 |
Redis Gapwalk 組態
如果 redis 指定為快取機制,且未針對特定功能提供 Redis 組態,則會使用全域 Redis 組態。此組態可讓您同時針對多個 Redis 快取使用相同的組態。
在下列範例中,Blusam資料集快取和 JICS 快取會使用 gapwalk.redis(redis.server1) 組態,因為其快取類型設定為 redis,且在 JICS 資源定義和 下未指定隱含 Redis 屬性JICS 資源定義。不過,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 屬性
下表顯示 AWS Blu Age Runtime 上全域和特定 Redis 快取支援的 Redis 屬性。
| 屬性名稱 | 是否為必要? | 描述 | 值 | 預設 |
|---|---|---|---|---|
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 |
connectionPoolSize |
否 | 用於 Redisson 用戶端連線至 Redis 伺服器的連線集區大小。 | int | 64 |
connectionMinimumIdleSize |
否 | Redisson 在其連線集區中維護的閒置連線數目下限。 | int | 24 |
idleConnectionTimeout |
否 | 以毫秒為單位的逾時,之後集區中的閒置連線將會關閉。 | int | 10000 |
connectTimeout |
否 | 建立 Redis 伺服器連線的逾時,以毫秒為單位。 | int | 10000 |
Redis 快取屬性
Redis Blusam快取
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快取
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
工作階段快取
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 資源定義
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 佇列
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
工作階段追蹤器
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 檢查點
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 檔案鎖定
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 鎖定
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
資料集目錄
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 快取的秘密管理員
application-main.yaml 檔案可以參考 Redis 快取的秘密 ARN。如需如何在執行時間整合 AWS Secrets Manager 以安全地擷取 Redis 連線詳細資訊的詳細資訊,請參閱 AWS Blu Age 執行期秘密。