CN110830554A - Method and system for asynchronously and concurrently updating distributed node mirror image - Google Patents

Method and system for asynchronously and concurrently updating distributed node mirror image Download PDF

Info

Publication number
CN110830554A
CN110830554A CN201910973342.4A CN201910973342A CN110830554A CN 110830554 A CN110830554 A CN 110830554A CN 201910973342 A CN201910973342 A CN 201910973342A CN 110830554 A CN110830554 A CN 110830554A
Authority
CN
China
Prior art keywords
updating
mirror image
grouping
update
computer device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910973342.4A
Other languages
Chinese (zh)
Inventor
郭申
张经生
孙国军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Kingsoft Online Game Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Online Game 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 Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Zhuhai Kingsoft Online Game Technology Co Ltd
Priority to CN201910973342.4A priority Critical patent/CN110830554A/en
Publication of CN110830554A publication Critical patent/CN110830554A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The technical scheme of the invention comprises a method and a system for asynchronously and concurrently updating a distributed node mirror image, wherein the method comprises the following steps: s1, the update terminal creates a corresponding grouping list for the computer device which needs the same mirror image update, and stores the grouping list; s2, configuring the mirror image updating command of each grouping list; s3, reading the computer device information and its configuration information of the grouping list, pulling the image file from the image server, and executing asynchronous concurrent update; and S4, feeding back the updating result to the updating terminal. The invention has the beneficial effects that: the tediousness of pulling the latest mirror image operation by the distributed machine; the problem of low efficiency of updating the mirror image caused by a plurality of machines and overlarge mirror image is solved; the problem of remote updating of the mirror image caused by a plurality of machines and overlarge mirror image is solved; and the coroutine asynchronous concurrency is adopted, so that the timeliness of updating the large mirror image is greatly improved.

Description

