ITPub博客

首页 > 数据库 > 国内数据库 > 如何确认gbase8a中nodedatamap 系统表是否损坏

如何确认gbase8a中nodedatamap 系统表是否损坏

原创 国内数据库 作者:undead_dog 时间:2021-08-27 16:43:36 0 删除 编辑

nodedatamap 系统表用于计算一致性hash,数据hash 分布时要访问此表。该表存储于每个
节点gcluster 和gnode 的gclusterdb 数据库和gbase 数据库下。此表是安装集群后,通过
initnodedatamap 命令初始化的。
表中记录数为65536 行。表结构如下:
CREATE TABLE “nodedatamap” (
GBase 8a 知识FAQ 手册V4.3.1
65
“hashkey” int(11) DEFAULT NULL,
“nodeid” int(11) DEFAULT NULL
) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE=‘sys_tablespace’
可以利用crc32 函数查询判断数据hash 分布后落在哪个节点,如:
select nodeid from nodedatamap where hashkey = crc32(‘13184647638’)%65536;
可以使用以下SQL 判断表是否损坏,如SQL 执行报错,则说明表已经损坏
select count(*) from gclusterdb.nodedatamap;
select distinct nodeid from gclusterdb.nodedatamap;
select * from gclusterdb.nodedatamap;
如果确认nodedatamap 表损坏,可以执行以下命令重新初始化此表,执行前需确保gcluster
没有其它操作:refreshnodedatamap。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69982595/viewspace-2789199/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2021-08-27

  • 博文量
    3
  • 访问量
    618