CN111930389B - Storage deployment method, device and equipment of service platform and storage medium - Google Patents

Storage deployment method, device and equipment of service platform and storage medium Download PDF

Info

Publication number
CN111930389B
CN111930389B CN202010779036.XA CN202010779036A CN111930389B CN 111930389 B CN111930389 B CN 111930389B CN 202010779036 A CN202010779036 A CN 202010779036A CN 111930389 B CN111930389 B CN 111930389B
Authority
CN
China
Prior art keywords
service
zookeeper
environment
storage
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.)
Active
Application number
CN202010779036.XA
Other languages
Chinese (zh)
Other versions
CN111930389A (en
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.)
Shenzhen Fenqile Network Technology Co Ltd
Original Assignee
Shenzhen Fenqile Network 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 Shenzhen Fenqile Network Technology Co Ltd filed Critical Shenzhen Fenqile Network Technology Co Ltd
Priority to CN202010779036.XA priority Critical patent/CN111930389B/en
Publication of CN111930389A publication Critical patent/CN111930389A/en
Application granted granted Critical
Publication of CN111930389B publication Critical patent/CN111930389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a storage deployment method, a device, equipment and a storage medium of a service platform. The service platform comprises a service provider and a service consumer, and the method comprises the following steps: deploying storage service of a service platform based on a Mysql database; deploying the storage service into each Zookeeper environment; and writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can perform data query by calling a query interface based on different Zookeeper environments. The embodiment of the invention realizes large storage, expandability and configurability based on Dubbo service platforms.

Description

