[go: up one dir, main page]

CN106777344A - The back end extended method and device of a kind of data-base cluster - Google Patents

The back end extended method and device of a kind of data-base cluster Download PDF

Info

Publication number
CN106777344A
CN106777344A CN201710028521.1A CN201710028521A CN106777344A CN 106777344 A CN106777344 A CN 106777344A CN 201710028521 A CN201710028521 A CN 201710028521A CN 106777344 A CN106777344 A CN 106777344A
Authority
CN
China
Prior art keywords
node
information
data
added
container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710028521.1A
Other languages
Chinese (zh)
Inventor
岳远方
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710028521.1A priority Critical patent/CN106777344A/en
Publication of CN106777344A publication Critical patent/CN106777344A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses the back end extended method and device of a kind of Postgres XL data-base clusters, including:Obtain the nodal information of multiple back end to be added;By the nodal information of each back end, corresponding container is stored in respectively according to information type;The total node number amount of statistics back end to be added, corresponding node addition instruction is generated according to total nodal point number amount, is added instruction by the node and is repeatedly called the add_datanode interfaces to carry out the addition of node;It can be seen that, in this programme, user is by after the nodal information unification addition of multiple back end to be added, just node addition instruction can be generated according to total node number amount, just can adding data in batches node according to node addition instruction, realize when back end extends by performing a subcommand, cluster just can be made to increase node automatically, greatly reduce cost of labor.

Description

一种数据库集群的数据节点扩展方法及装置A data node expansion method and device for a database cluster

技术领域technical field

本发明涉及数据节点扩展技术领域,更具体地说,涉及一种Postgres-XL数据库集群的数据节点扩展方法及装置。The invention relates to the technical field of data node expansion, and more specifically, to a data node expansion method and device for a Postgres-XL database cluster.

背景技术Background technique

Postgres-XL是一个基于PostgreSQL数据库的横向扩展开源SQL数据库集群,具有足够的灵活性来处理不同的数据库工作负载。在使用基于Postgres-XL数据库集群时,若想增加数据节点,目前只能在判定待添加的节点的信息正确时,通过手动执行add_datanode接口添加节点,每次只能增加一个数据节点,也就是说,原生集群是不支持批量增加数据节点的,只能通过命令重复多次的添加,不仅添加速度慢,还增加人工成本。Postgres-XL is a horizontally scalable open source SQL database cluster based on PostgreSQL database, which is flexible enough to handle different database workloads. When using a Postgres-XL-based database cluster, if you want to add a data node, you can only add a node by manually executing the add_datanode interface when the information of the node to be added is determined to be correct. Only one data node can be added at a time, that is to say , Native clusters do not support adding data nodes in batches, and can only be added multiple times through commands, which not only slows the adding speed, but also increases labor costs.

因此,如何实现批量的添加数据节点,减少人工成本,是本领域技术人员需要解决的问题。Therefore, how to add data nodes in batches and reduce labor costs is a problem to be solved by those skilled in the art.

发明内容Contents of the invention

本发明的目的在于提供一种Postgres-XL数据库集群的数据节点扩展方法及装置,以实现实现批量的添加数据节点,减少人工成本。The purpose of the present invention is to provide a method and device for expanding data nodes of a Postgres-XL database cluster, so as to realize adding data nodes in batches and reduce labor costs.

为实现上述目的,本发明实施例提供了如下技术方案:In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:

一种Postgres-XL数据库集群的数据节点扩展方法,包括:A method for expanding data nodes of a Postgres-XL database cluster, comprising:

获取待添加的多个数据节点的节点信息;Obtain node information of multiple data nodes to be added;

将每个数据节点的节点信息,按照信息类型分别存入对应的容器;Store the node information of each data node in the corresponding container according to the information type;

统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令,通过所述节点添加指令多次调用add_datanode接口进行节点的添加。Count the total number of data nodes to be added, generate corresponding node addition instructions according to the number of summary points, and call the add_datanode interface multiple times through the node addition instructions to add nodes.

其中,所述将每个数据节点的节点信息,按照信息类型分别存入对应的容器,包括:Wherein, the node information of each data node is stored in the corresponding container according to the information type, including:

将每个数据节点的节点地址信息存入节点地址容器,将每个数据节点的端口号信息存入端口号容器,将每个数据节点的节点名称信息存入节点名称容器;其中,同一数据节点的节点地址信息、端口号信息、节点名称信息在对应容器的下标相同。Store the node address information of each data node into the node address container, store the port number information of each data node into the port number container, and store the node name information of each data node into the node name container; wherein, the same data node The node address information, port number information, and node name information of the corresponding container are the same.

其中,所述根据所述总结点数量生成对应的节点添加指令,包括:Wherein, the generation of corresponding node addition instructions according to the number of summary points includes:

若所述总结点数量为N,则生成的节点添加指令为:执行N次add_datanode函数,从而实现添加N个数据节点;其中,N为正整数。If the number of summary points is N, the generated node addition instruction is: execute the add_datanode function N times, so as to realize adding N data nodes; wherein, N is a positive integer.

其中,所述通过所述节点添加指令多次调用add_datanode接口进行节点的添加,包括:Wherein, the adding of nodes by calling the add_datanode interface multiple times through the node adding instruction includes:

从各个容器中获取与待添加的目标数据节点对应的节点信息;Obtain node information corresponding to the target data node to be added from each container;

判断与目标数据节点对应的节点信息是否正确;Judging whether the node information corresponding to the target data node is correct;

若是,则调用add_datanode接口添加目标节点,选定下一个待添加的目标数据节点,并继续执行所述从各个容器中获取与待添加的目标数据节点对应的节点信息的步骤;If so, call the add_datanode interface to add the target node, select the next target data node to be added, and continue to execute the step of obtaining the node information corresponding to the target data node to be added from each container;

若否,则发出节点信息错误提示,选定下一个待添加的目标数据节点,并继续执行所述从各个容器中获取与待添加的目标数据节点对应的节点信息的步骤。If not, a node information error prompt is issued, the next target data node to be added is selected, and the step of obtaining node information corresponding to the target data node to be added from each container is continued.

一种Postgres-XL数据库集群的数据节点扩展装置,包括:A data node expansion device of a Postgres-XL database cluster, comprising:

获取模块,用于获取待添加的多个数据节点的节点信息;An acquisition module, configured to acquire node information of multiple data nodes to be added;

存储模块,用于将每个数据节点的节点信息,按照信息类型分别存入对应的容器;The storage module is used to store the node information of each data node into the corresponding container according to the information type;

指令生成模块,用于统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令;An instruction generation module, configured to count the total number of nodes of the data nodes to be added, and generate corresponding node addition instructions according to the number of summary points;

节点添加模块,用于通过所述节点添加指令多次调用add_datanode接口进行节点的添加。The node adding module is used to call the add_datanode interface multiple times through the node adding command to add nodes.

其中,所述存储模块将每个数据节点的节点地址信息存入节点地址容器,将每个数据节点的端口号信息存入端口号容器,将每个数据节点的节点名称信息存入节点名称容器;其中,同一数据节点的节点地址信息、端口号信息、节点名称信息在对应容器的下标相同。Wherein, the storage module stores the node address information of each data node into the node address container, stores the port number information of each data node into the port number container, and stores the node name information of each data node into the node name container ; Among them, the node address information, port number information, and node name information of the same data node have the same subscript in the corresponding container.

其中,若所述总结点数量为N,则所述指令生成模块生成的节点添加指令为:执行N次add_datanode函数,从而实现添加N个数据节点;其中,N为正整数。Wherein, if the number of summary points is N, the node adding instruction generated by the instruction generating module is: execute the add_datanode function N times, thereby realizing adding N data nodes; wherein, N is a positive integer.

其中,所述节点添加模块包括:Wherein, the node adding module includes:

节点信息获取单元,用于从各个容器中获取与待添加的目标数据节点对应的节点信息;a node information acquisition unit, configured to acquire node information corresponding to the target data node to be added from each container;

判断单元,用于判断与目标数据节点对应的节点信息是否正确;a judging unit, configured to judge whether the node information corresponding to the target data node is correct;

第一添加单元,用于判定与目标数据节点对应的节点信息正确时,调用add_datanode接口添加目标节点,选定下一个待添加的目标数据节点,并触发所述节点信息获取单元;The first adding unit is used to determine that when the node information corresponding to the target data node is correct, call the add_datanode interface to add the target node, select the next target data node to be added, and trigger the node information acquisition unit;