Method and system for asynchronously and concurrently updating distributed node mirror image
Technical Field
The invention relates to a method and a system for asynchronously and concurrently updating a distributed node mirror image, and belongs to the field of computer server side testing.
Background
In distributed business services deployed in containers, the distribution and updating of images is a common occurrence. If each service is required to update the image after the code is updated, the new image is distributed to each machine, and the common method is to log each machine and then pull the latest image from the image warehouse to the local machine. If only a few machines are available, the operation is simple. This operation is cumbersome if there are a large number of machines that need to be self-mirrored for distribution and updating.
Disclosure of Invention
The invention provides a method and a system for asynchronously and concurrently updating a distributed node mirror image, which are used for solving the defects of the prior art.
The technical scheme of the invention comprises a method for asynchronously and concurrently updating a distributed node mirror image, which is characterized by comprising the following steps: s1, the update terminal creates a corresponding grouping list for the computer device which needs the same mirror image update, and stores the grouping list; s2, configuring the mirror image updating command of each grouping list; s3, reading the computer device information and its configuration information of the grouping list, pulling the image file from the image server, and executing asynchronous concurrent update; and S4, feeding back the updating result to the updating terminal.
According to the method for asynchronously and concurrently updating the distributed node image, step S1 specifically includes: one or more computer devices needing to be updated create corresponding grouping lists, and computer device information of the grouping lists is obtained and added to the grouping lists and stored.
According to the asynchronous concurrent updating distributed node mirror image method, a grouping list is stored in an updating terminal or a database.
According to the method for asynchronously and concurrently updating the distributed node image, step S2 specifically includes: reading the grouping list of step S1 according to the data source where the grouping list is located, including the unique identifier of the read grouping, the number of grouped computer devices, and the IP address of each computer device; and setting an instruction for pulling the mirror image file from the mirror image server to generate configuration information.
According to the method for asynchronously and concurrently updating the distributed node image, step S3 specifically includes: the updating terminal respectively establishes a plurality of corresponding coroutine tasks according to the number of the computer devices, and establishes connection with the corresponding computer devices through the coroutine tasks; and the updating terminal logs in the computer device, synchronously pulls the image file corresponding to the image server according to the configuration information, and asynchronously updates the computer device by the coroutine task.
The method for asynchronously and concurrently updating the distributed node image further comprises the following steps: and if the computer device fails to update continuously within the preset times, stopping updating, and reporting the update information of all the computer devices in the grouping list to an update terminal.
The technical scheme of the invention also comprises a system for asynchronously and concurrently updating the distributed node images, which is used for executing the method, and the system comprises the following components: the grouping module is used for creating a corresponding grouping list for the computer device which needs to be subjected to the same mirror image updating and storing the grouping list; the configuration module is used for configuring the mirror image updating instruction of each grouping list; the updating module is used for reading the computer device information and the configuration information of the grouping list, pulling the mirror image file from the mirror image server and executing asynchronous concurrent updating; and the feedback module is used for feeding back the updating result to the updating terminal.
The invention has the beneficial effects that: the tediousness of pulling the latest mirror image operation by the distributed machine; the problem of low efficiency of updating the mirror image caused by a plurality of machines and overlarge mirror image is solved; the problem of remote updating of the mirror image caused by a plurality of machines and overlarge mirror image is solved; and the coroutine asynchronous concurrency is adopted, so that the timeliness of updating the large mirror image is greatly improved.
Drawings
FIG. 1 shows a general flow diagram according to an embodiment of the invention.
FIG. 2 is a block diagram of a system according to an embodiment of the present invention.
Detailed Description
The conception, the specific structure and the technical effects of the present invention will be clearly and completely described in conjunction with the embodiments and the accompanying drawings to fully understand the objects, the schemes and the effects of the present invention.
FIG. 1 shows a general flow diagram according to an embodiment of the invention. The method comprises the following steps: s1, the update terminal creates a corresponding grouping list for the computer device which needs the same mirror image update, and stores the grouping list; s2, configuring the mirror image updating command of each grouping list; s3, reading the computer device information and its configuration information of the grouping list, pulling the image file from the image server, and executing asynchronous concurrent update; and S4, feeding back the updating result to the updating terminal.
Based on the above process, the technical scheme of the invention provides a more detailed implementation process, which comprises the following steps:
(1) configuring a machine group needing to update the mirror image;
(2) configuring a command for updating the mirror image;
(3) traversing a native machine, performing SSH remote operation on the machine, and executing the logic of pulling the mirror image;
(4) and counting the updating result, retrying twice without success, and outputting the result.
Specifically, for steps (1) and (2), a profile is configured.
A machine: the mirrored machine list, username and password need to be updated.
Command: mirror update command (where pull command is configured to pull mirror, in fact any shell command can be configured and executed, e.g. after updating mirror, it can be changed to restart service command to make it effective)
Once configured, the sequence is simple, and each time it is used as if. Of course, the machine list may be retrieved from the database if the machine list is in the database. That is, the data source may be obtained in a manner that the data source itself may be changed at will, and may be configured in a configuration file, or may be obtained from a cache or a database. Through the above steps, the mirror image of the whole machine set can be conveniently and concisely updated, and the fussy pulling process is avoided.
And (4) for the step (3), executing the tool, establishing connection, asynchronously and concurrently operating the remote machine, and pulling the mirror image.
Code logic: initializing-parallel-ssh connecting each machine, namely establishing connection; 2. asynchronous concurrency-call the get coroutine, execute the remote command with paramiko (e.g., docker pull 10.11.81.136:5000/test _ locust:9.18), and return the result. The cooperation tasks are started by the machines, and the figures do not influence each other and take their own roles.
And (4) outputting the result to the terminal. What is returned here is the commanded terminal output content
To summarize: in the case of distributed machines, the efficiency and simplicity of docker updates are essential. The project mainly solves the complicated process of remote asynchronous mirror image updating, supports simple configuration, greatly saves the cost of updating the mirror image, is simple and convenient to operate and supports remote operation.
FIG. 2 is a block diagram of a system according to an embodiment of the present invention. In the figure, a 1-An and B1-Bn represent a plurality of computer devices to be updated respectively belonging to different grouping lists, the update terminal establishes connection through SSH and performs update through asynchronous and concurrent, and the image server is used for providing corresponding update image files for the computer devices.
The above description is only a preferred embodiment of the present invention, and the present invention is not limited to the above embodiment, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention as long as the technical effects of the present invention are achieved by the same means. The invention is capable of other modifications and variations in its technical solution and/or its implementation, within the scope of protection of the invention.

