Question about the xsysdbnodes metadata table

Asked by Xiaobo Gu

dbid int not null

A interger allocated by the system to represent a user database

nodeid int not null,

A integer represent the server or PostgreSQL instance, the mapping releationship is specified in the stado.config file

dbnodeid int not null,

What does this mean?

Question information

Language:
English Edit question
Status:
Solved
For:
Stado Edit question
Assignee:
No assignee Edit question
Solved by:
Alvin Peng
Solved:
Last query:
Last reply:
Revision history for this message
Alvin Peng (pengalvin) said :
#1

You can look at the table, it contains records like:

MDDB=# select * from xsysdbnodes;
 dbnodeid | dbid | nodeid
----------+------+--------
        1 | 1 | 1
        2 | 1 | 2
        3 | 1 | 3
        4 | 1 | 4

When you create a database in stado, the system wil allocate an integer (dbid) to represent it in metadata database;

the nodeid is specific by "create database on nodes 1,2,3,4", and the mapping relationship is in stado.config:

xdb.node.1.dbhost=<node1_ip>
xdb.node.2.dbhost=<node2_ip>
xdb.node.3.dbhost=<node3_ip>
xdb.node.4.dbhost=<node4_ip>

Revision history for this message
Xiaobo Gu (guxiaobo1982) said :
#2

So dbnodeid is just a integer sequence used as the primary key?

Revision history for this message
Best Alvin Peng (pengalvin) said :
#3

It's a unique index. (dbid, nodeid) is the primary key.

Revision history for this message
Xiaobo Gu (guxiaobo1982) said :
#4

Thanks Alvin Peng, that solved my question.