计算
弹性云服务器 ECS
Flexus云服务
裸金属服务器 BMS
弹性伸缩 AS
镜像服务 IMS
专属主机 DeH
函数工作流 FunctionGraph
云手机服务器 CPH
Huawei Cloud EulerOS
网络
虚拟私有云 VPC
弹性公网IP EIP
虚拟专用网络 VPN
弹性负载均衡 ELB
NAT网关 NAT
云专线 DC
VPC终端节点 VPCEP
云连接 CC
企业路由器 ER
企业交换机 ESW
全球加速 GA
安全与合规
安全技术与应用
Web应用防火墙 WAF
企业主机安全 HSS
云防火墙 CFW
安全云脑 SecMaster
DDoS防护 AAD
数据加密服务 DEW
数据库安全服务 DBSS
云堡垒机 CBH
数据安全中心 DSC
云证书管理服务 CCM
边缘安全 EdgeSec
威胁检测服务 MTD
CDN与智能边缘
内容分发网络 CDN
CloudPond云服务
智能边缘云 IEC
迁移
主机迁移服务 SMS
对象存储迁移服务 OMS
云数据迁移 CDM
迁移中心 MGC
大数据
MapReduce服务 MRS
数据湖探索 DLI
表格存储服务 CloudTable
云搜索服务 CSS
数据接入服务 DIS
数据仓库服务 GaussDB(DWS)
数据治理中心 DataArts Studio
数据可视化 DLV
数据湖工厂 DLF
湖仓构建 LakeFormation
企业应用
云桌面 Workspace
应用与数据集成平台 ROMA Connect
云解析服务 DNS
专属云
专属计算集群 DCC
IoT物联网
IoT物联网
设备接入 IoTDA
智能边缘平台 IEF
用户服务
账号中心
费用中心
成本中心
资源中心
企业管理
工单管理
国际站常见问题
ICP备案
我的凭证
支持计划
客户运营能力
合作伙伴支持计划
专业服务
区块链
区块链服务 BCS
Web3节点引擎服务 NES
解决方案
SAP
高性能计算 HPC
视频
视频直播 Live
视频点播 VOD
媒体处理 MPC
实时音视频 SparkRTC
数字内容生产线 MetaStudio
存储
对象存储服务 OBS
云硬盘 EVS
云备份 CBR
存储容灾服务 SDRS
高性能弹性文件服务 SFS Turbo
弹性文件服务 SFS
云硬盘备份 VBS
云服务器备份 CSBS
数据快递服务 DES
专属分布式存储服务 DSS
容器
云容器引擎 CCE
容器镜像服务 SWR
应用服务网格 ASM
华为云UCS
云容器实例 CCI
管理与监管
云监控服务 CES
统一身份认证服务 IAM
资源编排服务 RFS
云审计服务 CTS
标签管理服务 TMS
云日志服务 LTS
配置审计 Config
资源访问管理 RAM
消息通知服务 SMN
应用运维管理 AOM
应用性能管理 APM
组织 Organizations
优化顾问 OA
IAM 身份中心
云运维中心 COC
资源治理中心 RGC
应用身份管理服务 OneAccess
数据库
云数据库 RDS
文档数据库服务 DDS
数据管理服务 DAS
数据复制服务 DRS
云数据库 GeminiDB
云数据库 GaussDB
分布式数据库中间件 DDM
数据库和应用迁移 UGO
云数据库 TaurusDB
人工智能
人脸识别服务 FRS
图引擎服务 GES
图像识别 Image
内容审核 Moderation
文字识别 OCR
AI开发平台ModelArts
图像搜索 ImageSearch
对话机器人服务 CBS
华为HiLens
视频智能分析服务 VIAS
语音交互服务 SIS
应用中间件
分布式缓存服务 DCS
API网关 APIG
微服务引擎 CSE
分布式消息服务Kafka版
分布式消息服务RabbitMQ版
分布式消息服务RocketMQ版
多活高可用服务 MAS
事件网格 EG
企业协同
华为云会议 Meeting
云通信
消息&短信 MSGSMS
云生态
合作伙伴中心
云商店
开发者工具
SDK开发指南
API签名指南
Terraform
华为云命令行工具服务 KooCLI
其他
产品价格详情
系统权限
管理控制台
客户关联华为云合作伙伴须知
消息中心
公共问题
开发与运维
应用管理与运维平台 ServiceStage
软件开发生产线 CodeArts
需求管理 CodeArts Req
部署 CodeArts Deploy
性能测试 CodeArts PerfTest
编译构建 CodeArts Build
流水线 CodeArts Pipeline
制品仓库 CodeArts Artifact
测试计划 CodeArts TestPlan
代码检查 CodeArts Check
代码托管 CodeArts Repo
云应用引擎 CAE
开天aPaaS
云消息服务 KooMessage
云手机服务 KooPhone
云空间服务 KooDrive
更新时间:2022-07-29 GMT+08:00

