云服务器内容精选

  • 响应消息 正常响应要素说明 表2 要素说明 参数 参数类型 描述 total_count Integer 历史记录总数。 histories Array of objects 参数修改历史。 详情请参见表3。 表3 histories字段数据结构说明 名称 参数类型 说明 parameter_name String 参数名称。 old_value String 旧参数值。 new_value String 新参数值。 update_result String 更新结果。 SUC CES S:成功。 FAILED:失败。 applied Boolean 是否已应用。 true:已应用。 false:未应用。 update_time String 参数修改时间。 apply_time String 参数应用时间。 正常响应样例 { "total_count" : 3, "histories" : [ { "parameter_name" : "fill factor (%)", "old_value" : "0", "new_value" : "2", "update_result" : "SUCCESS", "applied" : true, "update_time" : "2022-10-29T09:39:21+0000", "apply_time" : "2022-10-31T01:46:29+0000" }, { "parameter_name" : "remote login timeout (s)", "old_value" : "10", "new_value" : "20", "update_result" : "SUCCESS", "applied" : true, "update_time" : "2022-10-29T09:38:36+0000", "apply_time" : "2022-10-29T09:38:36+0000" }, { "parameter_name" : "remote query timeout (s)", "old_value" : "600", "new_value" : "601", "update_result" : "SUCCESS", "applied" : true, "update_time" : "2022-10-29T09:40:30+0000", "apply_time" : "2022-10-29T09:40:30+0000" } ] } 异常响应 请参见异常请求结果。
  • URI URI格式 GET /v3/{project_id}/instances/{instance_id}/configuration-histories?offset={offset}&limit={limit}&start_time={start_time}&end_time={end_time}¶m_name={param_name} 参数说明 表1 参数说明 名称 是否必选 参数类型 说明 project_id 是 String 租户在某一Region下的项目ID。 获取方法请参见获取项目ID。 instance_id 是 String 实例ID。 offset 否 Integer 分页参数。 缺省值:0 limit 否 Integer 分页参数。 缺省值:10 start_time 否 String 开始时间默认为当前时间的前7天,格式:2020-09-01T18:50:20Z end_time 否 String 结束时间默认为当前时间,格式:2020-09-01T18:50:20Z param_name 否 String 参数名称。
  • 响应消息 正常响应要素说明 表4 要素说明 名称 参数类型 说明 configuration Object 参数模板信息。 详情请参见表5。 表5 configuration字段数据结构说明 名称 参数类型 说明 id String 参数模板ID。 name String 参数模板名称。 datastore_version_name String 数据库版本名称。 datastore_name String 数据库名称。 description String 描述。 created String 创建时间,格式为"yyyy-MM-ddTHH:mm:ssZ"。 其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。 updated String 更新时间,格式为"yyyy-MM-ddTHH:mm:ssZ"。 其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。 正常响应样例 { "configuration": { "id": "463b4b58-d0e8-4e2b-9560-5dea4552fde9", "name": "configuration_test", "datastore_version_name": "5.7", "datastore_name": "mysql", "description": "configuration_test", "created": "2017-04-09T08:27:56+0800", "updated": "2017-04-09T08:27:56+0800" } } 异常响应 请参见异常请求结果。
  • 请求示例 创建参数模板configuration_test。 POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/configurations { "name": "configuration_test", "description": "configuration_test", "values": { "div_precision_increment": "6", "connect_timeout": "20" }, "datastore": { "type": "mysql", "version": "5.7" } }
  • 任务参数说明 表1 任务参数说明 参数名 描述 取值范围 默认值 参数类型 是否需要重启 applier_thread_num 全量阶段写数据到目标数据库的线程数 与规格大小有关。 极小规格:1-4 小规格:1-4 中规格:1-8 大规格:1-18 超大规格:1-24 与规格大小有关。 极小规格:2 小规格:2 中规格:4 大规格:6 超大规格:12 int 是 read_task_num 全量阶段从源数据库读取数据的线程数 与规格大小有关。 极小规格:1-2 小规格:1-2 中规格:1-4 大规格:1-8 超大规格:1-12 与规格大小有关。 极小规格:1 小规格:1 中规格:2 大规格:4 超大规格:6 int 是 shard_task_num 全量阶段从源数据库分片线程数 与规格大小有关。 极小规格:1-2 小规格:1-2 中规格:1-4 大规格:1-8 超大规格:1-8 与规格大小有关。 极小规格:1 小规格:1 中规格:2 大规格:4 超大规格:4 int 是 increment_writer_num 增量阶段写目标库线程数 与规格大小有关。 极小规格:1-8 小规格:1-16 中规格:1-32 大规格:1-128 超大规格:1-128 与规格大小有关。 极小规格:4 小规格:8 中规格:16 大规格:64 超大规格:64 int 是 relay_socket_timeout 增量阶段从源数据库拉取日志的超时时间 30000-2147483647毫秒 30000毫秒 int 是 datamove_source_socket_timeout 全量阶段从源数据库拉取数据的超时时间 120000-2147483647毫秒 120000毫秒 int 是
  • 操作步骤 在“实时同步管理”界面,选择指定的同步任务。 单击任务名称,页面跳转至“基本信息”页面。 单击左侧“参数管理”,在“参数”页签可对当前同步任务的参数信息进行修改。 图1 查看参数信息 修改完成后,可选择“保存”或者“取消”设置。 单击“保存”,在弹出框中单击“是”,保存修改。 单击“取消”,在弹出框中单击“是”,放弃本次设置。 部分参数完成修改后,需要重启任务后才生效,可单击右上角“重启”按钮使之生效,也可参考重启同步任务内容进行重启。 除此以外,重置、续传、任务重建、主备倒换、全量阶段修改限速操作也会重启任务进程使设置生效。
  • 响应示例 状态码: 200 任务参数配置列表信息。 { "count" : 0, "parameter_config_list" : [ { "name" : "applier_thread_num", "value" : "20", "default_value" : "10", "value_range" : "1-512", "is_need_restart" : true, "description" : "The number of threads that write data to the target database during the full stage", "created_at" : "2020-09-01T18:50:20Z", "updated_at" : "2020-09-01T18:50:20Z" }, { "name" : "read_task_num", "value" : "20", "default_value" : "10", "value_range" : "1-512", "is_need_restart" : true, "description" : "The number of threads reading data from the source database during the full volume stage", "created_at" : "2020-09-01T18:50:20Z", "updated_at" : "2020-09-01T18:50:20Z" } ] }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 count Integer 总数。 parameter_config_list Array of 表10-9 objects 任务参数列表。 详情请参见表5。 表5 parameter_config_list字段数据结构说明 参数 参数类型 描述 name String 参数名称。 value String 参数值。 default_value String 参数默认值。 value_range String 参数值范围,如Integer取值0-1、Boolean取值true|false等。 is_need_restart Boolean 是否需要重启。默认为true, “false”表示否。“true”表示是。 description String 参数描述,目前只支持英文。 created_at String 创建时间,例如:2023-01-20T07:18:26Z。 updated_at String 更新时间,例如:2023-03-01T09:42:02Z。
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 发送的实体的MIME类型。推荐用户默认使用application/json,如果API是对象、镜像上传等接口,媒体类型可按照流类型的不同进行确定。 缺省值:application/json X-Auth-Token 是 String 从 IAM 服务获取的用户Token。用户Token也就是调用获取用户Token接口的响应值,该接口是唯一不需要认证的接口。请求响应成功后在响应消息头中包含的“X-Subject-Token”的值即为Token值。 X-Language 否 String 请求语言类型。 缺省值:en-us 枚举值: en-us zh-cn
  • URI GET /v5/{project_id}/jobs/{job_id}/configurations 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 租户在某一Region下的Project ID。 获取方法请参见获取项目ID。 job_id 是 String 任务ID。 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 String 偏移量,表示从此偏移量开始查询,offset 大于等于 0。默认为0 limit 否 String 每页显示的条目数量。默认为10,取值范围【1-1000】 name 否 String 根据参数名查询。
  • 参数管理的页面权限? 权限设计 访问参数列表页:需要list权限: coc:parameter:list 获取参数详情:需要get权限:coc:parameter:get 删除参数:需要操作类权限:coc:parameter:delete 创建参数:需要操作类权限:coc:parameter:create 更新参数:需要操作类权限:coc:parameter:update 资源类权限(具体到某一个region下 && 某一个租户的一个参数):coc:*:*:parameter:name(第一个*代表所有regionID,第二个*所有租户,name代表参数名称) 资源类权限决定你可以访问哪些数据,操作类权限是对你有的资源类权限进行操作,常见问题: 如果你可以访问某个参数,但是你访问不了列表页,代表你缺少coc:parameter:list权限 如果你找不到指定的参数,需要确认是否有该参数的权限 coc:service-name:region:account-id:resource-type:resource-path这个是资源类权限的结构,*代表该层级所有权限,添加资源类权限需要按照这个格式填写 父主题: 参数管理常见问题
  • 接口约束 支持的数据库引擎:MySQL、PostgreSQL、Microsoft SQL Server。 修改参数模板名称“name”不能与默认参数模板或已有参数模板的名称重复,默认参数模板不允许修改。 修改的参数必须在指定数据库版本的默认参数范围内,具体可配置范围请参见《云数据库 RDS用户指南》中“修改实例参数”的内容。 敏感参数,例如:“lower_case_table_names”,修改存在风险,详情请参见《云数据库RDS用户指南》中“RDS for MySQL参数调优建议”的内容。 要修改的参数信息,不可全部为空。
  • 请求示例 修改参数模板的参数值 PUT https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/configurations/463b4b58-d0e8-4e2b-9560-5dea4552fde9 { "name": "configuration_test", "description": "configuration_test", "values": { "div_precision_increment": "6", "connect_timeout": "20" } }
  • 响应消息 正常响应要素说明 表3 要素说明 名称 参数类型 说明 configuration Object 参数模板信息。详情请参见表4。 表4 configuration字段数据结构说明 名称 参数类型 说明 id String 参数模板ID。 name String 参数模板名称。 ignored_params List 请求参数“values”中被忽略掉,没有生效的参数名称列表。 当参数不存在时,参数修改不会下发,并通过此参数返回所有被忽略的参数名称。 正常响应样例 { "configuration": { "id": "463b4b58-d0e8-4e2b-9560-5dea4552fde9", "name": "configuration_test", "ignored_params": {} } } 异常响应 请参见异常请求结果。
  • 响应消息 响应参数 参数说明见表2。 表2 参数说明 参数 类型 说明 status String 实例运行状态。 instance_id String 实例ID。 redis_config Array 实例配置项数组。具体请参考表3。 config_status String 实例修改状态。 UPDATING FAILURE SUCCESS config_time String 实例操作时间。格式为:2017-03-31T12:24:46.297Z 表3 redis_config参数说明 参数 类型 说明 description String 配置项的描述。 param_id Integer 配置参数ID。取值见表4“参数ID”列。 param_name String 配置参数名称。取值见表4“参数名称”列。 param_value String 配置参数值。 default_value String 配置参数的默认值。取值见表4“默认值”列。 value_type String 配置参数的值类型。取值见表4“参数类型”列。 value_range String 配置参数的取值范围。取值见表4“取值范围”列。 缓存实例配置参数的说明见表4。 表4 缓存实例配置参数说明 参数ID 参数名称 适用引擎 参数类型 参数解释 取值范围 默认值 1 timeout Redis、Memcached Interger 客户端与服务端连接空闲超时断开时间,参数设为0表示连接永不断开。 0~7200,单位:秒 0 2 maxmemory-policy Redis、Memcached Enum 内存使用达到上限时对缓存数据管理策略。 参数说明见逐出策略。 volatile-lru allkeys-lru volatile-random allkeys-random volatile-ttl noeviction volatile-lfu allkeys-lfu volatile-lru 说明: 如果是2020年7月之前创建的Redis实例,且没有修改过该参数,则默认值为noeviction。如果是2020年7月之后创建的实例,默认值都为volatile-lru。 3 hash-max-ziplist-entries Redis Interger 当hash表中记录数少于参数值,使用ziplist编码格式,节约内存。 1~10000 512 4 hash-max-ziplist-value Redis Interger 当hash表中各字段长度的最大值小于参数值时,使用ziplist编码格式,节约内存。 1~10000 64 5 list-max-ziplist-entries Redis Interger 当列表中记录数少于参数值,使用ziplist编码格式,节约内存。 1~10000 512 6 list-max-ziplist-value Redis Interger 当列表中各字段长度的最大值小于参数值时,使用ziplist编码格式,节约内存。 1~10000 64 7 set-max-intset-entries Redis Interger 当一个集合仅包含字符串且整型元素数量少于参数值时,使用intset编码格式,节约内存。 1~10000 512 8 zset-max-ziplist-entries Redis Interger 当有序集合中记录数少于参数值,使用ziplist编码格式,节约内存。 1~10000 128 9 zset-max-ziplist-value Redis Interger 当有序集合中各字段长度的最大值小于参数值时,使用ziplist编码格式,节约内存。 1~10000 64 10 latency-monitor-threshold Redis Interger 延时监控的采样时间阈值(最小值)。 当阈值设置为0时,不做监控,也不采样;当阈值设置为大于0时,将监控并记录执行耗时大于阈值的操作。 用户可以通过LATENCY等命令获取统计数据和配置、执行采样监控。详情参考Redis官网说明:https://redis.io/docs/reference/optimization/latency-monitor/。 0~86400000,单位:毫秒。 0 12 reserved-memory Redis Interger 预留内存,只有单机、主备实例有此配置。 预留内存将被分配给实例VM,保证D CS 实例后台进程在做持久化和主从同步等任务时拥有足够的内存。 预留内存大小可以调高或者调低,但不能超过实例当前剩余的可用内存,以及最大可用内存的80%。其中实例最大可用内存可参考《分布式缓存服务产品介绍》文档。 实例最大可用内存数的0-80%,同时不能超过实例当前剩余的可用内存,单位:MB。 0 13 notify-keyspace-events Redis String 键空间通知,配置该参数后客户端可以通过Redis的订阅与发布功能,来接收那些以某种方式改动了Redis数据集的事件。 当配置为空字符串""或null时,配置会使用默认值Ex。 您可配置为以下字符的任意组合,指定了服务器该发送哪些类型的通知: K:键空间通知,所有通知以__keyspace@__为前缀。 E:键事件通知,所有通知以__keyevent@__为前缀。 g:DEL、EXPIRE、RENAME等类型无关的通用命令的通知。 $:字符串命令的通知。 l:列表命令的通知。 s:集合命令的通知。 h:哈希命令的通知。 z:有序集合命令的通知。 x:过期事件:每当有过期键被删除时发送。 e:驱逐(evict)事件:每当有键因为maxmemory政策而被删除时发送。 其他描述,请参考表格下方的说明。 Ex notify-keyspace-events参数的说明如下: 有效值为[K|E|KE][A|g|l|s|h|z|x|e|$],即输入的参数中至少要有一个K或者E。 A为“g$lshzxe”所有参数的集合别名。A与“g$lshzxe”中任意一个不能同时出现。 例如,如果只想订阅键空间中和列表相关的通知,那么参数就应该设为Kl。若将参数设为字符串"AKE"表示发送所有类型的通知。 响应样例 { "status": "RUNNING", "instance_id": "c08fdc6e-5c25-4185-ab57-c0a5529b727f", "redis_config": [ { "description": "How Redis will select what to remove when maxmemory is reached, You can select among five behaviors: volatile-lru : remove the key with an expire set using an LRU algorithm allkeys-lru : remove any key according to the LRU algorithm volatile-random: remove a random key with an expire set allkeys-random: remove a random key, any key volatile-ttl : remove the key with the nearest expire time (minor TTL) noeviction : don't expire at all, just return an error on write operations", "param_id": 2, "param_name": "maxmemory-policy", "param_value": "noeviction", "default_value": "noeviction", "value_type": "Enum", "value_range": "volatile-lru,allkeys-lru,volatile-random,allkeys-random,volatile-ttl,noeviction" }, { "description": "Hashes are encoded using a memory efficient data structure when they have a small number of entries", "param_id": 3, "param_name": "hash-max-ziplist-entries", "param_value": "512", "default_value": "512", "value_type": "Interger", "value_range": "1-10000" }, { "description": "Hashes are encoded using a memory efficient data structure when the biggest entry does not exceed a given threshold", "param_id": 4, "param_name": "hash-max-ziplist-value", "param_value": "64", "default_value": "64", "value_type": "Interger", "value_range": "1-10000" }, { "description": "Lists are encoded using a memory efficient data structure when they have a small number of entries", "param_id": 5, "param_name": "list-max-ziplist-entries", "param_value": "512", "default_value": "512", "value_type": "Interger", "value_range": "1-10000" }, { "description": "Lists are encoded using a memory efficient data structure when the biggest entry does not exceed a given threshold", "param_id": 6, "param_name": "list-max-ziplist-value", "param_value": "64", "default_value": "64", "value_type": "Interger", "value_range": "1-10000" }, { "description": "When a set is composed of just strings that happen to be integers in radix 10 in the range of 64 bit signed integers.", "param_id": 7, "param_name": "set-max-intset-entries", "param_value": "512", "default_value": "512", "value_type": "Interger", "value_range": "1-10000" }, { "description": "Sorted sets are encoded using a memory efficient data structure when they have a small number of entries", "param_id": 8, "param_name": "zset-max-ziplist-entries", "param_value": "128", "default_value": "128", "value_type": "Interger", "value_range": "1-10000" }, { "description": "Sorted sets are encoded using a memory efficient data structure when the biggest entry does not exceed a given threshold", "param_id": 9, "param_name": "zset-max-ziplist-value", "param_value": "64", "default_value": "64", "value_type": "Interger", "value_range": "1-10000" }, { "description": "Close the connection after a client is idle for N seconds (0 to disable)", "param_id": 1, "param_name": "timeout", "param_value": "0", "default_value": "0", "value_type": "Interger", "value_range": "0-7200" }, { "description": "Only events that run in more time than the configured latency-monitor-threshold will be logged as latency spikes. If latency-monitor-threshold is set to 0, latency monitoring is disabled. If latency-monitor-threshold is set to a value greater than 0, all events blocking the server for a time equal to or greater than the configured latency-monitor-threshold will be logged.", "param_id": 10, "param_name": "latency-monitor-threshold", "param_value": "0", "default_value": "0", "value_type": "Interger", "value_range": "0-86400000" }, { "description": "The total memory, in bytes, reserved for non-data usage.", "param_id": 12, "param_name": "reserved-memory", "param_value": "0", "default_value": "0", "value_type": "Interger", "value_range": "0-6553" }, { "description": "Redis can notify Pub or Sub clients about events happening in the key space", "param_id": 13, "param_name": "notify-keyspace-events", "param_value": null, "default_value": null, "value_type": "regular", "value_range": "([KE]+([A]|[g$lshzxe]+)){0,11}" } ], "config_status": "SUCCESS", "config_time": "" }