CN106209943A - The system of selection of communication node and device - Google Patents
The system of selection of communication node and device Download PDFInfo
- Publication number
- CN106209943A CN106209943A CN201510229101.0A CN201510229101A CN106209943A CN 106209943 A CN106209943 A CN 106209943A CN 201510229101 A CN201510229101 A CN 201510229101A CN 106209943 A CN106209943 A CN 106209943A
- Authority
- CN
- China
- Prior art keywords
- connection
- node
- module
- communication
- data
- 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.)
- Withdrawn
Links
- 238000004891 communication Methods 0.000 title claims abstract description 163
- 238000000034 method Methods 0.000 claims abstract description 23
- 238000001514 detection method Methods 0.000 claims description 14
- 238000012545 processing Methods 0.000 claims description 13
- 230000035699 permeability Effects 0.000 abstract description 6
- 239000012141 concentrate Substances 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000000712 assembly Effects 0.000 description 1
- 238000000429 assembly Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides system of selection and the device of a kind of communication node, wherein, this device includes: session management module, database communication module and communication node select module;Session management module, for receive user trigger for the request generating, update or reading session time, call database communication module acquisition session nodal information in data-base cluster;Communication node selects module, for obtaining nodal information from database communication module, and select available connection to carry out communication with data-base cluster according to nodal information from connection pool by pre-defined rule, wherein, connection pool is for storing the connection of device and data-base cluster interior joint.By the present invention, solve the select permeability of the client access set group node of Distributed sharing Session in correlation technique.
Description
Technical field
The present invention relates to the communications field, in particular to system of selection and the device of a kind of communication node.
Background technology
Along with the very fast expansion of internet scale, the page browsing amount of website and access number of users are linear even
Referring to the increase of several times, Single-Server single database can not meet actual demand already.The most most of
The server of large-scale website all have employed the deployment way of Distributed Services cluster, so-called cluster, it is simply that allows one
Group server collaborative work, solves big concurrent, the problem of big data quantity bottleneck.The spine that distributed type assemblies brings
The problem of hands is the problem that cross-server Session (session) is shared, and the most different servers is shared same
Session data, it is achieved different server applies same Session, for solving this problem, current industry ratio
More popular way is to use container+high-performance distributed cache database, i.e. local Session data
Serializing storage share to cache database realizes different servers, this method can be well
Solve the sharing problem of Session.Conventional high-performance distributed cache database has Zookeeper,
Memcached, Redis etc..Wherein Zookeeper is an extraordinary distributed caching data base, it
Essence is a distributed small documents system, i.e. all hangs when all of Zookeeper node, and data are the most not
Can lose, after restarting server, data can be recovered, and the node of Zookeeper is atom, more
New is not or not successfully failure, replicates additionally by election algorithm and cluster and can also avoid Single Point of Faliure.
Zookeeper cluster mainly has three role leader (leader), follower (follower) and observer
(observer), a cluster can be elected node be leader, leader node receive client request,
The initiation being responsible for carrying out voting and resolution also carry out the data exchange of inside with all of follower and observer;
Follower node and observer node receive client and connect, and write request is transmitted to leader node to
Client returns result, and wherein unique difference of follower and observer is that follower can participate in leader
Election, and observer will not.When in cluster, leader delays after machine, and Zookeeper enters reforestation practices,
Reforestation practices needs to re-elect out a new leader, allow all of server all return to one correct
State.In the normal course of operation of cluster, client connects the role node of arbitrary normal operation can
Access cluster.Owing to the node of Zookeeper cluster also exists multiple, i.e. there is multiple node to access, lead
Cause to exist the select permeability of the client access set group node of Distributed sharing Session.
For the select permeability of the client access set group node of Distributed sharing Session, mesh in correlation technique
Before effective solution is not yet proposed.
Summary of the invention
Present invention is primarily targeted at system of selection and the device that a kind of communication node is provided, at least to solve
The select permeability of the client access set group node of Distributed sharing Session in correlation technique.
According to an aspect of the invention, it is provided the selection device of a kind of communication node, described device includes:
Session management module, database communication module and communication node select module;Described session management module,
For when the Dialog processing request receiving user's request, calling described database communication module and obtain data
The information of storehouse cluster interior joint;Described communication node selects module, for from described database communication module
Obtain the information of described node, and selected from connection pool by pre-defined rule according to the dot information of described joint can
Carrying out communication with connecting with described data-base cluster, wherein, described connection pool is used for storing described device and institute
State the connection between data-base cluster interior joint.
Further, described communication node selects module to select node and described data base set by pre-defined rule
Group carries out the mode of communication and includes: described communication node selects module, it may be judged whether carry appointment session mark
The connection known;When judged result is no, according to preset algorithm selects from described connection pool one can use and
The first the most identified connection and described data-base cluster carry out communication, and are that described first connection increases described
Specify session identification;When judged result is for being, the connection corresponding with described appointment session identification is selected to perform
Communication with described data-base cluster.
Further, connect corresponding with described appointment session identification is being selected to perform and described data-base cluster
After communication, if during corresponding with described appointment session identification connection exception, described communication node selects module,
It is additionally operable to from described connection pool, reselect available second according to described preset algorithm connect with described
Data-base cluster carries out communication, and is that described first connection increases described appointment session identification.
Further, described preset algorithm includes: random assortment algorithm, polling algorithm, Weighted Round Robin
And concordance hash algorithm.
Further, described device also includes: connection pool management module, for performing in described connection pool
Connect management operation, wherein, described management operation includes: create connect, increase connect, destroy connect,
Delete and connect and detection connection status.
Further, described device also includes: clustered node load-on module, is used for recording the configuration of described device
The nodal value of data-base cluster;Dynamically link setup module, for again adding at described clustered node load-on module
When carrying the actual node value of described data base set group configuration, the most dynamically update and described data-base cluster
Connect.
Further, described dynamic link setup module dynamically updates the mode bag of the connection with described data-base cluster
Including: described dynamic link setup module, setting up described device with described data base set group node can be with being connected number
N/2+1, wherein, described N is the nodes of described data-base cluster;Or, set up described device and institute
State the connection of each node in data-base cluster;Or, only one of which node in described data-base cluster
Time, setting up described device with described data base set group node can be 1 with being connected number;At described data-base cluster
Node more than or equal to 2 time, setting up described device with described data base set group node can be 2 with being connected number.
Further, described device also includes: clustered node configuration retrography module, is used for being periodically detected institute
State the actual node value of data base set group configuration and the nodal value of the described data-base cluster of described device configuration
Concordance;When detecting inconsistent, obtain the actual node value retrography such as institute of described data base set group node
State in the configuration file of device, and call described clustered node load-on module and reload described actual node
Value.
Further, described device also includes: connection pool timing detection module, is used for being periodically detected described
Whether the connection status of connection pool and the connection number of connection pool meet predetermined number;Connection detected not
Time available, trigger described connection pool management module and delete this unavailable connection;Detecting that connection number is unsatisfactory for
During predetermined number, trigger described dynamic link setup module and update described connection pool.
According to another aspect of the present invention, it is provided that a kind of be applied to the choosing of communication node in any of the above-described device
Selection method, described device includes: session management module, database communication module and communication node select mould
Block, described method includes: when the Dialog processing request receiving user's request, described session management module
Call described database communication module and obtain the information of data-base cluster interior joint;Described communication node selects mould
Block obtains the information of described node from described database communication module, and passes through according to the information of described node
Pre-defined rule selects available connection to carry out communication, wherein, described company with described data-base cluster from connection pool
Connect pond for storing the connection between described device and described data-base cluster interior joint.
Further, described communication node selects module to select node and described data base set by pre-defined rule
Group carries out communication and includes: described communication node selects module to determine whether to carry appointment session target connection;
When judged result is no, described communication node selects module to select from described connection pool according to preset algorithm
One available and the most identified first connection carries out communication with described data-base cluster, and is described first company
Connect the described appointment session identification of increase;When judged result is for being, described communication node select module select with
What described appointment session identification was corresponding connects the communication performed with described data-base cluster.
Further, connect corresponding with described appointment session identification is being selected to perform and described data-base cluster
After communication, described method also includes: if during corresponding with described appointment session identification connection exception, described logical
News joint point selection module reselects available second even according to described preset algorithm from described connection pool
Connect and carry out communication with described data-base cluster, and be that described second connection increases described appointment session identification.
By the present invention, when the Dialog processing request receiving user's request, session management module calls data
Storehouse communication module obtains the session information at data-base cluster interior joint, and communication node selects module, for from
Database communication module obtains the information of this node, and passes through pre-defined rule from connection pool according to the information of node
Middle selection available connection carries out communication with data-base cluster;Visible, in the present embodiment, communication node selects module to lead to
Crossing pre-defined rule selects connection available in connection pool to carry out communication, so that the pressure that request connects is within reason
Concentrate on the individual node of cluster, reach the pressure equilibrium as far as possible of clustered node, solve in correlation technique and divide
Cloth shares the select permeability of the client access set group node of Session.
Accompanying drawing explanation
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes the part of the application,
The schematic description and description of the present invention is used for explaining the present invention, is not intended that the improper limit to the present invention
Fixed.In the accompanying drawings:
Fig. 1 is the selection apparatus structure block diagram of communication node according to embodiments of the present invention;
Fig. 2 is the optional structured flowchart of selection device one of communication node according to embodiments of the present invention;
Fig. 3 is the optional structured flowchart of selection device two of communication node according to embodiments of the present invention;
Fig. 4 is the optional structured flowchart of selection device three of communication node according to embodiments of the present invention;
Fig. 5 is the optional structured flowchart of selection device four of communication node according to embodiments of the present invention;
Fig. 6 is the flow chart of the system of selection of communication node according to embodiments of the present invention;
Fig. 7 is the structure of the container client obtaining data-base cluster service according to alternative embodiment of the present invention
Block diagram;
Fig. 8 is that the Distributed sharing Session according to alternative embodiment of the present invention is stored in container client startup
The flow chart of order;
Fig. 9 is the flow chart of the Distributed sharing Session access according to alternative embodiment of the present invention;
Figure 10 is the flow process of the data base set group node configuration retrography module work according to alternative embodiment of the present invention
Figure.
Detailed description of the invention
It should be noted that in the case of not conflicting, the embodiment in the application and the feature in embodiment
Can be mutually combined.Describe the present invention below with reference to the accompanying drawings and in conjunction with the embodiments in detail.
Present embodiments providing the selection device of a kind of communication node, Fig. 1 is communication according to embodiments of the present invention
The selection apparatus structure block diagram of node, as it is shown in figure 1, this device includes: session management module 101, data
Storehouse communication module 102 and communication node select module 103;
Wherein, session management module 101, it is of coupled connections with database communication module 102, for receiving
When the Dialog processing of user's request is asked, call database communication module 102 and obtain data-base cluster interior joint
Information;Wherein, the request of this Dialog processing could be for generating, updating or read the request of session.
Communication node selects module 103, is of coupled connections with database communication module 102, for leading to from data base
News module 102 obtains the information of node, and is selected from connection pool by pre-defined rule according to the information of node
Available connection carries out communication with data-base cluster, and wherein, connection pool is used for storing device and saves in data-base cluster
The connection of point.
By embodiment of the present invention device, when the Dialog processing request receiving user's request, session management mould
Block calls database communication module and obtains the session information at data-base cluster interior joint, and communication node selects mould
Block, for obtaining the information of this node from database communication module, and passes through predetermined according to the information of this node
Rule selects available connection to carry out communication with data-base cluster from connection pool;Visible, communication joint in the present embodiment
Point selection module selects connection available in connection pool to carry out communication by pre-defined rule, so that request connects
Pressure concentrate on not too much on the individual node of cluster, reach the pressure as far as possible equilibrium of clustered node, solve
The select permeability of the client access set group node of Distributed sharing Session in correlation technique.
For in the present embodiment, communication node selects module 103 to pass through pre-defined rule from connection according to nodal information
Pond select available connection carry out communication modes with data-base cluster, in one alternative embodiment of the present embodiment,
The mode that this communication node selects module 103 to take is, it may be judged whether has and carries the connection specifying session identification;
When judged result is no, from connection pool, select one available and the most identified first even according to preset algorithm
Connect and carry out communication with data-base cluster, and be that the first connection increases appointment session identification;And be yes in judged result
Time, select connect corresponding with specifying session identification to perform and the communication of data-base cluster.
And in another optional embodiment of the present embodiment, selecting the connection corresponding with specifying session identification
Perform with the communication of data-base cluster after, if during corresponding with specifying session identification connection exception, communication node
Select module to reselect available second from connection pool according to preset algorithm to connect and data-base cluster
Carry out communication, and by specifying session identification to update the mark of the second connection.
It should be noted that the preset algorithm related in the present embodiment can be random assortment algorithm, poll calculation
Method, Weighted Round Robin and concordance hash algorithm etc., the below applied field as a example by random assortment algorithm
Jing Yi, selects module 103 to be selected from connection pool by pre-defined rule according to nodal information above-mentioned communication node
Available connection carries out communication modes with data-base cluster and is illustrated;
Application scenarios one: by random assortment+Session ID (corresponding to specifying session identification) from connection pool
Algorithm takes out an available connection and carries out communication, i.e. when Session ID is for the first time communication behavior to occur, adopts
Carry out communication with one the available connection the most flagged of random taking-up from connection pool of random assortment algorithm, and indicate
This is connected as the mark that this Session ID uses, and Session (session), when destroying, removes and connects use
Mark;If not communication then Session ID will use the connection distributed before to carry out communication, if taking for the first time
Less than connection before or connect unavailable or other read abnormal, then random assortment algorithm weight will be used
A newly selected available connection the most flagged carries out communication, and indicates the mark that this Session ID uses, if even
Connect the most flagged and when still distributing less than the most flagged connection, the most still use random assortment algorithm distribution one
Bar is available to be connected to this Session, and is updated to the mark that this session id uses
Fig. 2 is the optional structured flowchart of selection device one of communication node according to embodiments of the present invention, such as Fig. 2
Shown in, this device also includes: connection pool management module 104, and database communication module 102 is of coupled connections, and uses
The management operation of connection in performing connection pool, wherein, management operation includes: establishment connects, increase connects,
Destroy connection, delete connection and detection connection status.
Fig. 3 is the optional structured flowchart of selection device two of communication node according to embodiments of the present invention, such as Fig. 3
Shown in, this device also includes: clustered node load-on module 105, is of coupled connections with dynamic link setup module 106,
Nodal value for the data-base cluster of recording device configuration;Dynamically link setup module 106, with database communication mould
Block 102 is of coupled connections, for when clustered node load-on module reloads actual node value, dynamically update with
The connection of data-base cluster.
Alternatively, dynamic link setup module 106 dynamically updates the mode of the connection with data-base cluster, in this enforcement
In one optional embodiment of example, this dynamic link setup module 106 realizes in the following way, sets up device
Can be N/2+1 with being connected number with data base set group node, wherein, N be the nodes of data-base cluster;Or,
Set up the connection of device and each node in data-base cluster;Or, only one of which joint in data-base cluster
During point, setting up device with data base set group node can be 1 with being connected number;Data-base cluster node more than or
During equal to 2, setting up device with data base set group node can be 2 with being connected number.
Fig. 4 is the optional structured flowchart of selection device three of communication node according to embodiments of the present invention, such as Fig. 4
Shown in, this device also includes: clustered node configuration retrography module 107, with clustered node load-on module 105 coupling
Close and connect, the joint of actual node value with the data-base cluster of device configuration for being periodically detected storehouse cluster configuration
The concordance of point value;When detecting inconsistent, obtain the actual node value retrography such as dress of data base set group node
In the configuration file put, and call clustered node load-on module and reload actual node value.
Fig. 5 is the optional structured flowchart of selection device four of communication node according to embodiments of the present invention, such as Fig. 5
Shown in, this device also includes: connection pool timing detection module 108, with connection pool management module 104 company of coupling
Connecing, whether the connection number of connection status and connection pool for being periodically detected connection pool meets predetermined number;
When having detected that connection is unavailable, trigger connection pool management module and delete this unavailable connection;In the company of detecting
Connect number when being unsatisfactory for predetermined number, trigger dynamic link setup module and update connection pool.
Fig. 6 is the flow chart of the system of selection of communication node according to embodiments of the present invention, as shown in Figure 6, and should
The step of method includes:
Step S602: when the Dialog processing request receiving user's request, session management module calls data
Storehouse communication module obtains the information of data-base cluster interior joint;
Step S604: communication node selects module to obtain the information of node from database communication module, and depends on
Available connection is selected to carry out communication with data-base cluster according to this nodal information from connection pool by pre-defined rule;
Wherein, connection pool is for storing the connection between device and data-base cluster interior joint.
Alternatively, communication node selects module to select node and data-base cluster to carry out communication by pre-defined rule
Mode, can be achieved in that in the optional embodiment of the present embodiment
Step S11: communication node selects module to determine whether to carry the connection specifying session identification;
Step S12: when judged result is no, communication node selects module according to preset algorithm from connection pool
Select available and the most identified first connection and data-base cluster to carry out communication, and be that the first connection increases
Specify session identification;
Step S13: when judged result is for being, it is corresponding with specifying session identification that communication node selects module to select
Connect and perform and the communication of data-base cluster.
Step S14: select module to select the connection execution corresponding with specifying session identification and data at communication node
After the communication of storehouse cluster, if with when specifying connection exception corresponding to session identification, communication node selects module to depend on
From connection pool, reselect available second connection according to preset algorithm and carry out communication with data-base cluster, and
It is that the second connection increases appointment session mark.
It should be noted that step S11 herein is to step S13 and the communication in assembly of the invention embodiment
Joint point selection module selects node to carry out by the way of communication with data-base cluster being corresponding by pre-defined rule, because of
This, repeat at this most again.
Alternatively, the method step of the present embodiment can also include:
Step S21: the nodal value of the data-base cluster of clustered node load-on module recording device configuration;
Step S22: when clustered node load-on module reloads actual node value, the dynamic link setup module cycle
Property dynamically updates the connection with data-base cluster.
And the dynamic link setup module for relating in step S22 dynamically updates connection with data-base cluster
Mode, can be achieved in that dynamic link setup module, and setting up device can with data base set group node
Being N/2+1 with connection number, wherein, N is the nodes of data-base cluster;Or, set up device and data base
The connection of each node in cluster;Or, in data-base cluster during only one of which node, set up device with
Data base set group node can be 1 with connection number;When the node of data-base cluster is more than or equal to 2, set up dress
Putting with data base set group node can be 2 with being connected number.
Step S23: clustered node configuration retrography module is periodically detected actual node value and the dress of storehouse cluster configuration
Put the concordance of the nodal value of the data-base cluster of configuration;When detecting inconsistent, obtain data-base cluster joint
The actual node value retrography of point is as in the configuration file of device, and calls clustered node load-on module and reload reality
Border nodal value.
The present invention is illustrated by the alternative embodiment below in conjunction with the present invention;
This alternative embodiment provides a kind of acquisition data-base cluster reliable, stable, that have scalability
The container client (device corresponding in the embodiment of the present invention) of service, this container client is applied to distribution
Formula Session is shared.Fig. 7 is the container visitor of the data-base cluster service that obtains according to alternative embodiment of the present invention
The structured flowchart of family end, as it is shown in fig. 7, this container client includes: clustered node load-on module, cluster save
Point configuration retrography module, dynamic link setup module, connection pool timing detection module, connection pool management module, data
Storehouse communication node selects module and Communication processing module;
Wherein, clustered node load-on module, for the clustered node value of load vessel configuration, and calls and dynamically builds
Chain module carries out link setup;
Clustered node configuration retrography module, for timing Test database clustered node actual disposition value and container visitor
The concordance of family end Configuration Values, when there is clustered node configuration and container client configuration is inconsistent, reads collection
The actual disposition of group node retrography are in the configuration file of container, and call clustered node configuration load-on module weight
New this Configuration Values of loading.
Dynamically link setup module, for according to the data base set group node configuration loaded, dynamically updating and data base set
The connection of group.
For dynamically updating the connected mode in data-base cluster, include in this alternative embodiment: data base
When cluster module is smaller, each container client sets up one and only one with each node in data-base cluster
Bar connects, and this connection is placed in connection pool and carries out unified management maintenance after success link setup.And for avoiding when number
Bigger according to storehouse cluster scale, nodes is the most, actual be not required to so much connect time, link setup strategy carries
For configurable.Such as: strategy a: when configuration strategy is for available number, client and clustered node are set up available
Connecting number is n/2+1 connection;Strategy b: when configuring strategy and being all numbers, container end and each data base
Node all sets up a connection;Strategy c: when being configured to min-free, if configuration is only 1 Zookeeper
Node, then container client is connected number with clustered node foundation is 1, otherwise container client and Cluster Database
It is 2 that node sets up the available number that connects.After successful connection is set up, between client and the database node of cluster
Communication is all to complete by taking the connection of connection pool.If exist unsuccessfully during link setup, then skip this
The link setup of Zookeeper node, selecting next node link setup until meeting policy requirement, so circulating beyond
Certain number of times (optionally this certain number of times can be 2 times), if be still unsatisfactory for policy requirement, then exits
Module.
Connection pool timing detection module, for the connection and detection connection pool that regularly detect connection pool connection whether
Meet link setup strategy.When timing detection finds to connect unavailable, from connection pool, delete disabled company in time
Connect;Find to be unsatisfactory for link setup strategy when timing detection connects number, then call dynamic link setup module and update connection pool;
Such as, when ungratified strategy is for available number, that needs to call dynamic link setup module, re-establishes connection and add
Enter in connection pool, maintain the available number of connection to reach policy mandates.
Connection pool management module, for the connection being managed collectively in connection pool, it is provided that the operation that connection pool is conventional,
This conventional operation includes: provides to connect and creates, increases, destroys, deletes and the function such as connection status detection.
Communication node selects module, for needing to carry out communication reading with the node in data-base cluster when container end
During the Session data shared, for avoiding the request pressure of container section all to concentrate on individual node in the cluster;
Alternatively, in this alternative embodiment, take the method that random assortment+Session ID combines, choosing
Select the node in data-base cluster to carry out communication.I.e. calculated by random assortment+Session ID from connection pool
Method is taken out an available connection and is carried out communication, i.e. when Session ID is for the first time communication behavior to occur, uses
One the available connection the most flagged of random taking-up from connection pool of random assortment algorithm carries out communication, and mark should
Being connected as the mark that this Session ID uses, Session, when destroying, removes and connects the mark used;If
It not that communication then Session ID will use the connection distributed before to carry out communication, if taking less than before for the first time
Connection or connect unavailable or other read abnormal, then employing random assortment algorithm is reselected one
The most flagged available connection of bar carries out communication, and indicates the mark that this Session ID uses, and is all marked if connecting
Will and when still distributing less than the most flagged connection, the most still use random assortment algorithm distribute one available even
Connect to this Session, and be updated to the mark that this session id uses.In order to meet the customization demand of business,
Selection algorithm is it may also is that provide polling algorithm, Weighted Round Robin and concordance hash algorithm etc..
Database communication module, is used for using connection and data-base cluster interior joint to carry out data transmission, mainly
To clustered node solicited message and acquisition response message, the response message obtained is passed to other module corresponding,
Such as the shared Session information obtained is passed to Session and manage module, the clustered node obtained is real
Border configuration information passes to clustered node configuration retrography module etc..
By the method for the equilibrium selection data-base cluster communication node that this alternative embodiment provides, it is filled with relevant
The blank of technology.In this alternative embodiment, the clustered node configuration retrography module of introducing can obtain automatically and immediately
Get the up-to-date information of cluster scale, can be without manual configuration, without restarting dynamic synchronization in the case of container
Configuration to container;Additionally, dynamically link setup module provides the link setup strategy that can customize, can comprehensive meet not
With scene demand, at cluster, node failure can occur but time other node is still provided that normal service, not shadow
Ring the normal operation of container end;It addition, use the connection of random assortment algorithms selection connection pool, can make to call request
Pressure concentrates on the single Zookeeper node of cluster not too much so that the equilibrium as far as possible of the pressure of clustered node,
Improve the overall information processing capability of cluster and reduce Single Point of Faliure occurrence probability, using same Session ID to make
It is avoided that with same connection and uses the frequent switching connected, improve client-side information disposal ability.
Visible, the communication in the selection data-base cluster of equilibrium in correlation technique is solved by this alternative embodiment
Node, database node request pressure undue concentration, in cluster, database node is abnormal fault-tolerant, and data base
Cluster interior joint scale is difficult to self-reacting problem.
Below in conjunction with the accompanying drawings alternative embodiment of the present invention is described in detail;
Fig. 8 is that the Distributed sharing Session according to alternative embodiment of the present invention is stored in container client startup
The flow chart of order, as shown in Figure 8, the order of this startup includes:
Step S802: manual configuration relevant information;
Wherein, this relevant information includes: dispensing containers uses shares Session, configuration database clustered node
Information, config set group node dynamic link setup strategy, configuration section point selection strategy etc.;
Step S804: trigger the loading of this container client corresponding module;
Step S806: load the data-base cluster nodal value of configuration;
Step S808: start clustered node retrography module;
Wherein, the cluster configured in this module timing detection container and the concordance of actual cluster value, if inconsistent
Then update the Configuration Values loading cluster, and retrography actual value is to the configuration file of container;
Step S810: start dynamic link setup module, loads the link setup strategy of configuration;
Wherein, according to above-mentioned strategy, number as available in maximum, available number or minimum number strategy, generate and connect storage
In connection pool;
Step S812: start connection pool management module and connection pool timing detection module, safeguard with management and connect
Connection in pond.
Fig. 9 is the flow chart of the Distributed sharing Session access according to alternative embodiment of the present invention, such as Fig. 9
Shown in, container receive user request need generate, update or read Session time, Session pipe
Reason module calls database communication processing module, processes the Session access at database node, and returns knot
Fruit manages module to Session.Database communication processing module with database communication during, need to call
Communication node selects module according to certain algorithm, and this certain algorithm includes: random assortment+Session ID algorithm,
Poll, WRR or concordance Hash etc., process obtaining the connection of database node.
Figure 10 is the flow process of the data base set group node configuration retrography module work according to alternative embodiment of the present invention
Figure, as shown in Figure 10, when container intervalometer clocked flip clustered node configuration retrography module, configures retrography
Module is called database communication processing module and is carried out communication with data-base cluster, obtains actual disposition information, then
The configuration conformance carrying out container loading judges, when judging inconsistent, more new configuration file triggering are joined
Putting load-on module, after configuration load-on module reloads configuration file, meeting re invocation dlm (dynamic loading module) is more
New connection pool.
By above-mentioned Fig. 7 to Figure 10, and corresponding explanation understands, and this alternative embodiment has the function of disaster tolerance,
The most no matter which kind of occurs is abnormal for the node in data-base cluster, as long as cluster entirety is still provided that normal service,
The service that then container client still can use data-base cluster to provide carries out normal operation;Additionally, this optional reality
The mode executing example has reasonable stability, does not the most exist under big pressure condition, container client request pressure
Undue concentration and cause database node provide the unbalanced situation of ability;This alternative embodiment also has scalable
Property function, i.e. the scale of cluster either expands or reduces, and container client still can repaiied without manual
Change configuration, without restarting in the case of, continue automatically to use expansion scale or downsizing node.
In another embodiment, additionally providing a kind of software, this software is used for performing above-described embodiment and excellent
Select the technical scheme described in embodiment.
In another embodiment, additionally providing a kind of storage medium, in this storage medium, storage has above-mentioned soft
Part, this storage medium includes but not limited to: CD, floppy disk, hard disk, scratch pad memory etc..
Obviously, those skilled in the art should be understood that each module of the invention described above or each step can be with logical
Calculating device realize, they can concentrate on single calculating device, or is distributed in multiple calculating
On the network that device is formed, alternatively, they can realize with calculating the executable program code of device,
Perform it is thus possible to be stored in storing in device by calculating device, and in some cases, can
With be different from order herein perform shown or described by step, or they are fabricated to respectively each collection
Become circuit module, or the multiple modules in them or step are fabricated to single integrated circuit module realize.
So, the present invention is not restricted to the combination of any specific hardware and software.
Above are only the alternative embodiment of the present invention, be not limited to the present invention, for this area
For technical staff, the present invention can have various modifications and variations.All within the spirit and principles in the present invention,
Any modification, equivalent substitution and improvement etc. made, should be included within the scope of the present invention.
Claims (12)
1. the selection device of a communication node, it is characterised in that described device includes: session management module, number
Module is selected according to storehouse communication module and communication node;
Described session management module, for when the Dialog processing request receiving user's request, calling institute
State database communication module and obtain the information of data-base cluster interior joint;
Described communication node selects module, for obtaining described node from described database communication module
Information, and from connection pool, select available connection with described according to the information of described node by pre-defined rule
Data-base cluster carries out communication, and wherein, described connection pool is used for storing described device and described data base set
Connection between group's interior joint.
Device the most according to claim 1, it is characterised in that described communication node selects module by predetermined
The mode that rule selects node and described data-base cluster to carry out communication includes:
Described communication node selects module, it may be judged whether has and carries the connection specifying session identification;Sentencing
When disconnected result is no, select one can use from described connection pool according to preset algorithm and the most identified the
One connection and described data-base cluster carry out communication, and are that described first connection increases described appointment session mark
Know;When judged result is for being, the connection corresponding with described appointment session identification is selected to perform and described number
Communication according to storehouse cluster.
Device the most according to claim 2, it is characterised in that
Perform and the communication of described data-base cluster selecting connect corresponding with described appointment session identification
Afterwards, if during corresponding with described appointment session identification connection exception, described communication node selects module,
Be additionally operable to according to described preset algorithm reselect from described connection pool available second connect with
Described data-base cluster carries out communication, and is that described second connection increases described appointment session identification.
Device the most according to claim 2, it is characterised in that described preset algorithm includes: random assortment is calculated
Method, polling algorithm, Weighted Round Robin and concordance hash algorithm.
Device the most according to claim 2, it is characterised in that described device also includes:
Connection pool management module, for performing the management operation connected in described connection pool, wherein, institute
State management operation to include: establishment connects, increase connects, destroy connection, delete connection and detection connects
State.
Device the most according to claim 5, it is characterised in that described device also includes:
Clustered node load-on module, for recording the nodal value of the data-base cluster of described device configuration;
Dynamically link setup module, for reloading described data-base cluster at described clustered node load-on module
During the actual node value configured, the most dynamically update the connection with described data-base cluster.
Device the most according to claim 6, it is characterised in that described dynamic link setup module dynamically updates and institute
The mode of the connection stating data-base cluster includes:
Described dynamic link setup module, setting up described device with described data base set group node can be with being connected number
N/2+1, wherein, described N is the nodes of described data-base cluster;Or,
Set up the connection of described device and each node in described data-base cluster;Or,
In described data-base cluster during only one of which node, set up described device and described data-base cluster
Node can be 1 with connection number;When the node of described data-base cluster is more than or equal to 2, set up described
Device can be 2 with being connected number with described data base set group node.
Device the most according to claim 6, it is characterised in that described device also includes:
Clustered node configuration retrography module, for being periodically detected the actual joint of described data base set group configuration
The concordance of the nodal value of the described data-base cluster that point value configures with described device;Inconsistent detecting
Time, obtain in the actual node value retrography such as configuration file of described device of described data base set group node,
And call described clustered node load-on module and reload described actual node value.
Device the most according to claim 8, it is characterised in that described device also includes:
Connection pool timing detection module, for being periodically detected connection status and the connection of described connection pool
Whether the connection number in pond meets predetermined number;When having detected that connection is unavailable, trigger described connection pool
Management module deletes disabled connection;When detecting that connection number is unsatisfactory for predetermined number, trigger described
Dynamically link setup module updates described connection pool.
10. it is applied to a system of selection for the communication node of claim 1 to 9 any one device, described device bag
Include: session management module, database communication module and communication node select module, it is characterised in that
Described method includes:
When the Dialog processing request receiving user's request, described session management module calls described data
Storehouse communication module obtains the information of data-base cluster interior joint;
Described communication node selects module to obtain the information of described node from described database communication module,
And from connection pool, select available connection and described data according to the information of described node by pre-defined rule
Storehouse cluster carries out communication, and wherein, described connection pool is used for storing in described device and described data-base cluster
Connection between node.
11. methods according to claim 10, it is characterised in that described communication node selects module by pre-
Set pattern then selection node carries out communication with described data-base cluster and includes:
Described communication node selects module to determine whether to carry the connection specifying session identification;
When judged result is no, described communication node selects module according to preset algorithm from described connection pool
Available and the most identified the first connection of middle selection one and described data-base cluster carry out communication, and for institute
State the first connection and increase described appointment session identification;When judged result is for being, described communication node selects
Module selects connect corresponding with described appointment session identification to perform and the communication of described data-base cluster.
12. methods according to claim 11, it is characterised in that selecting and described appointment session identification pair
After the communication connecting execution and described data-base cluster answered, described method also includes:
If during corresponding with described appointment session identification connection exception, described communication node selects module foundation
Described preset algorithm reselects available second from described connection pool and connects and described data base
Cluster carries out communication, and is that described second connection increases described appointment session identification.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510229101.0A CN106209943A (en) | 2015-05-07 | 2015-05-07 | The system of selection of communication node and device |
PCT/CN2016/076647 WO2016177130A1 (en) | 2015-05-07 | 2016-03-17 | Method and device for selecting communication node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510229101.0A CN106209943A (en) | 2015-05-07 | 2015-05-07 | The system of selection of communication node and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106209943A true CN106209943A (en) | 2016-12-07 |
Family
ID=57218473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510229101.0A Withdrawn CN106209943A (en) | 2015-05-07 | 2015-05-07 | The system of selection of communication node and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106209943A (en) |
WO (1) | WO2016177130A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109274641A (en) * | 2018-08-09 | 2019-01-25 | 广东神马搜索科技有限公司 | Connection method and device, calculating equipment and storage medium between client and service node |
CN110134372A (en) * | 2019-07-10 | 2019-08-16 | 启迪云计算有限公司 | A kind of rule-based zookeeper session external management system |
CN110659463A (en) * | 2019-08-23 | 2020-01-07 | 苏州浪潮智能科技有限公司 | Distributed operation method and device of stateless system |
CN112054919A (en) * | 2020-08-03 | 2020-12-08 | 华人运通(江苏)技术有限公司 | Method, device, storage medium and system for generating ID (identity) of container cluster under stateless condition |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111107120B (en) * | 2018-10-29 | 2022-09-02 | 亿阳信通股份有限公司 | Redis cluster construction method and system |
CN111431999B (en) * | 2020-03-23 | 2022-11-25 | 杭州小影创新科技股份有限公司 | Cloud function distributed system based on Paxos algorithm |
CN111432011B (en) * | 2020-03-30 | 2023-02-17 | 百度国际科技(深圳)有限公司 | Block chain network communication method and equipment |
CN112231384B (en) * | 2020-10-30 | 2024-03-29 | 中国建设银行股份有限公司 | Distributed application localization transformation method and equipment adapting to multiple data sources |
CN112506610A (en) * | 2020-12-02 | 2021-03-16 | 北京大米科技有限公司 | Information updating method and device, storage medium and electronic equipment |
CN115617917B (en) * | 2022-12-16 | 2023-03-10 | 中国西安卫星测控中心 | Method, device, system and equipment for controlling multiple activities of database cluster |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103795569A (en) * | 2014-01-22 | 2014-05-14 | 亿赞普(北京)科技有限公司 | Server connection method and device based on connection pool |
CN104580226A (en) * | 2015-01-15 | 2015-04-29 | 上海瀚之友信息技术服务有限公司 | Session data sharing system and method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10432703B2 (en) * | 2012-11-26 | 2019-10-01 | Facebook, Inc. | On-demand session upgrade in a coordination service |
CN103078805B (en) * | 2012-12-31 | 2015-08-05 | 北京京东世纪贸易有限公司 | Make the system and method reading the expansion of performance support level of Zookeeper |
-
2015
- 2015-05-07 CN CN201510229101.0A patent/CN106209943A/en not_active Withdrawn
-
2016
- 2016-03-17 WO PCT/CN2016/076647 patent/WO2016177130A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103795569A (en) * | 2014-01-22 | 2014-05-14 | 亿赞普(北京)科技有限公司 | Server connection method and device based on connection pool |
CN104580226A (en) * | 2015-01-15 | 2015-04-29 | 上海瀚之友信息技术服务有限公司 | Session data sharing system and method |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109274641A (en) * | 2018-08-09 | 2019-01-25 | 广东神马搜索科技有限公司 | Connection method and device, calculating equipment and storage medium between client and service node |
CN110134372A (en) * | 2019-07-10 | 2019-08-16 | 启迪云计算有限公司 | A kind of rule-based zookeeper session external management system |
CN110659463A (en) * | 2019-08-23 | 2020-01-07 | 苏州浪潮智能科技有限公司 | Distributed operation method and device of stateless system |
CN110659463B (en) * | 2019-08-23 | 2021-11-12 | 苏州浪潮智能科技有限公司 | Distributed operation method and device of stateless system |
CN112054919A (en) * | 2020-08-03 | 2020-12-08 | 华人运通(江苏)技术有限公司 | Method, device, storage medium and system for generating ID (identity) of container cluster under stateless condition |
CN112054919B (en) * | 2020-08-03 | 2022-08-16 | 华人运通(江苏)技术有限公司 | Method, device, storage medium and system for generating ID (identity) of container cluster under stateless condition |
Also Published As
Publication number | Publication date |
---|---|
WO2016177130A1 (en) | 2016-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106209943A (en) | The system of selection of communication node and device | |
CN106210151A (en) | A kind of zedis distributed caching and server cluster monitoring method | |
CN108510389A (en) | Intelligent contract call method, equipment and readable storage medium storing program for executing based on block chain | |
CN109257440A (en) | A kind of service discovery and client load equalization methods based on service register center | |
CN107947960A (en) | The method for pushing and system of configuration information, the method for reseptance and system of configuration information | |
CN103973725B (en) | A kind of distributed cooperative algorithm and synergist | |
CN107590072A (en) | A kind of application and development and the method and apparatus of test | |
CN110377431B (en) | Service calling method and device under multi-registry scene | |
CN111638972B (en) | Request response method, system, equipment and storage medium based on micro-service | |
CN109173270B (en) | Game service system and implementation method | |
CN110334072A (en) | A kind of distributed file system, file updating method and device | |
CN110069346A (en) | Resource share method, device, electronic equipment between multi-process | |
CN112597249A (en) | Synchronous distribution and storage method and system for service data | |
CN104579765A (en) | Disaster tolerance method and device for cluster system | |
CN105959349A (en) | Distributed service end operation system and method | |
CN106789308A (en) | The GIS service device and its control method of a kind of micro services framework automatically retractable | |
CN105959078A (en) | Cluster time synchronization method, cluster and time synchronization system | |
CN108763017A (en) | Application of software data processing method, server-side and the storage medium of financial business | |
CN108464031B (en) | The redundancy based on database in telecommunication network | |
CN110581892B (en) | Block chain based network connection and recovery mechanism | |
CN110022257A (en) | Distributed information system | |
CN115834668B (en) | Cluster node control method, device, equipment, storage medium and program product | |
CN106534758B (en) | Conference backup method and device | |
Zheng et al. | A qos-aware middleware for fault tolerant web services | |
CN116346834A (en) | Session synchronization method, device, computing equipment and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20161207 |
|
WW01 | Invention patent application withdrawn after publication |