第二添加单元,用于判定与目标数据节点对应的节点信息不正确时,发出节点信息错误提示,选定下一个待添加的目标数据节点,并触发所述节点信息获取单元。The second adding unit is configured to issue a node information error prompt when determining that the node information corresponding to the target data node is incorrect, select the next target data node to be added, and trigger the node information acquiring unit.

通过以上方案可知,本发明实施例提供的一种Postgres-XL数据库集群的数据节点扩展方法,包括:获取待添加的多个数据节点的节点信息;将每个数据节点的节点信息,按照信息类型分别存入对应的容器;统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令,通过所述节点添加指令多次调用add_datanode接口进行节点的添加;It can be seen from the above scheme that the data node expansion method of a Postgres-XL database cluster provided by the embodiment of the present invention includes: obtaining the node information of multiple data nodes to be added; Store in the corresponding container respectively; count the total number of nodes of the data nodes to be added, generate corresponding node addition instructions according to the number of summary points, and call the add_datanode interface multiple times through the node addition instructions to add nodes;

可见,在本方案中,用户将待添加的多个数据节点的节点信息统一添加后,便可根据总节点数量生成节点添加指令,根据该节点添加指令便可批量添加数据节点,实现了在数据节点扩展时通过执行一次命令,便可使集群自动增加节点,大大减少了人工成本;本发明还公开了一种Postgres-XL数据库集群的数据节点扩展装置,同样能实现上述技术效果。It can be seen that in this solution, after the user adds the node information of the multiple data nodes to be added, the node addition command can be generated according to the total number of nodes, and the data nodes can be added in batches according to the node addition command, realizing the in-data When the node is expanded, by executing a command once, the cluster can automatically add nodes, greatly reducing labor costs; the invention also discloses a data node expansion device for a Postgres-XL database cluster, which can also achieve the above-mentioned technical effects.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例公开的一种Postgres-XL数据库集群的数据节点扩展方法流程示意图;Fig. 1 is a schematic flow chart of a data node expansion method of a Postgres-XL database cluster disclosed by an embodiment of the present invention;

图2为现有技术中Postgres-XL数据库集群的数据节点扩展方法;Fig. 2 is the data node expansion method of Postgres-XL database cluster in the prior art;

图3为本发明实施例公开的一种具体的Postgres-XL数据库集群的数据节点扩展方法流程示意图;Fig. 3 is a schematic flow chart of a data node expansion method of a specific Postgres-XL database cluster disclosed by an embodiment of the present invention;

图4为本发明实施例公开的一种Postgres-XL数据库集群的数据节点扩展装置结构示意图。FIG. 4 is a schematic structural diagram of a data node expansion device for a Postgres-XL database cluster disclosed by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

本发明实施例公开了一种Postgres-XL数据库集群的数据节点扩展方法及装置,以实现实现批量的添加数据节点,减少人工成本。The embodiment of the present invention discloses a data node expansion method and device of a Postgres-XL database cluster, so as to implement adding data nodes in batches and reduce labor costs.

参见图1,本发明实施例提供的一种Postgres-XL数据库集群的数据节点扩展方法,包括:Referring to Fig. 1, a kind of data node expansion method of Postgres-XL database cluster that the embodiment of the present invention provides, comprises:

S101、获取待添加的多个数据节点的节点信息;S101. Obtain node information of multiple data nodes to be added;

具体的,参见图2,为本实施例提供的现有技术中的数据节点扩展方法,在添加节点时,只能通过手动执行add_datanode接口,并且该接口只支持一次增加一个数据节点。因此,参见图3,在本方案中,通过将想要增加数据节点的信息,先储存在一个临时函数中,该临时函数分析节点信息后,统计出要增加的节点个数,例如节点个数为n个,则执行n次add_datanode函数,从而增加n个节点,实现了一条命令增加多个节点的功能。Specifically, referring to FIG. 2 , the data node expansion method in the prior art provided by this embodiment can only manually execute the add_datanode interface when adding nodes, and this interface only supports adding one data node at a time. Therefore, referring to Figure 3, in this solution, the information about adding data nodes is first stored in a temporary function. After analyzing the node information, the temporary function counts the number of nodes to be added, such as the number of nodes If it is n, execute the add_datanode function n times, thereby adding n nodes, realizing the function of adding multiple nodes with one command.