Storage deployment method, device and equipment of service platform and storage medium
Technical Field
The embodiment of the invention relates to the internet technology, in particular to a storage deployment method, a storage deployment device, storage deployment equipment and storage media of a service platform.
Background
Along with the rapid development of internet technology, dubbo is used as an open-source distributed service framework and is increasingly widely applied. Dubbo a very simple model is adopted, dubbo does not provide a specific service process per se, but provides an API method for calling, and defines two roles of a service Provider (Provider) and a service Consumer (Consumer), wherein the service Provider publishes a service to a registry of services; the service consumer subscribes to the service from the registry; the service consumer invokes the already registered available service.
The prior art is based on Dubbo for service management storage and query, and adopts a storage service and Web query service isolation deployment mode. The storage service is responsible for listening to the changes of the service registration node of a Zookeeper (a distributed application coordination service) and storing the service data in a local cache when it is received. The snoop store procedure is implemented through an implementation Dubbo Notify Listener (snoop notification) interface. The storage service provides Dubbo a data query interface as a service provider. The Web query service performs data query through Dubbo interfaces of the storage service.
However, the service governance storage service stores the monitored full data in a local cache, and when multiple instances are deployed, the cache inconsistency problem occurs, so that the data changes during Web query. When the service is expanded, the increase of service URLs (Uniform Resource Locator, uniform resource locators) can cause the increase of storage pressure and cannot be solved by the expansion, in addition, when the service URLs are changed, URL data can be pushed in a full amount once according to the service names, and the sequence cannot be strictly ensured by two times of changing pushing. When the service frequency is restarted, the stored data and the Zookeeper node data are possibly inconsistent, the Web query does not support multiple sets of Zookeeper environment queries, and quick configuration is also not possible.
Disclosure of Invention
The embodiment of the invention provides a storage deployment method, a device, equipment and a storage medium of a service platform, which are used for realizing large storage, expandability and configurability based on Dubbo service platforms.
To achieve the object, an embodiment of the present invention provides a storage deployment method for a service platform, where the service platform includes a service provider and a service consumer, the method includes:
deploying storage service of a service platform based on a Mysql database;
deploying the storage service into each Zookeeper environment;
And writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can perform data query by calling a query interface based on different Zookeeper environments.
Further, the deploying the storage service into each Zookeeper environment comprises:
And electing each Zookeeper environment to obtain an elected Zookeeper environment.
Further, the writing the data provided by the service provider into the storage service of each Zookeeper environment includes:
and writing the data provided by the service provider into the storage service of each Zookeeper environment based on the elected Zookeeper environment, wherein the storage service of each Zookeeper environment supports the lateral expansion based on the slicing.
Further, the service consumer performing data query by calling a query interface based on different Zookeeper environments comprises:
And the service consumer calls a query interface based on different Zookeeper environments through Web service to query data.
Further, the writing the data provided by the service provider into the storage service of each Zookeeper environment includes:
And configuring each Zookeeper environment and a query interface corresponding to each Zookeeper environment one by one as configuration information in a configuration center.
Further, the service consumer invoking a query interface based on different Zookeeper environments through a Web service to perform data query includes:
The service consumer obtains the configuration information through Web service, so that the Web service reflects and instantiates the configuration information to obtain service instances of different Zookeeper environments;
And the service consumer calls the service instance through Web service to perform data query.
Further, the method further comprises:
And synchronizing the storage service of each Zookeeper environment according to the data provided by the service provider and the data queried by the service consumer at preset time intervals.
In one aspect, an embodiment of the present invention further provides a storage deployment apparatus of a service platform, where the service platform includes a service provider and a service consumer, and the apparatus includes:
The service deployment module is used for deploying the storage service of the service platform based on the Mysql database;
the environment deployment module is used for deploying the storage service into each Zookeeper environment;
And the data writing module is used for writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can perform data query by calling query interfaces based on different Zookeeper environments.
In another aspect, an embodiment of the present invention further provides a computer device, including: one or more processors; and a storage means for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement a method as provided by any of the embodiments of the present invention.
In yet another aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as provided by any of the embodiments of the present invention.
According to the embodiment of the invention, the storage service of the service platform is deployed on the basis of the Mysql database; deploying the storage service into each Zookeeper environment; and writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can query the data by calling query interfaces based on different Zookeeper environments, thereby solving the problems of large storage pressure, inextensibility and inextensibility based on Dubbo service platforms and realizing the effects of large storage, expandability and configurability based on Dubbo service platforms.
Drawings
Fig. 1 is a flow chart of a storage deployment method of a service platform according to a first embodiment of the present invention;
fig. 2 is a flow chart of a storage deployment method of a service platform according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a storage deployment device of a service platform according to a third embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are for purposes of illustration and not of limitation. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts steps as a sequential process, many of the steps may be implemented in parallel, concurrently, or with other steps. Furthermore, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Furthermore, the terms "first," "second," and the like, may be used herein to describe various directions, acts, steps, or elements, etc., but these directions, acts, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. For example, a first module may be referred to as a second module, and similarly, a second module may be referred to as a first module, without departing from the scope of the application. Both the first module and the second module are modules, but they are not the same module. The terms "first," "second," and the like, are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the embodiments of the present application, the meaning of "plurality" is at least two, for example, two, three, etc., unless explicitly defined otherwise.
Example 1
As shown in fig. 1, a first embodiment of the present invention provides a storage deployment method of a service platform, where the service platform includes a service provider and a service consumer, and the method includes:
S110, deploying storage service of the service platform based on the Mysql database.
In this embodiment, the service platform is Dubbo service platform, and the Mysql database is used as the storage service of the Dubbo service platform. Specifically, as shown in table 1, table 1 is a data table of service consumers defined in Mysql database.
Fields Field type Description of the invention
Fid Varchar(128) Main key
Furl Varchar(8192) Consumer address
Fservice name Varchar(2048) Service name
Fapplication Varchar(50) Application name
Fdubbo version Varchar(50) Dubbo version
Fip Varchar(20) IP
Flogger Varchar(50) Log (log)
Fmethod Varchar(2048) List of methods
Fset Varchar(50) Set
Fgroup Varchar(50) Grouping
Fservice version Varchar(50) Service version
Fpid Varchar(50) Process number
Ftimestamp Varchar(100) Time stamp
Ftimeout Varchar(50) Timeout time
TABLE 1
As shown in table 2, table 2 is a data table of service providers defined in the Mysql database.
Fields Field type Description of the invention
Fid Varchar(128) Main key
Furl Varchar(8192) Service address
Fservice name Varchar(2048) Service name
Fapplication Varchar(50) Application name
Fdubbo version Varchar(50) Dubbo framework version
Fip Varchar(20) IP
Fport Varchar(20) Port (port)
Ftype Int(11) Dynamic 1, static 0
Flogger Varchar(50) Log (log)
Fmethod Varchar(2048) List of methods
Fset Varchar(50) Set
Fgroup Varchar(50) Grouping
Fservice version Varchar(50) Service version
Fowner Varchar(50) Responsible person
Fpid Varchar(50) Process number
Ftimestamp Varchar(100) Time stamp
Ftimeout Varchar(50) Timeout time
TABLE 2
And S120, deploying the storage service into each Zookeeper environment.
And S130, writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can perform data query by calling query interfaces based on different Zookeeper environments.
In this embodiment, after the storage service is deployed, the storage service is deployed to each Zookeeper environment, and each Zookeeper environment includes a set of database tables, so that data provided by the service provider can be written into the database tables of each Zookeeper environment, and thus, the service consumer queries the data corresponding to the Zookeeper environment by calling the query interfaces based on different Zookeeper environments.
According to the embodiment of the invention, the storage service of the service platform is deployed on the basis of the Mysql database; deploying the storage service into each Zookeeper environment; and writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can query the data by calling query interfaces based on different Zookeeper environments, thereby solving the problem of high storage pressure based on Dubbo service platforms and realizing the effect of large storage based on Dubbo service platforms.
Example two
As shown in fig. 2, a second embodiment of the present invention provides a storage deployment method of a service platform, where the second embodiment of the present invention is further explained based on the first embodiment of the present invention, and the method includes:
S210, deploying storage service of the service platform based on the Mysql database.
S220, deploying the storage service into each Zookeeper environment.
S230, electing each Zookeeper environment to obtain an elected Zookeeper environment.
S240, writing data provided by the service provider into storage service of each Zookeeper environment based on the elected Zookeeper environment, wherein the storage service of each Zookeeper environment supports the lateral expansion based on the slicing.
In this embodiment, in order to enable the storage service of each Zookeeper environment to support the horizontal expansion based on the slicing, each Zookeeper environment is selected to obtain the selected Zookeeper environment, and then a father node is defined in the selected Zookeeper environment, where the father node may be/{ env }/, and env is an environmental label of the current selected Zookeeper environment.
Further, when data writing is performed, a new dynamic node is first registered with the parent node/{ env } of the election Zookeeper environment/down, and the IP of the current service deployment is used as a node name. And then starting to monitor the change of the father node, acquiring a registration list of the father node and a list IP thereof when monitoring the change, and fully sequencing the IP, so as to obtain a sequencing number corresponding to the current service IP. If the current service data is pushed according to the service dimension, the hash value of the service name is taken when the service data is monitored, when the hash value is equal to the value obtained by modulo the node number and the number, the service name data is processed, the service name data is written into a database table, and the rest data are skipped. Thereby achieving the effect of evenly spreading the writing pressure to all service instances.
S250, each Zookeeper environment and a query interface corresponding to each Zookeeper environment one by one are used as configuration information to be configured in a configuration center, so that a service consumer can acquire the configuration information through Web service, the Web service reflects and instantiates the configuration information to obtain service examples of different Zookeeper environments, and the service consumer can call the service examples to perform data query through the Web service.
In this embodiment, before a service consumer queries, each Zookeeper environment and a query interface corresponding to each Zookeeper environment are configured in a configuration center as configuration information, when querying, the service consumer obtains the configuration information through Web service, then the Web service reflects and instantiates the configuration information to obtain service instances of different Zookeeper environments, and finally the service instances are invoked to query data, so as to complete the configurability of the service platform.
Specifically, the configuration center may adopt a Hippo distributed scheduling system, in the reflection instantiation of the configuration information by the Web service, the service class is initialized after the configuration information is obtained, the environment enumeration value is generated according to the service environment configuration reflection, then the service class is generated according to the service configuration reflection, and the service instance is generated through Dubbo API registration, the service instance is cached according to the environment name and the service name, and finally the corresponding service instance is obtained according to the environment name and the service name and is called to obtain the service instances of different Zookeeper environments, so that the Web service supports multi-environment switching, and when the environment needs to be switched, the configuration center, the service configuration and the environment configuration are modified, and the Web service is restarted to realize rapid deployment.
Wherein, the interface configuration item may be:
Further, the environment configuration items may be:
And S260, synchronizing the storage service of each Zookeeper environment according to the data provided by the service provider and the data queried by the service consumer at preset time intervals.
In this embodiment, in order to ensure that the data is consistent, the service data is compensated by forced synchronization at regular time, and according to the data provided by the service provider and the data queried by the service consumer, the storage service of each Zookeeper environment is synchronized.
Specifically, a leaf node a list of all Zookeeper environments, an all service B list of service providers and an all service C list of service consumers are obtained, then the a list and the B list are respectively compared, if the data B list or the C list existing in the a list does not exist, corresponding data is written in the B list or the C list, if the data B list or the C list does not exist in the a list, the corresponding data is deleted in the B list or the C list, and if the data B list or the C list also exists in the a list, URLs are compared in detail, and the same operation is performed.
According to the embodiment of the invention, the storage service of the service platform is deployed on the basis of the Mysql database; deploying the storage service into each Zookeeper environment; and writing the data provided by the service provider into the storage service of each Zookeeper environment, so that the service consumer can query the data by calling query interfaces based on different Zookeeper environments, the problem of inextensibility and inextensibility based on Dubbo service platforms is solved, and the extensible and configurable effects based on Dubbo service platforms are realized.
Example III
As shown in fig. 3, the third embodiment of the present invention provides a storage and deployment device 100 for a service platform, where the storage and deployment device 100 for a service platform provided in the third embodiment of the present invention can execute the storage and deployment method for a service platform provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. The storage deployment apparatus 100 of the service platform includes a service deployment module 200, an environment deployment module 300, and a data writing module 400.
Specifically, the service deployment module 200 is configured to deploy a storage service of the service platform based on the Mysql database; the environment deployment module 300 is configured to deploy a storage service into each Zookeeper environment; the data writing module 400 is configured to write data provided by a service provider into a storage service of each Zookeeper environment, so that a service consumer performs data query by calling a query interface based on different Zookeeper environments.
In this embodiment, the environment deployment module 300 is further configured to elect each Zookeeper environment to obtain an elected Zookeeper environment. The data writing module 400 is specifically configured to write data provided by the service provider into a storage service of each Zookeeper environment based on the elected Zookeeper environment, where the storage service of each Zookeeper environment supports a lateral expansion based on the shards. And the service consumer calls a query interface based on different Zookeeper environments through Web service to query data. The data writing module 400 is further configured to configure each Zookeeper environment and a query interface corresponding to each Zookeeper environment in a configuration center as configuration information. The service consumer obtains configuration information through the Web service so that the Web service reflects and instantiates the configuration information to obtain service instances of different Zookeeper environments; and the service consumer calls the service instance through the Web service to perform data query.
Further, the storage deployment apparatus 100 of the service platform further includes a data synchronization module 500, where the data synchronization module 500 is configured to synchronize, according to a preset time interval, the storage service of each Zookeeper environment according to the data provided by the service provider and the data queried by the service consumer.
Example IV
Fig. 4 is a schematic structural diagram of a computer device 12 according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in fig. 4 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 4, the computer device 12 is in the form of a general purpose computing device. Components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with computer device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the methods provided by embodiments of the present invention:
deploying storage service of a service platform based on a Mysql database;
deploying the storage service into each Zookeeper environment;
And writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can perform data query by calling a query interface based on different Zookeeper environments.
Example five
The fifth embodiment of the present application further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the methods as provided by all the embodiments of the present application:
deploying storage service of a service platform based on a Mysql database;
deploying the storage service into each Zookeeper environment;
And writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can perform data query by calling a query interface based on different Zookeeper environments.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the invention, the scope of which is determined by the scope of the appended claims.

