CN114416196B - Multi-service cascade starting method and device and computer readable storage medium - Google Patents

Multi-service cascade starting method and device and computer readable storage medium Download PDF

Info

Publication number
CN114416196B
CN114416196B CN202111601057.3A CN202111601057A CN114416196B CN 114416196 B CN114416196 B CN 114416196B CN 202111601057 A CN202111601057 A CN 202111601057A CN 114416196 B CN114416196 B CN 114416196B
Authority
CN
China
Prior art keywords
service
starting
cascade
script
docker
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
CN202111601057.3A
Other languages
Chinese (zh)
Other versions
CN114416196A (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 Mainway Technology Co ltd
Seczone Technology Co Ltd
Original Assignee
Shenzhen Mainway Technology Co ltd
Seczone 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 Mainway Technology Co ltd, Seczone Technology Co Ltd filed Critical Shenzhen Mainway Technology Co ltd
Priority to CN202111601057.3A priority Critical patent/CN114416196B/en
Publication of CN114416196A publication Critical patent/CN114416196A/en
Application granted granted Critical
Publication of CN114416196B publication Critical patent/CN114416196B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

According to the multi-service cascade starting method, the multi-service cascade starting device and the computer readable storage medium, whether a first startup self-starting script exists in the docker service or not is judged at one stage; when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not; when a second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of the host; and controlling the cascade starting of the corresponding application service in the docker container according to the cascade service starting script. Through the implementation of the scheme, the cascade service starting script is called through the preset starting self-starting script of the host machine, the corresponding application service cascade starting is controlled, the human resource consumption is reduced, the starting efficiency of the application service is improved, and the problem of application service starting failure can be effectively reduced through the unique cascade service starting script.

Description

Multi-service cascade starting method and device and computer readable storage medium
Technical Field
The present application relates to the field of network security technologies, and in particular, to a method and an apparatus for starting multi-service cascade, and a computer readable storage medium.
Background
Currently, a Docker file deployment system is adopted in mainstream docker deployment, great convenience is provided for realizing automatic deployment, but in some specific production environments, the Docker file deployment system is often limited by a network, and a Docker file mode is limited. Meanwhile, in the process of delivering the small-sized project, because of the cascade relation among a plurality of services, a plurality of middleware and application services are often packed to run in one container, and the problem that the starting sequence among different middleware and application services has certain limitation exists. When a production environment encounters an emergency (such as power failure, equipment maintenance, system restart, and the like), the service inside the container often cannot be timely restored to operate, so that the production task cannot be timely completed, and extremely serious consequences can be caused.
After the fault is repaired, the manual work receives the entering containers to start the service one by one, but the manpower resource is consumed, and the efficiency is influenced. When the services are deployed, each service is set to be started up and started up in the container, so that the services can be started up one by one according to the cascade requirement after the docker container is started up. However, the systemd manager requires that an absolute path command needs to be input when a starting service parameter ExecStart exists, some services (such as an elastic search) exist in the actual environment, and the service needs to be switched to a common user account to execute the starting command, so that the mode cannot be directly used.
Disclosure of Invention
The embodiment of the application provides a multi-service cascade starting method, a multi-service cascade starting device and a computer readable storage medium, and at least solves the problems that in the related art, a plurality of application services are started one by one manually, manpower resources are consumed, the starting efficiency of the application services is influenced, and starting failure of a plurality of application service self-starting files possibly exists.
A first aspect of an embodiment of the present application provides a multi-service cascade starting method, including:
performing primary judgment on whether the docker service has a first startup self-starting script or not;
when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not;
when the second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of a host;
and controlling the corresponding application service cascade starting in the docker container according to the cascade service starting script.
A second aspect of the embodiments of the present application provides a multi-service cascade starting apparatus, including:
the first judgment module is used for carrying out primary judgment on whether the docker service has a first startup self-starting script or not;
the second judging module is used for judging whether a second startup self-starting script exists in the docker container or not when the first startup self-starting script exists in the docker service;
the calling module is used for executing the cascading service starting script of the docker container through a preset starting self-starting script when the docker container has the second starting self-starting script;
and the control module is used for controlling the cascade starting of the corresponding application service in the docker container according to the cascade service starting script.
A third aspect of embodiments of the present application provides an electronic apparatus, including: the system comprises a memory, a processor and a bus, wherein the bus is used for realizing the connection and communication between the memory and the processor; the processor is configured to execute a computer program stored on the memory, and when the processor executes the computer program, the processor performs each step in the multi-service cascade starting method provided in the first aspect of the embodiment of the present application.
A fourth aspect of the present embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the multi-service cascade starting method provided in the first aspect of the present embodiment.
As can be seen from the above, according to the multi-service cascade starting method, apparatus, and computer readable storage medium provided in the present application, a primary judgment is performed on whether a first boot self-starting script exists in a docker service; when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not; when the second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of a host; and controlling the cascade start of the corresponding application service in the docker container according to the cascade service start script. Through the implementation of the scheme, whether the Docker service and the Docker container have the startup self-starting script or not is sequentially judged, when the startup self-starting script exists, the cascade service starting script of the Docker container is called through the preset startup self-starting script of the host machine, the corresponding application service in the Docker container is controlled to be started in a cascade mode, the human resource consumption is reduced through the cascade service starting script, the starting efficiency of the application service is improved, and the problem of application service starting failure can be effectively solved through the unique cascade service starting script.
Drawings
Fig. 1 is a basic flowchart of a multi-service cascade connection starting method according to a first embodiment of the present application;
fig. 2 is a detailed flowchart of a multi-service cascade starting method according to a second embodiment of the present application;
fig. 3 is a schematic diagram of program modules of a multi-service cascade start apparatus according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
Detailed description of the preferred embodiments
In order to make the objects, features and advantages of the present invention more apparent and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to solve the problems in the related art that the manpower resources are consumed and the starting efficiency of the application services is affected when the multiple application services are manually started one by one, and the multiple application service self-starting files may have a starting failure, a first embodiment of the present application provides a multi-service cascade starting method, for example, fig. 1 is a basic flow chart of the multi-service cascade starting method provided in this embodiment, and the multi-service cascade starting method includes the following steps:
step 101, performing primary judgment on whether the docker service has the first startup self-starting script or not.
Specifically, in this embodiment, the docker is an open-source application container engine, the docker service refers to a docker service, and in practical application, the docker service often needs to be manually started by a technician responsible for operation and maintenance.
In an optional implementation manner of this embodiment, after the step of performing a first-level judgment on whether the first boot self-booting script exists in the docker service, the method further includes: when the first startup self-starting script does not exist in the docker service, setting a first startup self-starting script file in the docker service; and controlling the socket service to boot automatically according to the first boot self-boot script file.
Specifically, in this embodiment, when it is determined through the first-stage judgment that the first power-on self-starting script does not exist in the docker service, the first power-on self-starting script file is set in the docker service, and the docker service is automatically started when the host is powered on according to the first power-on self-starting script file, so that the power-on self-starting of the docker service can effectively reduce the consumption of human resources.
And 102, when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not.
Specifically, in practical application, the application service is deployed in the docker container by the docker deployment system, so that the docker container must be started before the application service is started, and the docker container needs to be started after the docker service is started.
In an optional implementation manner of this embodiment, after the step of performing secondary determination on whether a second boot self-booting script exists in the docker container, the method further includes: when the second startup self-starting script does not exist in the docker container, setting a second startup self-starting script file in the docker container; and controlling the socket container to be started and started automatically according to the second starting and starting script file.
Specifically, in this embodiment, when it is determined through the second-level judgment that the docker container does not have the second startup self-starting script, the second startup self-starting script file is set in the docker container, and according to the second startup self-starting script file, after the docker service is automatically started, the docker container is started, and the consumption of human resources can be effectively reduced by the docker container startup self-starting.
And 103, when the second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of the host.
Specifically, in this embodiment, after both the docker service and the docker container can be normally started and started, whether a preset startup self-starting script for starting the cascading service starting script exists in the host is detected, and the cascading service starting script of the docker container is called through the preset startup self-starting script of the host, so that a plurality of starting service files are not needed, only one cascading starting script and one starting self-starting script service file are needed, the docker deployment system is simpler and more convenient, and the detection efficiency is improved. It should be noted that the boot self-booting script of the host may control the host to be autonomously rebooted when an emergency event (such as power failure, equipment maintenance, system reboot, etc.) is encountered.
In an optional implementation manner of this embodiment, before the step of calling the cascading service start script of the docker container by the preset power-on self-start script, the method further includes: acquiring a cascading service starting script edited according to the starting sequence of the application service; and importing the cascading service starting script into a docker container.
Specifically, in practical application, when services are deployed, each service is set to be started up and started up in a container, so that after a docker container is started up, the services can be started up one by one according to cascade requirements. However, the system manager requires that an absolute path command needs to be input to start a service parameter ExecStart, some services such as an elastic search exist in an actual environment, and the actual environment needs to be switched to a common user account to execute a start command, so that the method cannot be directly used.
And 104, controlling the corresponding application service cascade start in the docker container according to the cascade service start script.
Specifically, in this embodiment, the corresponding application service cascade start in the docker container is controlled according to the application service start sequence designed in the cascade service start script.
In an optional implementation manner of this embodiment, before the step of controlling, according to the cascading service start script, the cascading start of the corresponding application service in the docker container, the method further includes: acquiring an incidence relation among all application services; performing cascade grouping on the application service according to the association relation; importing the application services of different groups into different docker containers; determining the cascade relation among different docker containers according to the cascade relation among the groups; and determining the sequence of different docker containers for executing the cascade service starting script to start the application service according to the cascade relation among the different docker containers.
Specifically, in practical application, if there are a lot of application services of a docker container, a situation of a jam or a failed start may occur in a process of starting the application services, in this embodiment, association relationships among all application services are obtained, the application services are cascade-grouped according to the association relationships, the application services associated with each other are grouped into a same group and are packed and introduced into the docker container, it should be understood that, when a docker runs, a plurality of docker containers may exist at the same time, a cascade relationship among different docker containers is determined according to the cascade relationship among the groups, and a sequence of execution of a cascade service start script by different docker containers on an entire application service start operation in the docker container is determined according to the cascade relationship among the different docker containers when the application service is started. It should be noted that, related technical personnel can adjust the content of the cascading service starting script according to the actual environment, and control the application service which actually needs to be started in different docker containers to perform cascading starting, so that the cascading starting of the application service is more flexible.
In an optional implementation manner of this embodiment, after the step of controlling, according to the cascade service start script, the cascade start of the corresponding application service in the docker container, the method further includes: after all the application services are successfully cascaded and started, restarting the host machine; controlling the cascade start of the application service in the docker container according to the cascade service start script; and if all the application services are successfully cascaded and started, determining that the cascade service starting script is successfully set.
Specifically, in this embodiment, when the system is initially deployed, after all the cascading of the application services are successfully started, the host is controlled to autonomously restart to determine whether the cascading service start script is successfully set, after the host is restarted, the application services in the docker container are controlled to be cascaded and started again according to the cascading service start script, and if all the application services are successfully started, it is determined that the cascading service start script is successfully set.
It should be noted that, after the step of restarting the host after all cascading startup of the corresponding application service is successful, the method further includes: when the corresponding cascade start failure of the application service exists, detecting whether a code defect exists in a script file of the application service corresponding to the cascade start failure of the cascade service start script; if the script file has a code defect, repairing the script file according to the code defect; and executing the step of restarting the host again based on the repaired cascading service starting script.
Specifically, in this embodiment, after the host is restarted, if there is an application service start failure that needs to be started, whether a code defect exists in a script file of the cascade service start script corresponding to the application service that needs to be started is detected, after the code defect of the cascade service start script is determined, the code defect is repaired, after the repair is completed, the host is restarted, and the cascade service start script is verified again.
Based on the scheme of the embodiment of the application, whether the docker service has the first startup self-starting script or not is judged at one stage; when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not; when a second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of the host; and controlling the cascade starting of the corresponding application service in the docker container according to the cascade service starting script. Through the implementation of the scheme, whether the Docker service and the Docker container have the startup self-starting script or not is sequentially judged, when the startup self-starting script exists, the preset startup self-starting script of the host computer calls the cascading service starting script of the Docker container to control the cascading starting of the corresponding application service in the Docker container, the starting efficiency of the application service is improved while the human resource consumption is reduced through the cascading service starting script, and the problem of the application service starting failure can be effectively reduced through the unique cascading service starting script.
The method in fig. 2 is a detailed multi-service cascade starting method provided in a second embodiment of the present application, and the multi-service cascade starting method includes:
step 201, performing primary judgment on whether the docker service has the first startup self-starting script or not.
Specifically, in this embodiment, the docker is an open-source application container engine, the docker service refers to a docker service, and in practical application, the docker service often needs to be manually started by a technician responsible for operation and maintenance.
Step 202, when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not.
Specifically, in practical application, the application service is deployed in the docker container by the docker deployment system, so that the docker container must be started before the application service is started, and the docker container needs to be started after the docker service is started.
And 203, when the second startup self-starting script exists in the docker container, calling the cascade service starting script of the docker container through the preset startup self-starting script of the host.
And 204, controlling the corresponding application service cascade start in the docker container according to the cascade service start script.
And step 205, restarting the host machine after all the cascading startup of the application services is successful.
And step 206, controlling the cascade starting of the application service in the docker container according to the cascade service starting script.
And step 207, if all the application services are successfully cascaded and started, determining that the cascading service starting script is successfully set.
Specifically, in this embodiment, when the system is deployed for the first time, after all the cascading of the application services are successfully started, the host is controlled to autonomously restart to determine whether the cascading service start script is successfully set, after the host is restarted, the application service cascading in the docker container is controlled to be started again according to the cascading service start script, and if all the application services are successfully started, it is determined that the cascading service start script is successfully set.
It should be understood that, the size of the serial number of each step in this embodiment does not mean the execution sequence of the step, and the execution sequence of each step should be determined by its function and inherent logic, and should not be limited uniquely to the implementation process of the embodiment of the present application.
According to the multi-service cascade starting method provided by the scheme of the application, whether a first startup self-starting script exists in the docker service is judged at one stage; when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not; when a second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of the host; controlling the cascade starting of the corresponding application service in the docker container according to the cascade service starting script; after all the application services are successfully cascaded and started, restarting the host machine; controlling the cascade start of the application service in the docker container according to the cascade service start script; if all the application services are successfully cascaded and started, determining that the cascade service starting script is successfully set, calling the cascade service starting script through a preset starting self-starting script of a host machine through the implementation of the scheme of the application, controlling the corresponding application service cascade starting, restarting the host machine when the initial cascade starting is successful, verifying the accuracy of the cascade service starting script and ensuring the operation efficiency of the application services when the cascade starting is needed.
Fig. 3 is a multi-service cascade starting apparatus according to a third embodiment of the present application. The multi-service cascade starting device can be used for realizing the multi-service cascade starting method in the embodiment. As shown in fig. 3, the multi-service cascade start apparatus mainly includes:
the first judging module 301 is configured to perform primary judgment on whether a first boot self-starting script exists in the docker service;
the second judging module 302 is configured to perform secondary judgment on whether a second startup self-starting script exists in the docker container when the first startup self-starting script exists in the docker service;
the calling module 303 is configured to execute the cascading service start script of the docker container by presetting the power-on self-start script when the docker container has the second power-on self-start script;
and the control module 304 is configured to control cascading start of the corresponding application service in the docker container according to the cascading service start script.
In an optional implementation manner of this embodiment, the multi-service cascade starting apparatus further includes: and setting a module. The setting module is used for: and when the first startup self-starting script does not exist in the docker service, setting a first startup self-starting script file in the docker service. The control module is further configured to: and controlling the socket service to boot automatically according to the first boot self-boot script file.
In an optional implementation manner of this embodiment, the setting module is further configured to: and when the second starting-up self-starting script does not exist in the docker container, setting a second starting-up self-starting script file in the docker container. The control module is further configured to: and controlling the socket container to be started and started automatically according to the second starting and starting script file.
In an optional implementation manner of this embodiment, the multi-service cascade starting apparatus further includes: the device comprises an acquisition module and an import module. The acquisition module is used for: and acquiring a cascading service starting script edited according to the starting sequence of the application service. The import module is used for: and importing the cascading service starting script into a docker container.
In an optional implementation manner of this embodiment, the multi-service cascade starting apparatus further includes: the device comprises a restarting module and a determining module. The restart module is to: and restarting the host machine after all the cascade connection starting of the application service is successful. The control module is further configured to: and controlling the cascade starting of the application service in the docker container according to the cascade service starting script. The determination module is to: and if all the application services are successfully cascaded and started, determining that the cascade service starting script is successfully set.
Further, in an optional implementation manner of this embodiment, the multi-service cascade starting apparatus further includes: the device comprises a detection module and a repair module. The detection module is used for: when the corresponding cascade start failure of the application service exists, whether code defects exist in a script file of the application service corresponding to the cascade start failure of the cascade service start script is detected. The repair module is to: and if the script file has code defects, repairing the script file according to the code defects. The restart module is further configured to: and executing the step of restarting the host again based on the repaired cascading service starting script.
In an optional implementation manner of this embodiment, the multi-service cascade starting apparatus further includes: and (5) grouping the modules. The acquisition module is further configured to: and acquiring the association relation among all the application services. The grouping module is used for: and performing cascading grouping on the application service according to the association relation. The import module is further configured to: and importing the application services of different groups into different docker containers. The determination module is further configured to: determining the cascade relation among different docker containers according to the cascade relation among the groups; and determining the sequence of different docker containers for executing the cascade service starting script to start the application service according to the cascade relation among the different docker containers.
It should be noted that, the multi-service cascade starting method in the first and second embodiments can be implemented based on the multi-service cascade starting device provided in this embodiment, and it can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process of the multi-service cascade starting device described in this embodiment may refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
According to the multi-service cascade starting device provided by the scheme of the application, whether a first startup self-starting script exists in the docker service is judged at one stage; when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not; when a second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of the host; and controlling the cascade starting of the corresponding application service in the docker container according to the cascade service starting script. Through the implementation of the scheme, whether the Docker service and the Docker container have the startup self-starting script or not is sequentially judged, when the startup self-starting script exists, the preset startup self-starting script of the host computer calls the cascading service starting script of the Docker container to control the cascading starting of the corresponding application service in the Docker container, the starting efficiency of the application service is improved while the human resource consumption is reduced through the cascading service starting script, and the problem of the application service starting failure can be effectively reduced through the unique cascading service starting script.
Fig. 4 is an electronic device according to a fourth embodiment of the present disclosure. The electronic device can be used for implementing the multi-service cascade starting method in the foregoing embodiment. As shown in fig. 4, the electronic device mainly includes:
memory 401, processor 402, bus 403, and computer programs stored on memory 401 and executable on processor 402, memory 401 and processor 402 being connected via bus 403. The processor 402, when executing the computer program, implements the multi-service cascading initiation method in the foregoing embodiments. Wherein the number of processors may be one or more.
The Memory 401 may be a high-speed Random Access Memory (RAM) Memory or a non-volatile Memory (non-volatile Memory), such as a disk Memory. The memory 401 is used for storing executable program code and the processor 402 is coupled to the memory 401.
Further, an embodiment of the present application also provides a computer-readable storage medium, where the computer-readable storage medium may be provided in an electronic device in the foregoing embodiments, and the computer-readable storage medium may be the memory in the foregoing embodiment shown in fig. 4.
The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the multi-service cascade initiation method in the foregoing embodiments. Further, the computer-readable storage medium may be various media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RAM, a magnetic disk, or an optical disk.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some interfaces, indirect coupling or communication connection between devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a readable storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned readable storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various media capable of storing program codes.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the foregoing description of the multi-service cascade connection starting method, apparatus and computer-readable storage medium provided by the present application, for those skilled in the art, there may be variations in the specific implementation manners and application ranges according to the ideas of the embodiments of the present application, and in summary, the contents of the present specification should not be construed as limiting the present application.

Claims (9)

1. A multi-service cascade starting method, comprising:
performing primary judgment on whether the docker service has a first startup self-starting script or not;
when the first startup self-starting script exists in the docker service, performing secondary judgment on whether a second startup self-starting script exists in the docker container or not;
when the second startup self-starting script exists in the docker container, calling a cascading service starting script of the docker container through a preset startup self-starting script of a host machine;
acquiring association relations among all application services;
performing cascade grouping on the application service according to the incidence relation;
the application services of different groups are led into different docker containers;
determining the cascade relation among different docker containers according to the cascade relation among the groups;
determining the sequence of the different docker containers for executing the cascade service starting script to start the application service according to the cascade relation among the different docker containers;
controlling the cascade starting of the corresponding application service in the docker container according to the cascade service starting script; and the cascade service starting script is designed with an application service starting sequence.
2. The multi-service cascade starting method according to claim 1, wherein after the step of performing a first-level judgment on whether the first boot self-starting script exists in the docker service, the method further comprises:
when the first startup self-starting script does not exist in the docker service, setting a first startup self-starting script file in the docker service;
and controlling the socket service to be started and started automatically according to the first starting and starting script file.
3. The method for starting up a multi-service cascade according to claim 1, wherein after the step of performing the secondary determination on whether the second boot self-boot script exists in the docker container, the method further comprises:
when the second startup self-starting script does not exist in the docker container, setting a second startup self-starting script file in the docker container;
and controlling the docker container to be started and started automatically according to the second starting and starting script file.
4. The multi-service cascading startup method according to claim 1, wherein before the step of calling the cascading service startup script of the docker container by the preset startup self-startup script, the method further comprises:
acquiring the cascading service starting script edited according to the starting sequence of the application service;
and importing the cascading service starting script into the docker container.
5. The method for initiating a multi-service cascade according to claim 1, wherein after the step of controlling the initiation of the corresponding cascade of application services in the docker container according to the cascade service initiation script, the method further comprises:
restarting the host machine after all the application services are successfully cascaded and started;
controlling the application service cascade starting in the docker container according to the cascade service starting script;
and if all the application services are successfully cascaded and started, determining that the cascade service starting script is successfully set.
6. The method of claim 5, wherein the step of restarting the host is followed by:
when the corresponding cascade starting failure of the application service exists, detecting whether a code defect exists in a script file of the application service corresponding to the cascade starting failure of the cascade service starting script;
if the script file has a code defect, repairing the script file according to the code defect;
and executing the step of restarting the host machine again based on the repaired cascading service starting script.
7. A multi-service cascade start-up apparatus, comprising:
the first judging module is used for carrying out primary judgment on whether the docker service has a first startup self-starting script or not;
the second judging module is used for judging whether a second startup self-starting script exists in the docker container or not when the first startup self-starting script exists in the docker service;
the calling module is used for executing the cascading service starting script of the docker container through a preset starting self-starting script when the docker container has the second starting self-starting script;
the acquisition module is used for acquiring the incidence relation among all the application services;
the grouping module is used for carrying out cascade grouping on the application service according to the incidence relation;
the import module is used for importing the application services of different groups into different docker containers;
the determining module is used for determining the cascade relation among different docker containers according to the cascade relation among the groups; determining the sequence of different docker containers for executing the cascade service starting script to start the application service according to the cascade relation among the different docker containers;
the control module is used for controlling the cascade starting of the corresponding application service in the docker container according to the cascade service starting script; and an application service starting sequence is designed in the cascading service starting script.
8. An electronic device, comprising: the system comprises a memory, a processor and a bus, and is characterized in that the bus is used for realizing the connection and communication between the memory and the processor; the processor is configured to execute a computer program stored on the memory, and when the processor executes the computer program, the processor implements the steps of the method of any one of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202111601057.3A 2021-12-24 2021-12-24 Multi-service cascade starting method and device and computer readable storage medium Active CN114416196B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111601057.3A CN114416196B (en) 2021-12-24 2021-12-24 Multi-service cascade starting method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111601057.3A CN114416196B (en) 2021-12-24 2021-12-24 Multi-service cascade starting method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114416196A CN114416196A (en) 2022-04-29
CN114416196B true CN114416196B (en) 2023-03-03

Family

ID=81268552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111601057.3A Active CN114416196B (en) 2021-12-24 2021-12-24 Multi-service cascade starting method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114416196B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915239A (en) * 2015-06-30 2015-09-16 北京奇虎科技有限公司 Method and device for carrying out multi-process startup by container
CN109408062A (en) * 2018-11-01 2019-03-01 郑州云海信息技术有限公司 A kind of method and apparatus of automatic deployment model training environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865840B (en) * 2019-11-18 2023-11-03 义乌中国小商品城大数据有限公司 Application management method, device, server and storage medium
CN113342464A (en) * 2021-06-19 2021-09-03 南威软件股份有限公司 Application construction deployment method based on container service

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915239A (en) * 2015-06-30 2015-09-16 北京奇虎科技有限公司 Method and device for carrying out multi-process startup by container
CN109408062A (en) * 2018-11-01 2019-03-01 郑州云海信息技术有限公司 A kind of method and apparatus of automatic deployment model training environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
docker入门--服务自启动设置;nlp狗子;《https://zhuanlan.zhihu.com/p/383382470?utm_id=0》;20210623;全文 *

Also Published As

Publication number Publication date
CN114416196A (en) 2022-04-29

Similar Documents

Publication Publication Date Title
CN112948157B (en) Server fault positioning method, device and system and computer readable storage medium
CN100492305C (en) Fast restoration method of computer system and apparatus
US20220214945A1 (en) System Booting Method and Apparatus, Node Device, and Computer-Readable Storage Medium
CN105653405B (en) A kind of fault handling method and system of Generic Bootstrap
CN105786462A (en) Boot method
CN101989220A (en) Pressure testing method
CN113805925A (en) Online upgrading method, device, equipment and medium for distributed cluster management software
CN108897646B (en) Switching method of BIOS (basic input output System) chips and substrate management controller
CN113315675B (en) White box switch U-Boot automatic testing method, system and storage medium
CN114416196B (en) Multi-service cascade starting method and device and computer readable storage medium
CN111090537B (en) Cluster starting method and device, electronic equipment and readable storage medium
CN112711575A (en) Deployment method, system and related device of database cluster
CN105426304A (en) Control method and device of restart test
CN102541585A (en) Remote upgrade method and embedded system
KR102023164B1 (en) Method for monitoring os task of twin micom in rtos
CN109614279B (en) Industrial personal computer self-checking system and control method thereof and related equipment
CN114860292A (en) Terminal equipment firmware upgrading control method and device, computer equipment and medium
CN110609765B (en) Method, system, equipment and storage medium for automatically and randomly restarting server
CN113515291A (en) Equipment online upgrading method and device
TWI554876B (en) Method for processing node replacement and server system using the same
CN112328297A (en) Method and device for upgrading Android system running compatibly on Linux
CN111581014B (en) Method and device for restarting automatic control host and related equipment
CN108170247A (en) BMC power loss recovery method and apparatus
CN116126969A (en) Restarting method and device of distributed database, storage medium and electronic equipment
CN115562803A (en) Automatic recovery method, device, equipment and storage medium for mirror image file

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