S102、将每个数据节点的节点信息,按照信息类型分别存入对应的容器;S102. Store the node information of each data node in a corresponding container according to the information type;

其中,所述将每个数据节点的节点信息,按照信息类型分别存入对应的容器,包括:Wherein, the node information of each data node is stored in the corresponding container according to the information type, including:

将每个数据节点的节点地址信息存入节点地址容器,将每个数据节点的端口号信息存入端口号容器,将每个数据节点的节点名称信息存入节点名称容器;其中,同一数据节点的节点地址信息、端口号信息、节点名称信息在对应容器的下标相同。Store the node address information of each data node into the node address container, store the port number information of each data node into the port number container, and store the node name information of each data node into the node name container; wherein, the same data node The node address information, port number information, and node name information of the corresponding container are the same.

需要说明的是,在原生集群的算法中,通过add_datanode接口增加数据节点时,需要传入节点的信息,例如节点地址,端口号等,从而通过这些节点的信息自动执行增加数据节点步骤。在此基础上,在本实施例中,加了信息统计的函数,将每次从客户端输入的节点信息,分类存储在不同的容器中,例如节点地址容器、端口号容器、节点名称容器等,每个容器中节点信息的下标即为要增加数据节点的编号与当前已存在数据节点编号最大值的偏移量,这样就可以实现对数据节点的自动添加。It should be noted that in the native cluster algorithm, when adding a data node through the add_datanode interface, it is necessary to pass in node information, such as node address, port number, etc., so that the step of adding data nodes can be automatically executed through the information of these nodes. On this basis, in this embodiment, the function of information statistics is added, and the node information input from the client each time is classified and stored in different containers, such as node address container, port number container, node name container, etc. , the subscript of the node information in each container is the offset between the number of the data node to be added and the maximum number of the existing data node number, so that the automatic addition of data nodes can be realized.

S103、统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令,通过所述节点添加指令多次调用add_datanode接口进行节点的添加。S103. Count the total number of data nodes to be added, generate corresponding node addition instructions according to the number of summary points, and call the add_datanode interface multiple times through the node addition instructions to add nodes.

其中,所述根据所述总结点数量生成对应的节点添加指令,包括:Wherein, the generation of corresponding node addition instructions according to the number of summary points includes:

若所述总结点数量为N,则生成的节点添加指令为:执行N次add_datanode函数,从而实现添加N个数据节点;其中,N为正整数。If the number of summary points is N, the generated node addition instruction is: execute the add_datanode function N times, so as to realize adding N data nodes; wherein, N is a positive integer.

其中,所述通过所述节点添加指令多次调用add_datanode接口进行节点的添加,包括:Wherein, the adding of nodes by calling the add_datanode interface multiple times through the node adding instruction includes:

从各个容器中获取与待添加的目标数据节点对应的节点信息;Obtain node information corresponding to the target data node to be added from each container;

判断与目标数据节点对应的节点信息是否正确;Judging whether the node information corresponding to the target data node is correct;

若是,则调用add_datanode接口添加目标节点,选定下一个待添加的目标数据节点,并继续执行所述从各个容器中获取与待添加的目标数据节点对应的节点信息的步骤;If so, call the add_datanode interface to add the target node, select the next target data node to be added, and continue to execute the step of obtaining the node information corresponding to the target data node to be added from each container;

若否,则发出节点信息错误提示,选定下一个待添加的目标数据节点,并继续执行所述从各个容器中获取与待添加的目标数据节点对应的节点信息的步骤。If not, a node information error prompt is issued, the next target data node to be added is selected, and the step of obtaining node information corresponding to the target data node to be added from each container is continued.