Claims (8)

1. A storage deployment method of a service platform, the service platform including a service provider and a service consumer, the method comprising:
deploying storage service of a service platform based on a Mysql database;
deploying the storage service into each Zookeeper environment;
Electing each Zookeeper environment to obtain an elected Zookeeper environment, and defining a father node/{ env }/; wherein env is an environmental label of the current election Zookeeper environment;
Writing data provided by the service provider into a storage service of each Zookeeper environment so that the service consumer can perform data query by calling query interfaces based on different Zookeeper environments;
Wherein the writing the data provided by the service provider into the storage service of each Zookeeper environment comprises:
writing data provided by the service provider into storage service of each Zookeeper environment based on the elected Zookeeper environment, wherein the storage service of each Zookeeper environment supports the lateral expansion based on the segmentation;
Wherein the writing the data provided by the service provider into the storage service of each Zookeeper environment based on the elected Zookeeper environment comprises the following steps:
Registering a new dynamic node in the father node/{ env }/lower of the election Zookeeper environment, and using the IP of the current service deployment as a node name;
Monitoring the change of the father node; when monitoring the change, acquiring a registration list of the father node and the registration list IP, and fully sequencing the IP to obtain a sequencing number corresponding to the current service IP;
If the current service data is pushed according to the service dimension, taking a hash value of the service name when the service data is monitored; and when the hash value and the number obtained by modulo the node number are equal, writing the service name data into a database table, and skipping the processing of the rest data.
2. The method of claim 1, wherein the service consumer querying data by invoking a query interface based on different of the Zookeeper environments comprises:
And the service consumer calls a query interface based on different Zookeeper environments through Web service to query data.
3. The method of claim 2, wherein the writing of the data provided by the service provider to the storage service of each of the Zookeeper environments comprises:
And configuring each Zookeeper environment and a query interface corresponding to each Zookeeper environment one by one as configuration information in a configuration center.
4. The method of claim 3, wherein the service consumer invoking a query interface based on different of the Zookeeper environments through a Web service to perform a data query comprises:
The service consumer obtains the configuration information through Web service, so that the Web service reflects and instantiates the configuration information to obtain service instances of different Zookeeper environments;
And the service consumer calls the service instance through Web service to perform data query.
5. The method as recited in claim 1, further comprising:
And synchronizing the storage service of each Zookeeper environment according to the data provided by the service provider and the data queried by the service consumer at preset time intervals.
6. A storage deployment apparatus for a service platform, the service platform comprising a service provider and a service consumer, the apparatus comprising:
The service deployment module is used for deploying the storage service of the service platform based on the Mysql database;
the environment deployment module is used for deploying the storage service into each Zookeeper environment;
The data writing module is used for writing the data provided by the service provider into the storage service of each Zookeeper environment so that the service consumer can perform data query by calling query interfaces based on different Zookeeper environments;
The environment deployment module is further used for electing each Zookeeper environment to obtain an elected Zookeeper environment, and defining a father node/{ env }/, in the elected Zookeeper environment; wherein env is an environmental label of the current election Zookeeper environment;
The data writing module is specifically used for writing data provided by the service provider into the storage service of each Zookeeper environment based on the elected Zookeeper environment, and the storage service of each Zookeeper environment supports the lateral expansion based on the segmentation;
the data writing module is specifically configured to register a new dynamic node under a parent node/{ env }/of the election Zookeeper environment, and use an IP of a current service deployment as a node name; monitoring the change of the father node; when monitoring the change, acquiring a registration list of the father node and the registration list IP, and fully sequencing the IP to obtain a sequencing number corresponding to the current service IP; if the current service data is pushed according to the service dimension, taking a hash value of the service name when the service data is monitored; and when the hash value and the number obtained by modulo the node number are equal, writing the service name data into a database table, and skipping the processing of the rest data.
7. A computer device, comprising:
one or more processors;
storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
CN202010779036.XA 2020-08-05 2020-08-05 Storage deployment method, device and equipment of service platform and storage medium Active CN111930389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010779036.XA CN111930389B (en) 2020-08-05 2020-08-05 Storage deployment method, device and equipment of service platform and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010779036.XA CN111930389B (en) 2020-08-05 2020-08-05 Storage deployment method, device and equipment of service platform and storage medium

