

AWS 大型机现代化服务（托管运行时环境体验）不再向新客户开放。有关类似于 AWS 大型机现代化服务（托管运行时环境体验）的功能，请浏览 AWS 大型机现代化服务（自我管理体验）。现有客户可以继续正常使用该服务。有关更多信息，请参阅[AWS 大型机现代化可用性变更](https://docs.aws.amazon.com/m2/latest/userguide/mainframe-modernization-availability-change.html)。

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

# 大型机运行时 AWS 转换中可用的 Redis 缓存属性
<a name="ba-runtime-redis-configuration"></a>

您可以使用本文档来了解 Tr AWS ansform for 大型机运行时中的 Redis 缓存、Gapwalk 配置、支持的 Redis 属性以及文件`application-main.yml`如何引用 Redis 缓存的秘密 ARN。

## 大型机运行时的 Trans AWS form 中的 Redis 缓存
<a name="ba-redis-caches-in-runtime"></a>

Redis 服务器可用作 Tr AWS ansform for 大型机 Gapwalk 应用程序中各种功能的缓存，例如：


****  

| AWS 针对使用 Redis 缓存的大型机运行时功能进行转换 | 说明 | 
| --- | --- | 
| Blusam缓存 | Redis Blusam 缓存，用于使用写入策略高效读取记录，以优化批处理负载上遇到的写入密集型工作负载。 | 
| Blusam锁 | 用于数据集和记录的分布式锁的缓存。 | 
| 数据集目录 | 目录数据集缓存。 | 
| 会话缓存 | 用于的 Redis 缓存。 HttpSession缓存存储用户名、与 Angular 前端的对话状态以及特定的 “方言”（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>

下表显示了适用于大型机运行时的 Trans AWS form 上全局缓存和特定 Redis 缓存支持的 Redis 属性。


****  

| 属性名称 | 必填？ | 说明 | 值 | 默认 | 
| --- | --- | --- | --- | --- | 
| mode | 否 | Redis 的运行模式。 | standalone \| cluster | standalone | 
| hostname | 是 | Redis 服务器的主机名或 IP 地址。 | 字符串 | null | 
| port | 是 | Redis 服务器侦听连接的端口号。 | int | null | 
| username | 否 | 用于身份验证的用户名。 | 字符串 | null | 
| password | 否 | 用于身份验证的密码。 | 字符串 | 空字符串 | 
| useSsl  | 否 | 指定是否为 Redis 连接启用 SSL/TLS 加密。 | 布尔值 | false | 
| database | 否 | 要使用的 Redis 数据库编号。Redis 支持多个逻辑数据库，而此属性指定要使用哪个逻辑数据库。 | 整数 | 0 | 
| maxTotal | 否 | Redis 连接池中支持的最大连接数。 | int  | 128 | 
| maxIdle | 否 | Redis 连接池中支持的最大空闲连接数。 | int | 128 | 
| minIdle | 否 | 要在 Redis 连接池中保持的最小空闲连接数。 | int | 16 | 
| testOnBorrow  | 否 | 布尔值，指示在从池中借用连接之前是否对连接进行验证。 | 布尔值 | true | 
| testOnReturn  | 否 | 布尔值，指示在将连接返回到池之前是否对连接进行验证。 | 布尔值 | true | 
| testWhileIdle  | 否 | 布尔值，指示是否定期验证池中的空闲连接。 | 布尔值 | true | 
| testOnCreate  | 否 | 布尔值，指示在创建连接时是否对连接进行验证。 | 布尔值 | true | 
| minEvictableIdleTimeMillis  | 否 | 空闲连接在被退出之前必须在池中保持的最少时间（以毫秒为单位）。 | 长整数 | 60000L  | 
| timeBetweenEvictionRunsMillis  | 否 | 连续运行空闲连接退出器线程之间的时间（以毫秒为单位）。 | 长整数 | 30000L | 
| numTestsPerEvictionRun  | 否 | 每次运行空闲连接退出程序线程期间要测试的最大连接数。 | int | –1 | 
| blockWhenExhausted  | 否 | 布尔值，指示在连接池耗尽时是否阻塞并等待可用的连接。 | 布尔值 | true | 
| nettyThreads  | 否 | 用于处理 Redis 连接的 Netty 线程数。 | int | 32 | 
| subscriptionsPerConnection  | 否 | 每个 Redis 连接支持的最大订阅数。 | int | 10 | 
| subscriptionConnectionPoolSize  | 否 | Redis 订阅连接池中支持的最大连接数。 | int | 100 | 
| pageSizeInBytes  | 否 | Redis 操作的默认页面大小（以字节为单位）。 | 长整数 | 262144000  | 
| readTimeout | 否 | Redis 操作的读取超时时间（以毫秒为单位）。 | 长整数 | 2000 | 
| timeToLiveMillis | 否 | 缓存条目在被视为过期并被删除之前在缓存中停留的持续时间（以毫秒为单位）。如果未指定此属性，则默认情况下，缓存条目不会自动过期。 | 长整数 | –1 | 
| useAsyncBatch | 否 | 启用 Redis 批量写入操作的异步执行以提高性能。设置为 false 时，将回退到同步执行模式。 | 布尔值 | true | 
| useBatchInMemoryAtomic | 否 | 启用 Redis 批量读取操作的 In-memory-atomic模式。设置为 false 时，将回退到默认的内存中批处理模式。 | 布尔值 | 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 缓存的密钥管理器
<a name="ba-runtime-redis-secrets-properties"></a>

`application-main.yaml` 文件可以引用 Redis 缓存的密钥 ARN。有关如何进行集成 AWS Secrets Manager 以在运行时安全检索 Redis 连接详细信息的信息，请参阅[AWS 针对大型机运行时机密进行转换](ba-runtime-config-app-secrets.md)。