具体的,在本实施例统计出总结点数量N后,则生成对应的节点添加指令,通过从不同的容器中获取节点信息,判断该信息不为空且正确后,调用add_datanode接口,从而实现增加数据节点,并且在接收到上一个节点增加完毕的消息后,会继续执行下一次调用,对下一个数据节点进行添加,直至获取的节点信息为空为止,从而通过这种方法,达到了在集群中批量增加数据节点的目的。Specifically, after the number N of summary points is counted in this embodiment, the corresponding node addition command is generated, and the node information is obtained from different containers. After judging that the information is not empty and correct, the add_datanode interface is called to realize the increase Data node, and after receiving the message that the previous node has been added, it will continue to execute the next call to add the next data node until the obtained node information is empty, so that through this method, it is achieved in the cluster The purpose of adding data nodes in batches.

需要说明的是,本实施例中的Postgres-XL数据库集群的数据节点扩展方式,主要针对的是:集群在运行过程中,如果需要增加数据节点,进行集群的扩容,原生集群是不支持批量增加的,只能通过命令重复多次,每次增加一个数据节点。而在本实施例中,通过对扩展模块核心算法的二次开发,实现了在扩展时可以定制增加节点的数量,执行一次命令后,集群自动增加节点,大大减少了人工成本。It should be noted that the data node expansion method of the Postgres-XL database cluster in this embodiment is mainly aimed at: during the operation of the cluster, if it is necessary to add data nodes to expand the cluster, the native cluster does not support batch addition , it can only be repeated multiple times through the command, adding a data node each time. In this embodiment, through the secondary development of the core algorithm of the expansion module, the number of nodes can be customized and increased during expansion. After executing a command, the cluster automatically increases nodes, which greatly reduces labor costs.

下面对本发明实施例提供的数据节点扩展装置进行介绍,下文描述的数据节点扩展装置与上文描述的数据节点扩展方法可以相互参照。The data node expansion device provided by the embodiment of the present invention is introduced below, and the data node expansion device described below and the data node expansion method described above may refer to each other.

参见图4,本发明实施例提供的一种Postgres-XL数据库集群的数据节点扩展装置,包括:Referring to FIG. 4, a data node expansion device of a Postgres-XL database cluster provided by an embodiment of the present invention includes:

获取模块100,用于获取待添加的多个数据节点的节点信息;An acquisition module 100, configured to acquire node information of multiple data nodes to be added;

存储模块200,用于将每个数据节点的节点信息,按照信息类型分别存入对应的容器;The storage module 200 is used to store the node information of each data node into the corresponding container according to the information type;

指令生成模块300,用于统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令;The instruction generation module 300 is used to count the total number of nodes of the data nodes to be added, and generate corresponding node addition instructions according to the number of summary points;

节点添加模块400,用于通过所述节点添加指令多次调用add_datanode接口进行节点的添加。The node adding module 400 is configured to call the add_datanode interface multiple times through the node adding instruction to add nodes.

其中,所述存储模块将每个数据节点的节点地址信息存入节点地址容器,将每个数据节点的端口号信息存入端口号容器,将每个数据节点的节点名称信息存入节点名称容器;其中,同一数据节点的节点地址信息、端口号信息、节点名称信息在对应容器的下标相同。Wherein, the storage module stores the node address information of each data node into the node address container, stores the port number information of each data node into the port number container, and stores the node name information of each data node into the node name container ; Among them, the node address information, port number information, and node name information of the same data node have the same subscript in the corresponding container.

其中,若所述总结点数量为N,则所述指令生成模块生成的节点添加指令为:执行N次add_datanode函数,从而实现添加N个数据节点;其中,N为正整数。Wherein, if the number of summary points is N, the node adding instruction generated by the instruction generating module is: execute the add_datanode function N times, so as to realize adding N data nodes; wherein, N is a positive integer.

其中,所述节点添加模块包括:Wherein, the node adding module includes:

节点信息获取单元,用于从各个容器中获取与待添加的目标数据节点对应的节点信息;a node information acquisition unit, configured to acquire node information corresponding to the target data node to be added from each container;

判断单元,用于判断与目标数据节点对应的节点信息是否正确;a judging unit, configured to judge whether the node information corresponding to the target data node is correct;

第一添加单元,用于判定与目标数据节点对应的节点信息正确时,调用add_datanode接口添加目标节点,选定下一个待添加的目标数据节点,并触发所述节点信息获取单元;The first adding unit is used to determine that when the node information corresponding to the target data node is correct, call the add_datanode interface to add the target node, select the next target data node to be added, and trigger the node information acquisition unit;

第二添加单元,用于判定与目标数据节点对应的节点信息不正确时,发出节点信息错误提示,选定下一个待添加的目标数据节点,并触发所述节点信息获取单元。The second adding unit is configured to issue a node information error prompt when determining that the node information corresponding to the target data node is incorrect, select the next target data node to be added, and trigger the node information acquiring unit.

本发明实施例提供的一种Postgres-XL数据库集群的数据节点扩展方法,包括:获取待添加的多个数据节点的节点信息;将每个数据节点的节点信息,按照信息类型分别存入对应的容器;统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令,通过所述节点添加指令多次调用add_datanode接口进行节点的添加;A data node expansion method of a Postgres-XL database cluster provided by an embodiment of the present invention includes: obtaining node information of multiple data nodes to be added; storing the node information of each data node into the corresponding container; counting the total number of nodes of the data nodes to be added, generating corresponding node addition instructions according to the number of summary points, and calling the add_datanode interface multiple times through the node addition instructions to add nodes;

可见,在本方案中,用户将待添加的多个数据节点的节点信息统一添加后,便可根据总节点数量生成节点添加指令,根据该节点添加指令便可批量添加数据节点,实现了在数据节点扩展时通过执行一次命令,便可使集群自动增加节点,大大减少了人工成本;本发明还公开了一种Postgres-XL数据库集群的数据节点扩展装置,同样能实现上述技术效果。It can be seen that in this solution, after the user adds the node information of the multiple data nodes to be added, the node addition command can be generated according to the total number of nodes, and the data nodes can be added in batches according to the node addition command, realizing the in-data When the node is expanded, by executing a command once, the cluster can automatically add nodes, greatly reducing labor costs; the invention also discloses a data node expansion device for a Postgres-XL database cluster, which can also achieve the above-mentioned technical effects.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1.一种Postgres-XL数据库集群的数据节点扩展方法,其特征在于,包括:1. a data node expansion method of Postgres-XL database cluster, it is characterized in that, comprising: 获取待添加的多个数据节点的节点信息;Obtain node information of multiple data nodes to be added; 将每个数据节点的节点信息,按照信息类型分别存入对应的容器;Store the node information of each data node in the corresponding container according to the information type; 统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令,通过所述节点添加指令多次调用add_datanode接口进行节点的添加。Count the total number of data nodes to be added, generate corresponding node addition instructions according to the number of summary points, and call the add_datanode interface multiple times through the node addition instructions to add nodes. 2.根据权利要求1所述的数据节点扩展方法,其特征在于,所述将每个数据节点的节点信息,按照信息类型分别存入对应的容器,包括:2. The data node expansion method according to claim 1, wherein the node information of each data node is stored in the corresponding container according to the information type, including: 将每个数据节点的节点地址信息存入节点地址容器,将每个数据节点的端口号信息存入端口号容器,将每个数据节点的节点名称信息存入节点名称容器;其中,同一数据节点的节点地址信息、端口号信息、节点名称信息在对应容器的下标相同。Store the node address information of each data node into the node address container, store the port number information of each data node into the port number container, and store the node name information of each data node into the node name container; wherein, the same data node The node address information, port number information, and node name information of the corresponding container are the same. 3.根据权利要求2所述的数据节点扩展方法,其特征在于,所述根据所述总结点数量生成对应的节点添加指令,包括:3. The data node expansion method according to claim 2, wherein the generating corresponding node addition instructions according to the number of summary points includes: 若所述总结点数量为N,则生成的节点添加指令为:执行N次If the number of summary points is N, the generated node addition instruction is: execute N times add_datanode函数,从而实现添加N个数据节点;其中,N为正整数。add_datanode function to add N data nodes; where N is a positive integer. 4.根据权利要求3所述的数据节点扩展方法,其特征在于,所述通过所述节点添加指令多次调用add_datanode接口进行节点的添加,包括:4. The data node expansion method according to claim 3, wherein the adding of nodes by calling the add_datanode interface multiple times through the node adding instruction includes: 从各个容器中获取与待添加的目标数据节点对应的节点信息;Obtain node information corresponding to the target data node to be added from each container; 判断与目标数据节点对应的节点信息是否正确;Judging whether the node information corresponding to the target data node is correct; 若是,则调用add_datanode接口添加目标节点,选定下一个待添加的目标数据节点,并继续执行所述从各个容器中获取与待添加的目标数据节点对应的节点信息的步骤;If so, call the add_datanode interface to add the target node, select the next target data node to be added, and continue to execute the step of obtaining the node information corresponding to the target data node to be added from each container; 若否,则发出节点信息错误提示,选定下一个待添加的目标数据节点,并继续执行所述从各个容器中获取与待添加的目标数据节点对应的节点信息的步骤。If not, a node information error prompt is issued, the next target data node to be added is selected, and the step of obtaining node information corresponding to the target data node to be added from each container is continued. 5.一种Postgres-XL数据库集群的数据节点扩展装置,其特征在于,包括:5. a data node expansion device of Postgres-XL database cluster, is characterized in that, comprises: 获取模块,用于获取待添加的多个数据节点的节点信息;An acquisition module, configured to acquire node information of multiple data nodes to be added; 存储模块,用于将每个数据节点的节点信息,按照信息类型分别存入对应的容器;The storage module is used to store the node information of each data node into the corresponding container according to the information type; 指令生成模块,用于统计待添加的数据节点的总节点数量,根据所述总结点数量生成对应的节点添加指令;An instruction generation module, configured to count the total number of nodes of the data nodes to be added, and generate corresponding node addition instructions according to the number of summary points; 节点添加模块,用于通过所述节点添加指令多次调用add_datanode接口进行节点的添加。The node adding module is used to call the add_datanode interface multiple times through the node adding command to add nodes. 6.根据权利要求5所述的数据节点扩展方法,其特征在于,6. The data node expansion method according to claim 5, wherein: 所述存储模块将每个数据节点的节点地址信息存入节点地址容器,将每个数据节点的端口号信息存入端口号容器,将每个数据节点的节点名称信息存入节点名称容器;其中,同一数据节点的节点地址信息、端口号信息、节点名称信息在对应容器的下标相同。The storage module stores the node address information of each data node into the node address container, stores the port number information of each data node into the port number container, and stores the node name information of each data node into the node name container; wherein , the node address information, port number information, and node name information of the same data node have the same subscript in the corresponding container. 7.根据权利要求6所述的数据节点扩展方法,其特征在于,7. The data node expansion method according to claim 6, characterized in that, 若所述总结点数量为N,则所述指令生成模块生成的节点添加指令为:执行N次add_datanode函数,从而实现添加N个数据节点;其中,N为正整数。If the number of summary points is N, the node adding instruction generated by the instruction generating module is: execute the add_datanode function N times, so as to realize adding N data nodes; wherein, N is a positive integer. 8.根据权利要求7所述的数据节点扩展方法,其特征在于,所述节点添加模块包括:8. The data node expansion method according to claim 7, wherein the node adding module comprises: 节点信息获取单元,用于从各个容器中获取与待添加的目标数据节点对应的节点信息;a node information acquisition unit, configured to acquire node information corresponding to the target data node to be added from each container; 判断单元,用于判断与目标数据节点对应的节点信息是否正确;a judging unit, configured to judge whether the node information corresponding to the target data node is correct; 第一添加单元,用于判定与目标数据节点对应的节点信息正确时,调用add_datanode接口添加目标节点,选定下一个待添加的目标数据节点,并触发所述节点信息获取单元;The first adding unit is used to determine that when the node information corresponding to the target data node is correct, call the add_datanode interface to add the target node, select the next target data node to be added, and trigger the node information acquisition unit; 第二添加单元,用于判定与目标数据节点对应的节点信息不正确时,发出节点信息错误提示,选定下一个待添加的目标数据节点,并触发所述节点信息获取单元。The second adding unit is configured to issue a node information error prompt when determining that the node information corresponding to the target data node is incorrect, select the next target data node to be added, and trigger the node information acquiring unit.
CN201710028521.1A 2017-01-16 2017-01-16 The back end extended method and device of a kind of data-base cluster Pending CN106777344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710028521.1A CN106777344A (en) 2017-01-16 2017-01-16 The back end extended method and device of a kind of data-base cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710028521.1A CN106777344A (en) 2017-01-16 2017-01-16 The back end extended method and device of a kind of data-base cluster

Publications (1)

Publication Number Publication Date
CN106777344A true CN106777344A (en) 2017-05-31

Family

ID=58946692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710028521.1A Pending CN106777344A (en) 2017-01-16 2017-01-16 The back end extended method and device of a kind of data-base cluster

Country Status (1)

Country Link
CN (1) CN106777344A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108880876A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 Storage cluster dispositions method, device, equipment and computer readable storage medium
CN110287150A (en) * 2019-05-16 2019-09-27 中国科学院信息工程研究所 Method and system for distributed management of metadata in large-scale storage system
CN110633325A (en) * 2019-09-20 2019-12-31 四川长虹电器股份有限公司 Docker-based database cluster capacity expansion method and device
CN113886136A (en) * 2021-08-21 2022-01-04 苏州浪潮智能科技有限公司 Node adding method, system, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197827A (en) * 2007-12-14 2008-06-11 华为技术有限公司 Document management method, system and correlated equipment
CN103401933A (en) * 2013-08-05 2013-11-20 天闻数媒科技(湖南)有限公司 Method and system for batch uploading resource information and corresponding resource file

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197827A (en) * 2007-12-14 2008-06-11 华为技术有限公司 Document management method, system and correlated equipment
CN103401933A (en) * 2013-08-05 2013-11-20 天闻数媒科技(湖南)有限公司 Method and system for batch uploading resource information and corresponding resource file

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘思尧: "基于Linux平台的高可用集群管理系统的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
吴力挽 等: "一种双路XML缓存机制设计与实现", 《硅谷》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108880876A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 Storage cluster dispositions method, device, equipment and computer readable storage medium
CN110287150A (en) * 2019-05-16 2019-09-27 中国科学院信息工程研究所 Method and system for distributed management of metadata in large-scale storage system
CN110287150B (en) * 2019-05-16 2021-05-11 中国科学院信息工程研究所 Metadata distributed management method and system for large-scale storage system
CN110633325A (en) * 2019-09-20 2019-12-31 四川长虹电器股份有限公司 Docker-based database cluster capacity expansion method and device
CN113886136A (en) * 2021-08-21 2022-01-04 苏州浪潮智能科技有限公司 Node adding method, system, equipment and medium
CN113886136B (en) * 2021-08-21 2023-11-14 苏州浪潮智能科技有限公司 Node adding method, system, equipment and medium