Claims (7)

1. A method for asynchronously and concurrently updating a distributed node image, the method comprising the steps of:
s1, the update terminal creates a corresponding grouping list for the computer device which needs the same mirror image update, and stores the grouping list;
s2, configuring the mirror image updating command of each grouping list;
s3, reading the computer device information and its configuration information of the grouping list, pulling the image file from the image server, and executing asynchronous concurrent update;
and S4, feeding back the updating result to the updating terminal.
2. The method for asynchronously and concurrently updating a distributed node image according to claim 1, wherein the step S1 specifically includes:
one or more computer devices needing to be updated create corresponding grouping lists, and computer device information of the grouping lists is obtained and added to the grouping lists and stored.
3. The method for asynchronous concurrent update of a distributed node image according to claim 2, wherein the grouped list is stored in an update terminal or database.
4. The method for asynchronously and concurrently updating a distributed node image according to claim 1, wherein the step S2 specifically includes:
reading the grouping list of step S1 according to the data source where the grouping list is located, including the unique identifier of the read grouping, the number of grouped computer devices, and the IP address of each computer device;
and setting an instruction for pulling the mirror image file from the mirror image server to generate configuration information.
5. The method for asynchronously and concurrently updating a distributed node image according to claim 4, wherein the step S3 specifically includes:
the updating terminal respectively establishes a plurality of corresponding coroutine tasks according to the number of the computer devices, and establishes connection with the corresponding computer devices through the coroutine tasks;
and the updating terminal logs in the computer device, synchronously pulls the image file corresponding to the image server according to the configuration information, and asynchronously updates the computer device by the coroutine task.
6. The method for asynchronously and concurrently updating a distributed node image according to claim 5, further comprising:
and if the computer device fails to update continuously within the preset times, stopping updating, and reporting the update information of all the computer devices in the grouping list to an update terminal.
7. A system for asynchronous concurrent update of a distributed node image for performing the method of any of claims 1-6, the system comprising:
the grouping module is used for creating a corresponding grouping list for the computer device which needs to be subjected to the same mirror image updating and storing the grouping list;
the configuration module is used for configuring the mirror image updating instruction of each grouping list;
the updating module is used for reading the computer device information and the configuration information of the grouping list, pulling the mirror image file from the mirror image server and executing asynchronous concurrent updating;
and the feedback module is used for feeding back the updating result to the updating terminal.
CN201910973342.4A 2019-10-14 2019-10-14 Method and system for asynchronously and concurrently updating distributed node mirror image Pending CN110830554A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910973342.4A CN110830554A (en) 2019-10-14 2019-10-14 Method and system for asynchronously and concurrently updating distributed node mirror image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910973342.4A CN110830554A (en) 2019-10-14 2019-10-14 Method and system for asynchronously and concurrently updating distributed node mirror image

Publications (1)

Publication Number Publication Date
CN110830554A true CN110830554A (en) 2020-02-21

Family

ID=69549308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910973342.4A Pending CN110830554A (en) 2019-10-14 2019-10-14 Method and system for asynchronously and concurrently updating distributed node mirror image

Country Status (1)