Publications (2)

Publication Number Publication Date
CN111930389A CN111930389A (en) 2020-11-13
CN111930389B true CN111930389B (en) 2024-07-26

Family

ID=73307549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010779036.XA Active CN111930389B (en) 2020-08-05 2020-08-05 Storage deployment method, device and equipment of service platform and storage medium

Country Status (1)

Country Link
CN (1) CN111930389B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365750A (en) * 2019-06-25 2019-10-22 苏宁云计算有限公司 Service registration system and method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8868758B2 (en) * 2010-05-04 2014-10-21 Microsoft Corporation Provider connection framework
US9055026B2 (en) * 2011-09-20 2015-06-09 Aetherworks Llc Systems and methods for the demand-driven deployment of location-neutral software
US9596126B2 (en) * 2013-10-10 2017-03-14 Nicira, Inc. Controller side method of generating and updating a controller assignment list
CN104202434A (en) * 2014-09-28 2014-12-10 北京奇虎科技有限公司 Node access method and device
CN106027634B (en) * 2016-05-16 2019-06-04 白杨 Message port Exchange Service system
CN108632299A (en) * 2017-03-15 2018-10-09 北京京东尚科信息技术有限公司 Enhance method, apparatus, electronic equipment and the storage medium of registration center's availability
CN110334091A (en) * 2019-05-09 2019-10-15 重庆天蓬网络有限公司 A kind of data fragmentation distributed approach, system, medium and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365750A (en) * 2019-06-25 2019-10-22 苏宁云计算有限公司 Service registration system and method