Similar Documents

Publication Publication Date Title
CN108984712B (en) Service scene-based number making method and device and readable storage medium
CN106777344A (en) The back end extended method and device of a kind of data-base cluster
JP2021500658A5 (en)
CN104298541A (en) Data distribution algorithm and data distribution device for cloud storage system
TWI679581B (en) Method and device for task execution
CN104239417A (en) Dynamic adjustment method and dynamic adjustment device after data fragmentation in distributed database
CN107526806A (en) The conversion method and device of data
US11113176B2 (en) Generating a debugging network for a synchronous digital circuit during compilation of program source code
CN107330098B (en) Query method, computing node and query system for custom report
US9544177B2 (en) System and method for contact merge management
CN105868190A (en) Method and system for optimizing task processing in ETL
US8413109B2 (en) Systems and methods for metamodel transformation
CN109491976A (en) A kind of storing data analytic method, device and relevant device
CN104536808B (en) A kind of method for parameter configuration and system of cloud application program
CN107315652B (en) A data backup method and cloud HDFS system
CN107480260A (en) Big data real-time analysis method, device, computing device and computer-readable storage medium
CN110532184A (en) Method, apparatus, computer equipment and the storage medium of more scenario simulation responses
CN110457535A (en) Hash bucket lookup method, Hash table storage, Hash table lookup method and device
CN108427709B (en) Multi-source mass data processing system and method
CN104283966A (en) Data distribution algorithm and device of cloud storage system
CN104050291B (en) A kind of method for parallel processing and system of account balance data
CN110888672B (en) Expression engine implementation method and system based on metadata architecture
CN103338246B (en) Virtual machine system of selection in a kind of infrastructure cloud resource allocation process and system
CN113326311A (en) Data conversion method and device
CN107544248B (en) Task optimization method and device in mobile robot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170531