返回首页

gbase数据、南大通用产品文档:GBase8aRHEL7 启动cgroup 报错

更新日期:2024年09月11日

问题现象
RHEL7 启动cgroup 报错Filed to start cgconfig.service:Unit not found。
处理步骤
步骤1
检查以下安装包是否安装,如缺少请安装。
libcgroup-0.41-8.el7.x86_64.rpm
libcgroup-tools-0.41-8.el7.x86_64.rpm
步骤2
安装后设置cgroup 服务开机启动。
systemctl enable cgconfig.service
步骤3
启动cgconfig 服务:
systemctl start cgconfig.service

在安装统一监控前,需要确定集群已成功安装,并获得每一个集群节点的
IP 地址、节点服务器的登录用户名和密码、gcluster 服务端口号、gcluster
的用户名和密码、
gnode 服务端口号、
gnode 的用户名和密码。
确定该资源库的
IP 地址、数据库服务的用户名和密码。服务器要求如下:

要求准备一台已安装资源库的服务器。

要求准备一台Linux 服务器,用于安装监控网站。

要求准备一台或多台Linux 服务器,用于安装采集中心。

要求采集代理需要部署在集群Linux 服务器上。

要求资源库、监控网站、采集中心和集群节点服务器网络互通。

要求监控网站、
采集中心和集群节点服务器的ssh 服务是正常开启状

统一数据平台监控与运维系统用户手册
南大通用数据技术股份有限公司
- 5 -
态。

要求安装监控网站、采集中心、资源库的机器系统时间与集群各节点
的系统时间同步。
在本文档示例的安装部署过程中GBase 集群为9.5 版本,共有4 个节点:

每个节点服务器的登录用户名为gbase;

gcluster 服务端口为5258,用户名为gbase;

gnode 服务端口为5050,用户名为gbase。

rsetnull() 函数将 C 变量设置为对应于数据库空值的值。

语法
mint rsetnull(type, ptrvar)
mint type;

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 894 -

char *ptrvar;
type
对应于 C 或 GBase 8s ESQL/C 变量的数据类型的 mint。此 type 可为除
了 var binary 或 lvarchar 指针变量之外的任何数据类型。
ptrvar
指向 C 或 GBase 8s ESQL/C 变量的指针。

用法

rsetnull() 函数将除了 var
binary 和 lvarchar 指针主变量之外的任何
数据类型的 GBase
8s
ESQL/C 变量设置为空。
要将 var
binary 或 lvarchar 指
针主变量设置为空,请使用 ifx_var_setnull() 宏。

示例
此样例程序在 demo 目录中的 rsetnull.ec 文件中。
/*
* rsetnull.ec *

This program fetches rows from the stock table for a chosen manufacturer and allows the
user to set the unit_price to NULL.
*/

#include
#include
EXEC SQL include decimal;
EXEC SQL include sqltypes;

#define WARNNOTIFY 1
#define NOWARNNOTIFY 0

#define LCASE(c) (isupper(c) ? tolower(c) : (c))

char format[] = "($$,$$$,$$$.&&)";

main()

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 895 -

{
char decdsply[20];
char ans;
int4 ret, exp_chk();

EXEC SQL BEGIN DECLARE SECTION;
short stock_num;
char description[16];
dec_t unit_price;
char manu_code[4];
EXEC SQL END DECLARE SECTION;

printf("RSETNULL Sample ESQL Program running.\n\n");
EXEC SQL connect to 'stores7'; /* connect to stores7 */
exp_chk("Connect to stores7", NOWARNNOTIFY);

printf("This program selects all rows for a given manufacturer\n");
printf("from the stock table and allows you to set the unit_price\n");
printf("\nTo begin, enter a manufacturer code - for example: 'HSK'\n");
printf("\nEnter Manufacturer code: ");
/* prompt for mfr. code */
gets(manu_code); /* get mfr. code */
EXEC SQL declare upcurs cursor for /* declare cursor */
select stock_num, description, unit_price from stock
where manu_code = :manu_code
for update of unit_price;
rupshift(manu_code); /* Make mfr code upper case */
EXEC SQL open upcurs; /* open select cursor */
if(exp_chk("Open cursor", WARNNOTIFY) == 1)
exit(1);

/*
* Display Column Headings

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 896 -

*/
printf("\nStock # \tDescription \t\tUnit Price");
while(1)
{
/* get a row */
EXEC SQL fetch upcurs into :stock_num, :description, :unit_price;
if ((ret = exp_chk("fetch", WARNNOTIFY)) == 100)
/* if end of rows */
break;
if(ret == 1)
exit(1);
if(risnull(CDECIMALTYPE, (char *) &unit_price))
/* unit_price NULL? */
continue; /* skip to next row */
rfmtdec(&unit_price, format, decdsply);
/* format unit_price */
/* display item */
printf("\n\t%d\t%15s\t%s", stock_num, description, decdsply);
ans = ' ';
/* Set unit_price to NULL? y(es) or n(o) */
while((ans = LCASE(ans)) != 'y' && ans != 'n')
{
printf("\n. . . Set unit_price to NULL ? (y/n) ");
scanf("%1s", &ans);
}
if (ans == 'y') /* if yes, NULL to unit_price */
{
rsetnull(CDECIMALTYPE, (char *) &unit_price);
EXEC SQL update stock set unit_price = :unit_price
where current of upcurs; /* and update current row */
if(exp_chk("UPDATE", WARNNOTIFY) == 1)
exit(1);
}

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 897 -

}
printf("\nRSETNULL Sample Program over.\n\n");
}

/*
* The exp_chk() file contains the exception handling functions to check the
SQLSTATE status variable to see if an error has occurred following an SQL statement. If a
warning or an error has occurred, exp_chk() executes the GET DIAGNOSTICS statement and
prints the detail for each exception that is returned.
*/

EXEC SQL include exp_chk.ec

输出
RSETNULL Sample ESQL Program running.

This program selects all rows for a given manufacturer
from the stock table and allows you to set the unit_price
to NULL.

To begin, enter a manufacturer code - for example: 'HSK'

Enter Manufacturer code: HSK

Stock # Description Unit Price
1 baseball gloves $800.00
. . . Set unit_price to NULL ? (y/n) n

3 baseball bat $240.00
. . . Set unit_price to NULL ? (y/n) y

4 football $960.00
. . . Set unit_price to NULL ? (y/n) n

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 898 -


110 helmet $600.00
. . . Set unit_price to NULL ? (y/n) y

RSETNULL Sample Program over.