AWS Blu Age 运行时中可用的 Redis 缓存属性 - AWS 大型机现代化

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

AWS Blu Age 运行时中可用的 Redis 缓存属性

你可以使用本文档来了解 AWS Blu Age Runtime 中的 Redis 缓存、Gapwalk 配置、支持的 Redis 属性以及application-main.yml文件如何引用 Redis 缓存的秘密 ARN。

AWS Blue Age 运行时中的 Redis 缓存

Redis 服务器可用作 AWS Blu Age Gapwalk 应用程序中各种功能的缓存,例如:

AWS 使用 Redis 缓存的 Blu Age 运行时功能

描述
Blusam 缓存 Redis Blusam 缓存,用于通过回写策略提高记录读取效率,从而优化批处理有效载荷上遇到的写密集型工作负载。
Blusam 锁 用于数据集和记录的分布式锁的缓存。
数据集目录 目录数据集缓存。
会话缓存 用于的 Redis 缓存。 HttpSession缓存存储用户名、Angular 前端对话的状态以及特定的 “方言”(BMS、MFS、00)信息。 AS4
会话跟踪器 包含相关用户名和 session-creation-time信息的活动会话缓存。
JICS 缓存 JICS 资源定义的缓存。
TS 队列 TS 队列的存储。
JCL 检查点 JCL 检查点缓存。
Gapwalk 文件锁 按作业分配的分布式文件锁缓存。
Blu4iv 锁 Blu4iv 记录锁的存储空间。

Redis Gapwalk 配置

如果将 redis 指定为缓存机制,并且没有为特定特征提供 Redis 配置,则使用全局 Redis 配置。此配置使您可以同时对多个 Redis 缓存使用相同的配置。

在以下示例中,Blusam 数据集缓存和 JICS 缓存使用 gapwalk.redisredis.server1)配置,因为它们的缓存类型设置为 redis,且未在 JICS 资源定义JICS 资源定义 下指定隐式 Redis 属性。但是,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 地址。 字符串 null
port Redis 服务器侦听连接的端口号。 整数 null
username 用于身份验证的用户名。 字符串 null
password 用于身份验证的密码。 字符串 空字符串
useSsl 指定是否为 Redis 连接启用 SSL/TLS 加密。 布尔值 false
database 要使用的 Redis 数据库编号。Redis 支持多个逻辑数据库,而此属性指定要使用哪个逻辑数据库。 整数 0
maxTotal Redis 连接池中支持的最大连接数。 整数 128
maxIdle Redis 连接池中支持的最大空闲连接数。 整数 128
minIdle 要在 Redis 连接池中保持的最小空闲连接数。 整数 16
testOnBorrow 布尔值,指示在从池中借用连接之前是否对连接进行验证。 布尔值 true
testOnReturn 布尔值,指示在将连接返回到池之前是否对连接进行验证。 布尔值 true
testWhileIdle 布尔值,指示是否定期验证池中的空闲连接。 布尔值 true
testOnCreate 布尔值,指示在创建连接时是否对连接进行验证。 布尔值 true
minEvictableIdleTimeMillis 空闲连接在被退出之前必须在池中保持的最少时间(以毫秒为单位)。 长整数 60000L
timeBetweenEvictionRunsMillis 连续运行空闲连接退出器线程之间的时间(以毫秒为单位)。 长整数 30000L
numTestsPerEvictionRun 每次运行空闲连接退出程序线程期间要测试的最大连接数。 整数 –1
blockWhenExhausted 布尔值,指示在连接池耗尽时是否阻塞并等待可用的连接。 布尔值 true
nettyThreads 用于处理 Redis 连接的 Netty 线程数。 整数 32
subscriptionsPerConnection 每个 Redis 连接支持的最大订阅数。 整数 10
subscriptionConnectionPoolSize Redis 订阅连接池中支持的最大连接数。 整数 100
pageSizeInBytes Redis 操作的默认页面大小(以字节为单位)。 长整数 262144000
readTimeout Redis 操作的读取超时时间(以毫秒为单位)。 长整数 2000
timeToLiveMillis 缓存条目在被视为过期并被删除之前在缓存中停留的持续时间(以毫秒为单位)。如果未指定此属性,则默认情况下,缓存条目不会自动过期。 长整数 –1

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

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 蓝光时代运行时的秘密