资源管理函数

资源管理模块相关函数介绍。

  • gs_wlm_readjust_user_space(oid)

    描述:用户永久存储空间校准函数。入参为用户oid,入参为0的情况下,会校准所有用户的永久存储空间。

    返回值类型:text

    示例:

    select gs_wlm_readjust_user_space(0);
    gs_wlm_readjust_user_space
    ----------------------------
    Exec Success
    (1 row)
  • pgxc_wlm_readjust_schema_space()

    描述:Schema永久存储空间校准函数。

    返回值类型:text

    示例:

    select pgxc_wlm_readjust_schema_space();
    pgxc_wlm_readjust_schema_space
    --------------------------------
    Exec Success
    (1 row)
  • pgxc_wlm_get_schema_space(cstring)

    描述:在CN上查询某个逻辑集群下各实例的Schema空间信息,入参为逻辑集群名称。

    返回值类型:record

    函数返回字段如下:

    名称

    类型

    描述

    schemaname

    text

    模式名

    schemaid

    oid

    模式OID

    databasename

    text

    数据库名

    databaseid

    oid

    数据库OID

    nodename

    text

    实例名称

    nodegroup

    text

    节点组名称

    usedspace

    bigint

    已使用的空间大小

    permspace

    bigint

    空间上限值

    示例:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    select * from pgxc_wlm_get_schema_space('group1');
         schemaname     | schemaid | databasename | databaseid |   nodename   |  nodegroup   | usedspace | permspace
    --------------------+----------+--------------+------------+--------------+--------------+-----------+-----------
     pg_catalog         |       11 | test1        |      16384 | datanode1    | installation |   9469952 |        -1
     public             |     2200 | gaussdb     |      15253 | datanode1    | installation |  25280512 |        -1
     pg_toast           |       99 | test1        |      16384 | datanode1    | installation |   1859584 |        -1
     cstore             |      100 | test1        |      16384 | datanode1    | installation |         0 |        -1
     data_redis         |    18106 | gaussdb     |      15253 | datanode1    | installation |    655360 |        -1
     data_redis         |    18116 | test1        |      16384 | datanode1    | installation |         0 |        -1
     public             |     2200 | test1        |      16384 | datanode1    | installation |     16384 |        -1
     dbms_om            |     3987 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     dbms_job           |     3988 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     dbms_om            |     3987 | test1        |      16384 | datanode1    | installation |         0 |        -1
     dbms_job           |     3988 | test1        |      16384 | datanode1    | installation |         0 |        -1
     sys                |    11693 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     sys                |    11693 | test1        |      16384 | datanode1    | installation |         0 |        -1
     utl_file           |    14644 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     utl_raw            |    14669 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     dbms_sql           |    14674 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     dbms_output        |    14662 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     dbms_random        |    14666 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     dbms_lob           |    14701 | gaussdb     |      15253 | datanode1    | installation |         0 |        -1
     information_schema |    14300 | gaussdb     |      15253 | datanode1    | installation |    294912 |        -1
     information_schema |    14300 | test1        |      16384 | datanode1    | installation |    294912 |        -1
     utl_file           |    14644 | test1        |      16384 | datanode1    | installation |         0 |        -1
     dbms_output        |    14662 | test1        |      16384 | datanode1    | installation |         0 |        -1
     dbms_random        |    14666 | test1        |      16384 | datanode1    | installation |         0 |        -1
     utl_raw            |    14669 | test1        |      16384 | datanode1    | installation |         0 |        -1
     dbms_sql           |    14674 | test1        |      16384 | datanode1    | installation |         0 |        -1
     dbms_lob           |    14701 | test1        |      16384 | datanode1    | installation |         0 |        -1
     pg_catalog         |       11 | gaussdb     |      15253 | datanode1    | installation |  13049856 |        -1
     redisuser          |    16387 | gaussdb     |      15253 | datanode1    | installation |    630784 |        -1
     pg_toast           |       99 | gaussdb     |      15253 | datanode1    | installation |   3080192 |        -1
     cstore             |      100 | gaussdb     |      15253 | datanode1    | installation |   2408448 |        -1
     pg_catalog         |       11 | test1        |      16384 | datanode2    | installation |   9469952 |        -1
     public             |     2200 | gaussdb     |      15253 | datanode2    | installation |  25214976 |        -1
     pg_toast           |       99 | test1        |      16384 | datanode2    | installation |   1859584 |        -1
     cstore             |      100 | test1        |      16384 | datanode2    | installation |         0 |        -1
     data_redis         |    18106 | gaussdb     |      15253 | datanode2    | installation |    655360 |        -1
     data_redis         |    18116 | test1        |      16384 | datanode2    | installation |         0 |        -1
     public             |     2200 | test1        |      16384 | datanode2    | installation |     16384 |        -1
     dbms_om            |     3987 | gaussdb     |      15253 | datanode2    | installation |         0 |        -1
     dbms_job           |     3988 | gaussdb     |      15253 | datanode2    | installation |         0 |        -1
     dbms_om            |     3987 | test1        |      16384 | datanode2    | installation |         0 |        -1
     dbms_job           |     3988 | test1        |      16384 | datanode2    | installation |         0 |        -1
    
  • pgxc_wlm_analyze_schema_space(cstring)

    描述:在CN上查询某个逻辑集群下集群整体的Schema空间信息,入参为逻辑集群名称。

    返回值类型:record

    函数返回字段如下:

    名称

    类型

    描述

    schemaname

    text

    模式名

    databasename

    text

    数据库名

    nodegroup

    text

    节点组名称

    total_value

    bigint

    该模式的集群空间总值

    avg_value

    bigint

    该模式的各实例空间平均值

    skew_percent

    integer

    倾斜率

    extend_info

    text

    提供信息包括:单实例空间最大值、单实例空间最小值以及最大最小空间所在的实例名

    示例:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    select * from pgxc_wlm_analyze_schema_space('group1');
         schemaname     | databasename |  nodegroup   | total_value | avg_value | skew_percent |                  extend_info
    --------------------+--------------+--------------+-------------+-----------+--------------+-----------------------------------------------
     pg_catalog         | test1        | installation |    56819712 |   9469952 |            0 | min:9469952 datanode1,max:9469952 datanode1
     public             | gaussdb     | installation |   150495232 |  25082538 |            0 | min:24903680 datanode6,max:25280512 datanode1
     pg_toast           | test1        | installation |    11157504 |   1859584 |            0 | min:1859584 datanode1,max:1859584 datanode1
     cstore             | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     data_redis         | gaussdb     | installation |     1966080 |    327680 |           50 | min:0 datanode4,max:655360 datanode1
     data_redis         | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     public             | test1        | installation |       98304 |     16384 |            0 | min:16384 datanode1,max:16384 datanode1
     dbms_om            | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_job           | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_om            | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_job           | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     sys                | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     sys                | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     utl_file           | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     utl_raw            | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_sql           | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_output        | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_random        | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_lob           | gaussdb     | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     information_schema | gaussdb     | installation |     1769472 |    294912 |            0 | min:294912 datanode1,max:294912 datanode1
     information_schema | test1        | installation |     1769472 |    294912 |            0 | min:294912 datanode1,max:294912 datanode1
     utl_file           | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_output        | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_random        | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     utl_raw            | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_sql           | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     dbms_lob           | test1        | installation |           0 |         0 |            0 | min:0 datanode1,max:0 datanode1
     pg_catalog         | gaussdb     | installation |    75431936 |  12571989 |            3 | min:12124160 datanode4,max:13049856 datanode1
     redisuser          | gaussdb     | installation |     1884160 |    314026 |           50 | min:16384 datanode4,max:630784 datanode1
     pg_toast           | gaussdb     | installation |    17154048 |   2859008 |            7 | min:2637824 datanode4,max:3080192 datanode1
     cstore             | gaussdb     | installation |    15294464 |   2549077 |            5 | min:2408448 datanode1,max:2703360 datanode6
    (31 rows)
    
  • gs_wlm_set_queryband_action(cstring,cstring,int4)

    描述:设置query_band关联行为和次序。

    返回值类型:boolean

    函数入参字段如下:

    名称

    类型

    描述

    qband

    cstring

    query_band键值对,长度上限为63个字符。

    action

    cstring

    query_band关联行为。

    order

    int4

    query_band搜索次序,缺省参数,默认为-1。

    示例:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    select * from gs_wlm_set_queryband_action('a=1','respool=p1');
     gs_wlm_set_queryband_action
    -----------------------------
     t
    (1 row)
    select * from gs_wlm_set_queryband_action('a=3','respool=p1;priority=rush',1);
     gs_wlm_set_queryband_action
    -----------------------------
     t
    (1 row)
    
  • gs_wlm_set_queryband_order(cstring,int4)

    描述:设置query_band次序。

    返回值类型:boolean

    函数入参字段如下:

    名称

    类型

    描述

    qband

    cstring

    query_band键值对

    order

    int4

    query_band搜索次序,缺省参数,默认为-1

    示例:

    1
    2
    3
    4
    5
    select * from gs_wlm_set_queryband_order('a=1',2);
     gs_wlm_set_queryband_action
    -----------------------------
     t
    (1 row)
    
  • gs_wlm_get_queryband_action(cstring)

    描述:查询query_band关联行为和次序。

    返回值类型:record

    函数返回字段如下:

    名称

    类型

    描述

    qband

    cstring

    query_band键值对

    respool_id

    Oid

    query band关联资源池OID

    respool

    text

    query band关联资源池名

    priority

    text

    query band关联队队列内优先级

    qborder

    int4

    query_band搜索次序

    示例:

    1
    2
    3
    4
    5
    select * from gs_wlm_get_queryband_action('a=1');
    qband | respool_id | respool | priority | qborder
    -------+------------+---------+----------+---------
     a=1   |      16388 | p1      | Medium   |      -1
    (1 row)
    
  • gs_cgroup_reload_conf()

    描述:在当前实例上进行cgroup配置文件在线加载。

    返回值类型:record

    函数返回字段如下:

    名称

    类型

    描述

    node_name

    text

    实例名称

    node_host

    text

    实例所在节点的IP地址

    result

    text

    cgroup在线加载是否成功

    示例:

    1
    2
    3
    4
    select * from gs_cgroup_reload_conf();
     node_name |   node_host    | result
    -----------+----------------+---------
     cn_5001   | 192.168.178.35 | success
    
  • pgxc_cgroup_reload_conf()

    描述:在系统所有实例上进行cgroup配置文件在线加载。

    返回值类型:record

    函数返回字段如下:

    名称

    类型

    描述

    node_name

    text

    实例名称

    node_host

    text

    实例所在节点的IP地址

    result

    text

    cgroup在线加载是否成功

    示例:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    select * from pgxc_cgroup_reload_conf();
      node_name   |    node_host    | result
    --------------+-----------------+---------
     dn_6025_6026 | 192.168.178.177 | success
     dn_6049_6050 | 192.168.179.79  | success
     dn_6051_6052 | 192.168.179.79  | success
     dn_6055_6056 | 192.168.179.79  | success
     dn_6067_6068 | 192.168.181.57  | success
     dn_6023_6024 | 192.168.178.39  | success
     dn_6009_6010 | 192.168.181.21  | success
     dn_6011_6012 | 192.168.181.21  | success
     dn_6015_6016 | 192.168.181.21  | success
     dn_6029_6030 | 192.168.178.177 | success
     dn_6031_6032 | 192.168.178.177 | success
     dn_6045_6046 | 192.168.179.45  | success
     cn_5001      | 192.168.178.35  | success
     cn_5003      | 192.168.178.39  | success
     dn_6061_6062 | 192.168.181.179 | success
     cn_5006      | 192.168.179.45  | success
     cn_5004      | 192.168.178.177 | success
     cn_5002      | 192.168.181.21  | success
     cn_5005      | 192.168.178.187 | success
     dn_6019_6020 | 192.168.178.39  | success
     dn_6007_6008 | 192.168.178.35  | success
     dn_6071_6072 | 192.168.181.57  | success
     dn_6003_6004 | 192.168.178.35  | success
     dn_6013_6014 | 192.168.181.21  | success
     dn_6035_6036 | 192.168.178.187 | success
     dn_6037_6038 | 192.168.178.187 | success
     dn_6001_6002 | 192.168.178.35  | success
     dn_6063_6064 | 192.168.181.179 | success
     dn_6005_6006 | 192.168.178.35  | success
     dn_6057_6058 | 192.168.181.179 | success
     dn_6069_6070 | 192.168.181.57  | success
     dn_6027_6028 | 192.168.178.177 | success
     dn_6059_6060 | 192.168.181.179 | success
     dn_6041_6042 | 192.168.179.45  | success
     dn_6043_6044 | 192.168.179.45  | success
     dn_6047_6048 | 192.168.179.45  | success
     dn_6033_6034 | 192.168.178.187 | success
     dn_6065_6066 | 192.168.181.57  | success
     dn_6021_6022 | 192.168.178.39  | success
     dn_6017_6018 | 192.168.178.39  | success
     dn_6039_6040 | 192.168.178.187 | success
     dn_6053_6054 | 192.168.179.79  | success
    (42 rows)
    
  • pgxc_cgroup_reload_conf(text)

    描述:在某个节点上进行cgroup配置文件在线加载。入参为节点的IP地址。

    返回值类型:record

    函数返回字段如下:

    名称

    类型

    描述

    node_name

    text

    实例名称

    node_host

    text

    实例所在节点的IP地址

    result

    text

    cgroup在线加载是否成功

    示例:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    select * from pgxc_cgroup_reload_conf('192.168.178.35');
      node_name   |   node_host    | result
    --------------+----------------+---------
     cn_5001      | 192.168.178.35 | success
     dn_6007_6008 | 192.168.178.35 | success
     dn_6003_6004 | 192.168.178.35 | success
     dn_6001_6002 | 192.168.178.35 | success
     dn_6005_6006 | 192.168.178.35 | success
    (5 rows)
    
  • pg_wlm_jump_queue(pid int)

    描述:调整任务到CN队列的最前端。

    返回值类型:boolean

    备注:如果成功,函数返回true,否则返回false。

  • gs_wlm_switch_cgroup(pid int, cgroup text)

    描述:调整作业的优先级到新控制组。

    返回值类型:boolean

    备注:如果成功,函数返回true,否则返回false。

  • gs_wlm_node_recover(boolean isForce)

    描述:动态资源管理模式下,对CCN管控计数和作业信息进行更新恢复。该函数仅支持管理员执行,通常用于CN实例故障重启后的实例恢复,由集群管理组件(CM)调用,不建议用户直接调用。具体功能如下:

    • CN执行:通知CCN清理该CN执行的作业信息和作业对应的管控计数信息。
    • CCN执行:重置管控计数信息,并从CN上获取最新的慢车道作业信息。

    返回值类型:bool

  • gs_wlm_node_clean(cstring nodename)

    描述:动态资源管理模式下,对CCN上入参指定的CN执行的作业信息和对应的管控计数信息进行清理。该函数仅支持管理员执行,通常用于CN实例故障重启后的实例恢复,由集群管理组件(CM)调用,正常情况下不建议用户直接调用。

    返回值类型:bool

我们使用cookie来确保您的高速浏览体验。继续浏览本站,即表示您同意我们使用cookie。 详情