Country Link
CN (1) CN110830554A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113504933A (en) * 2021-05-28 2021-10-15 曲阜师范大学 Workshop machine updating method and system
CN115987652A (en) * 2022-12-27 2023-04-18 北京深盾科技股份有限公司 Account management method, system, equipment and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178659A (en) * 2007-12-14 2008-05-14 中国人民解放军国防科学技术大学 Large scale computer node bootstrap paralleling update method and system
US20100325523A1 (en) * 2009-06-19 2010-12-23 Marko Slyz Fault-tolerant method and apparatus for updating compressed read-only file systems
CN102387204A (en) * 2011-10-21 2012-03-21 中国科学院计算技术研究所 Method and system for maintaining consistency of cluster caching
WO2016000137A1 (en) * 2014-06-30 2016-01-07 北京新媒传信科技有限公司 Method, client and system for multi-site automatic update
CN109117155A (en) * 2018-07-11 2019-01-01 高新兴科技集团股份有限公司 A kind of method and apparatus of edition upgrading

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178659A (en) * 2007-12-14 2008-05-14 中国人民解放军国防科学技术大学 Large scale computer node bootstrap paralleling update method and system
US20100325523A1 (en) * 2009-06-19 2010-12-23 Marko Slyz Fault-tolerant method and apparatus for updating compressed read-only file systems
CN102387204A (en) * 2011-10-21 2012-03-21 中国科学院计算技术研究所 Method and system for maintaining consistency of cluster caching
WO2016000137A1 (en) * 2014-06-30 2016-01-07 北京新媒传信科技有限公司 Method, client and system for multi-site automatic update
CN109117155A (en) * 2018-07-11 2019-01-01 高新兴科技集团股份有限公司 A kind of method and apparatus of edition upgrading

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113504933A (en) * 2021-05-28 2021-10-15 曲阜师范大学 Workshop machine updating method and system
CN115987652A (en) * 2022-12-27 2023-04-18 北京深盾科技股份有限公司 Account management method, system, equipment and computer storage medium
CN115987652B (en) * 2022-12-27 2023-11-03 北京深盾科技股份有限公司 Account management method, system, equipment and computer storage medium

Similar Documents

Publication Publication Date Title
CN107783975B (en) Method and device for synchronous processing of distributed databases
US10944628B2 (en) Network operation support system and network device management method
CN108804618B (en) Database configuration method, device, computer equipment and storage medium
US9473356B2 (en) Automatic configuration of applications based on host metadata using application-specific templates
CN110083627B (en) Data processing method, system, computer device and storage medium
CN111198814A (en) Continuously integrated acceptance system for continuous delivery
CN112182104A (en) Data synchronization method, device, equipment and storage medium
CN110830554A (en) Method and system for asynchronously and concurrently updating distributed node mirror image
CN109614400A (en) The influence and Source Tracing method, apparatus, equipment and storage medium of failed tasks
CN107134124B (en) Unified management control method for carrier chip meter reading interface of broadband carrier communication module
CN110661851A (en) Data exchange method and device
CN113849361A (en) Method, device, equipment and storage medium for testing service node
CN111339055B (en) Big data cluster capacity expansion method and device
CN110704122A (en) Plug-in loading method and device
WO2019055845A1 (en) Event ordering framework in distributed asynchronous systems
CN110825538A (en) MQ-based method for dynamically interacting data by self-defining data types
CN112749043B (en) Database disaster recovery method, system, device and medium
CN109634918A (en) A kind of search method of abnormal document, system, device and readable storage medium storing program for executing
CN112367205B (en) Processing method and scheduling system for HTTP scheduling request
CN105765908B (en) A kind of multi-site automatic update method, client and system
CN113778486B (en) Method, device, medium and equipment for containerization processing of code pipeline
CN113872808B (en) Application processing method and device
JP2013134554A (en) Command processing system and method
US11468026B2 (en) Information processing apparatus, information processing method, and recording medium recording information processing program
CN111414198B (en) Request processing method and device

Legal Events

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

Application publication date: 20200221