7,393
社区成员




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。