Also Published As

Publication number Publication date
CN111930389A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN105787077B (en) Data synchronization method and device
CN111800462B (en) Micro service instance processing method, micro service instance processing device, computer equipment and storage medium
CN108512695A (en) The method and device of interim card is applied in monitoring
CN111800513B (en) Method and device for pushing information and computer readable medium of electronic equipment
CN109711190B (en) Data table batch authorization method and device
WO2022156087A1 (en) Data blood relationship establishing method and apparatus, computer device, and storage medium
CN111930389B (en) Storage deployment method, device and equipment of service platform and storage medium
CN107025257A (en) A kind of transaction methods and device
CN111984723A (en) Data synchronization method and device and terminal equipment
CN112181724A (en) Big data disaster tolerance method and device and electronic equipment
CN109670324B (en) Data access method and device
CN112015534A (en) Configurated platform scheduling method, system and storage medium
CN105573878A (en) Remote terminal test method and system
CN112799863B (en) Method and device for outputting information
CN111262727B (en) Service capacity expansion method, device, equipment and storage medium
US11360785B2 (en) Execution path determination in a distributed environment
US20200265064A1 (en) Data Replication Using Probabilistic Replication Filters
CN113127010B (en) Application management method and device, electronic equipment and storage medium
US10289691B2 (en) Dynamic replication of networked files
CN110737718A (en) Data backup method and device
CN118897865A (en) Data synchronization method, device, equipment and medium
CN118427277A (en) Data processing method and device and related equipment
CN113900949A (en) Multi-version micro-service test method and device, electronic equipment and storage medium
CN115543347A (en) Application deployment method and device, electronic equipment and computer readable medium
CN115344301A (en) Configuration file checking method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant