WO2019242162A1 - Middleware installation method and apparatus, and computer device and storage medium - Google Patents

Middleware installation method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2019242162A1
WO2019242162A1 PCT/CN2018/109442 CN2018109442W WO2019242162A1 WO 2019242162 A1 WO2019242162 A1 WO 2019242162A1 CN 2018109442 W CN2018109442 W CN 2018109442W WO 2019242162 A1 WO2019242162 A1 WO 2019242162A1
Authority
WO
WIPO (PCT)
Prior art keywords
middleware
server
installation
target
environment
Prior art date
Application number
PCT/CN2018/109442
Other languages
French (fr)
Chinese (zh)
Inventor
黄桂钦
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019242162A1 publication Critical patent/WO2019242162A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method, a device, a computer device, and a storage medium for installing middleware.
  • middleware installations on servers rely on manual participation. For example, operation and maintenance personnel install the corresponding middleware one by one on each newly added server.
  • middleware software Although some companies have already implemented the function of installing middleware software, they only stay in the simple installation of middleware software, and there are many limitations, such as some steps that require manual intervention, such as the inability to customize the configuration of middleware and Installation, etc.
  • the embodiments of the present application provide a method, device, computer equipment, and storage medium for installing middleware, which can achieve customized configuration and installation of middleware.
  • an embodiment of the present application provides a middleware installation method.
  • the method includes:
  • the related information of the server includes environment information where the server is located, configuration information of the server, and IP address of the server;
  • the target middleware is installed in the server according to the set port number and the IP address of the server.
  • an embodiment of the present application provides a middleware installation device, which includes a unit corresponding to the middleware installation method described in the first aspect.
  • an embodiment of the present application provides a computer device, where the computer device includes a memory and a processor connected to the memory;
  • the memory is configured to store a computer program
  • the processor is configured to run the computer program stored in the memory to perform the middleware installation method according to the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program, where the computer program includes program instructions, and the program instructions are implemented by a processor to implement the foregoing.
  • the middleware installation method according to the first aspect.
  • the target middleware matching the server related information is determined from the pre-stored middleware related information by acquiring the related information of the server to be installed with the middleware. If the user accepts the target middleware, the target middleware is Installed into the server.
  • This embodiment can simplify the installation process and achieve customized configuration and installation of middleware.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a middleware installation method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a middleware installation and configuration interface according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a sub-process of a middleware installation method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a middleware installation progress provided by an embodiment of the present application.
  • FIG. 6 is another schematic flowchart of a middleware installation method according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a middleware installation device according to an embodiment of the present application.
  • FIG. 8 is a schematic block diagram of an installation unit according to an embodiment of the present application.
  • FIG. 9 is a schematic block diagram of an adding unit according to an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the middleware mentioned in the embodiments of the present application is a large category of basic software, which belongs to the category of reusable software, and is located between the operating system software and user application software. This middleware is above the operating system, network, and database, and the lower layer of application software.
  • the overall role is to provide an environment for running and developing the application software on its own upper layer, helping users to flexibly and efficiently develop and integrate complex application software.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • the application scenario shown in FIG. 1 includes a middleware automatic installation platform (corresponding to a web terminal, and the automatic installation platform exists in a terminal such as a desktop computer) and a server.
  • the operating system of the server may be a liunx operating system, an OS operating system, or a widows operating system.
  • the middleware automation installation platform according to the needs of the enterprise, related information of different middleware is added, and related information of different middleware is used as pre-stored middleware related information.
  • different middleware includes different versions of middleware. It can be understood that there are multiple different middlewares, and there may be multiple different versions in each middleware.
  • the relevant information of the server on which the middleware is to be installed includes the environment information of the server, the server configuration information, and the server IP Address and other information.
  • the related information of the server to which the middleware is installed already exists, the related information of the server is directly obtained.
  • a matching target middleware is determined from the pre-stored middleware related information for recommendation. Determine whether the user accepts the recommended target middleware. If the user does not accept the recommended target middleware, the user selects the middleware selected by the user, and uses the middleware selected by the user as the target middleware.
  • the target middleware is installed into the server with one click according to the server's IP address and the set port number.
  • an installation exception occurs, an error message will be fed back to the user, and the progress of the installation will be displayed to the user to facilitate the user's understanding of the installation process.
  • This solution determines a matching target middleware from the pre-stored middleware related information according to the related information of the server, and installs the target middleware into the server with one click, which simplifies the installation process and matches the middle according to the server's related information.
  • the installation version of the software can achieve the customized configuration and installation of the middleware.
  • FIG. 2 is a schematic flowchart of a middleware installation method according to an embodiment of the present application. The method includes the following steps S201-S207.
  • the server-related information includes the environment information where the server is located, the server's configuration information, and the server's IP address.
  • the environment information where the server is located includes the network environment, application environment, and application scenarios.
  • the application environment includes a test environment, a development environment, a production environment (connecting to an external system), and a test environment, a development environment, and cluster information of a server corresponding to the production environment.
  • the network environment includes the network architecture, the status of requests, and the amount of concurrency.
  • Application scenarios include https encrypted transmission, proxy forwarding, etc., which vary depending on the functions implemented by different servers.
  • the configuration information of the server includes the operating system of the server and the version of the operating system. Among them, the operating system includes a widows operating system, a liunx operating system, an OS operating system, and the like.
  • step S201 includes: judging whether a server requiring the installation of the middleware already exists; if there is a server requiring the installation of the middleware, obtaining the relevant information of the server; if not, You need to install the middleware server, and add information about the server. Whether the server already exists may be determined according to the IP address of the server. If the server's IP address is entered in the input box, if the input is detected (such as the cursor is not in the input box or the total number of characters entered reaches the number of characters corresponding to the IP address), determine whether it has been The server exists.
  • one or more servers need to be installed with the middleware, and correspondingly, obtain related information of one or more servers.
  • the middleware is installed on one or more different servers at the same time. That is, the middleware is installed in batches on the server. In this way, it is not necessary to install the middleware on each server that needs to be installed, which greatly saves time, labor costs, and corresponding workload, and improves the efficiency of installing middleware.
  • the related information of the middleware includes information about the middleware installation software, the application environment, the application scenario, and the operating system that match the middleware installation software.
  • the middleware installation software includes a middleware installation package, a configuration file, a middleware monitoring package, and the like.
  • the middleware monitoring package is used to monitor the middleware, such as monitoring the running status of the middleware, such as detecting whether the middleware is available, whether the amount of downloading the middleware has increased abnormally, or the middleware is abnormal due to malicious attacks by hackers Etc .
  • the configuration file includes the version corresponding to the middleware, environmental resources, and parameter configuration after tuning.
  • the environmental resource refers to some environmental resources required by the operating system before installing the corresponding middleware, such as some function libraries required by the operating system.
  • the environmental resources can allow the middleware to work normally on the operating system after installation. run.
  • the environment resources corresponding to nginx middleware include GCC (GNU Compiler Collection) compiler, C ++, pcre library, zlib library, OpenSSL library, etc.
  • determining the first type of middleware that matches the operating system information from the pre-stored middleware related information includes: according to the operating system information in the server configuration information, Determine whether the operating systems of the obtained one or more servers are the same operating system; if they are not the same operating system, delete the servers corresponding to the different operating systems so that the remaining servers have the same operating system; if they are the same operation
  • the system selects the first type of middleware that matches the operating system from the pre-stored middleware related information. It can be understood that if there is only one server to install middleware, directly select and install the middleware matching the server operating system from the pre-stored middleware related information. If there are multiple servers corresponding to the middleware installation, there are many The operating systems of the two servers need to be the same to install the same middleware in batches.
  • the target middleware is the middleware that matches both the server's operating system information and the server's environment information.
  • step S203 includes: searching for middleware matching the environment information of the server from the first type of middleware according to the environment information of the server; and determining whether there are many middleware matching the environment information of the server. If there is more than one, choose a middleware from the multiple according to preset rules, and use it as the target middleware that matches the environment information of the server for recommendation; if there is one, use that one middleware as the server Target middleware matching environment information for recommendation. If there are multiple middlewares that match the environment information of the server, it can be understood that there are multiple different versions of the middleware that match the environment information of the server, and the multiple different versions are all related to the environment of the server. Information matches.
  • selecting one middleware from multiple middlewares according to preset rules includes: selecting one middleware from multiple middlewares according to the principle of highest version; or selecting one from multiple middlewares according to the principle of highest installation rate Middleware; or randomly select one middleware from multiple middlewares according to the random principle; or randomly select one middleware from multiple middlewares based on the combination of version and installation rate; or display multiple middlewares and receive users from multiple Choose one middleware from each middleware; or select one middleware from multiple middleware according to other suitable principles. Use the selected middleware as the target middleware that matches the environment information of the server.
  • the recommended target middleware is displayed in a web interface (such as an installation configuration interface) of the middleware automated installation platform, and specifically, as an input box or selection corresponding to a middleware field displayed in the installation configuration interface Box. If it is detected that the user edits or deletes the data in the input box or the selection box, it is determined that the user does not accept the recommended target middleware; otherwise, it is determined that the user accepts the recommended target middleware. Editing can be understood as adding, deleting, or modifying data in the input box or selection box. If the cursor is placed in the input box or selection box without causing any other operation, then Treated as not being edited.
  • a web interface such as an installation configuration interface
  • S205 If the user does not accept the recommended target middleware, receive the middleware selected by the user, and use the middleware selected by the user as the target middleware.
  • receiving the middleware selected by the user and using the middleware selected by the user as the target middleware includes receiving the middleware input by the user in the input box corresponding to the middleware field, and using the middleware input by the user as the target middleware Or display the middleware matching the server related information in the selection box corresponding to the middleware field for the user to select, receive the middleware selected by the user in the selection box corresponding to the middleware field, and copy the middleware selected by the user As the target middleware.
  • the port number refers to the port in the TCP / IP protocol, and the port number ranges from 0 to 65535, such as port 80 for browsing web services, port 21 for FTP services, and so on.
  • a terminal with an IP address can provide many network services, such as Web services, FTP services, SMTP services, and so on. These services can be implemented by one IP address, and the relationship between IP addresses and network services is a one-to-many relationship, so in fact, different services are distinguished by "IP address + port number".
  • the step of setting the port number on which the target middleware is used to provide services includes: determining whether an identifier using a different port number is received; If an identifier using a different port number is received, an interface for setting multiple port numbers is called; through the interface, the port numbers for providing services on multiple servers are respectively set; if the identifier using a different port number is not received, setting The port number used by multiple servers to provide services is the same port number.
  • the setting is called An interface with multiple port numbers.
  • This interface can be represented by multiple input boxes. The data entered in multiple input boxes corresponds to multiple servers one by one. Through this interface, set the port numbers of the target middleware users to provide services on multiple servers. Under normal circumstances, the same port number is used by default. It can be understood that the servers installed with the same target middleware are most likely located in the same cluster. The servers in the same cluster use the target middleware to provide the port number of the server. The same port number.
  • buttons such as “One-click installation” and “Install” are displayed in the interface
  • an installation instruction is received.
  • the target middleware is installed in the server according to the set port number and the IP address of the server. This embodiment selects the middleware matching the server according to the relevant information of the server, and realizes the customized configuration and installation of the middleware.
  • each server corresponds to multiple different accounts, and different accounts correspond to different permissions.
  • the account administrator, user1, user2, and so on correspond to different permissions.
  • the method further includes: setting up an account for the server to install the target middleware. If the installation instruction is received, installing the target middleware into the server according to the set port number and the IP address of the server includes: if the installation instruction is received, installing the target middleware according to the set port number and the IP address of the server The files are installed under the account in the server.
  • setting an account for which the server needs to install the target middleware includes: determining whether an identifier using a different account is received; if receiving an identifier using a different account, calling an interface for setting a different account; and through the interface, Set up the accounts corresponding to multiple servers that need to install the target middleware respectively; if the IDs using different accounts are not received, set the accounts corresponding to multiple servers that need to install the target middleware to be the same account or use the default Account.
  • the related button of “Use different account” is displayed on the web interface (such as installation and configuration interface) of the middleware automated installation platform, if it is detected that the user clicks the button, and it is determined that a different account ID is received, then call to set up a different account
  • the interface can be represented by multiple input boxes, and the data entered in multiple input boxes corresponds to multiple servers one-to-one. Through this interface, accounts corresponding to multiple servers that need to install the target middleware are respectively set. In most cases, the default account is used, for example, the default account is administrator. It should be noted that the account mentioned in this embodiment may include an account name and password to indicate that the account is entered into the server through the account name and password to install the target middleware under the account. In some cases, if no password is set, the password is considered to be empty.
  • FIG. 3 is a schematic diagram of a middleware installation and configuration interface according to an embodiment of the present application.
  • the installation configuration interface there are information such as the IP address field of the corresponding server, the recommended middleware field, the port number field, and the "One-click installation" button.
  • the text box corresponding to the IP address field of the server there are two IP address information, 10.20.123.98, 10.20.123.99.
  • FIG. 3 is merely an example. It should be noted that all the information shown in Figure 3 will be saved to the configuration file.
  • the host name information of the server may be added in FIG. 3 to facilitate the memorization; other related information of the server may also be added, such as the environment information of the server, the configuration information of the server, etc., so as to facilitate users to understand the server.
  • Related information to further confirm the server on which the target middleware needs to be installed may also be added.
  • the middleware administrator can be understood as the owner of the target middleware, that is, the creator; the middleware contact can be understood as a worker who is authorized to operate the target middleware, and there can be multiple middleware contacts.
  • the account information of the target middleware to be installed corresponding to the server may also be added to install the target middleware to the account in the server according to the account information.
  • installing the target middleware into the server includes the following steps S401-S404.
  • S401 Initialize the installation environment of the target middleware, and perform parameter verification on the installation environment of the target middleware.
  • the installation environment of the initialization target middleware includes the account name and password of the initialization server, the environment resources of the installation target middleware, and the configuration items in the initialization configuration file.
  • the account name and password of the initialization server can be understood as that there may be multiple accounts on one server, and the installation and use of the corresponding target middleware are specific permissions of one of the accounts.
  • initializing the account name and password of the server includes: obtaining a pre-configured account name and password; finding the pre-configured account name and password in the server; if the preset configured account name and password are found, entering based on the account name and password Server.
  • the default account name and password are used. For example, the default account name is administrator and the password is 123.
  • the pre-configured account name and password may be a plurality of different account names and passwords preset on a web interface (such as an installation configuration interface) of the middleware automated installation platform, or may use a default account name and password.
  • the corresponding environment resources in the initialization configuration file can be understood as: before installing each software, the operating system must have certain functions and environments, such as library functions required by the target middleware to run. Initialize the environment resources of the installation target middleware, including: the commands required to obtain the environment resources for initialization, if it is a liunx system, the commands required are liunx commands; according to the required commands, the preset environment resources are installed To the server, including system file libraries and system packages involved in environmental resources.
  • the configuration items in the initialization configuration file are initialized according to the configuration items in the configuration file.
  • the parameter verification of the installation environment of the target middleware includes detecting whether the port numbers conflict, such as whether the port numbers are occupied, detecting whether the system version meets the requirements, and allocating system resources for the installation of the target middleware.
  • detecting whether the system version meets the requirements can be understood as that some target middleware versions require the server operating system, and some software versions are based on higher operating system versions, such as redhat7 and centos7.
  • Allocating system resources for the installation of the target middleware can be understood as the installation of any target middleware needs to occupy the system resources of the relevant server, such as CPU, memory, IO, etc., such as how much memory is occupied and the number of CPU cores used How much wait.
  • allocating system resources for the installation of the target middleware includes: obtaining the minimum resource allocation data and the best resource allocation data preset by the target middleware; determining whether the remaining resource data of the server is greater than the minimum resource allocation data; if not If it is greater than the minimum resource allocation data, a prompt is issued to indicate that server resources are insufficient, which means that the allocation of system resources for the installation of the target middleware is unsuccessful; if it is greater than the minimum resource allocation data, determine whether it is greater than the optimal resource allocation data; if it is greater than the optimal resource allocation data, The resource allocation data allocates the corresponding resources in the optimal resource allocation data to the target middleware; if it is not greater than the optimal resource allocation data, the corresponding resources in the lowest resource allocation data are allocated to the target middleware.
  • the above-mentioned contents involved in initializing the installation environment of the target middleware and performing parameter verification on the installation environment of the target middleware are just enumerations. In other embodiments, other contents may also be involved.
  • the above-mentioned initialization environment of the target middleware installation environment and parameter verification of the target middleware installation environment does not limit the specific execution order. The specific execution order can be determined according to actual needs.
  • the installation information includes the installation completion time, server-related information, target middleware, the set port number of the target middleware used to provide services, and server resources occupied by the target middleware corresponding to the version.
  • the installation information further includes information such as a set account, a middleware administrator, and a middleware contact.
  • the configuration files mentioned here include the configuration files in the server (upload the target middleware installation software to the server, because the target middleware installation software includes configuration files, so the server involves configuration files), It also includes the configuration files included in the installation information table in the middleware automated installation platform. When the installation is complete, the content of the configuration file included in the installation information table is consistent with the content of the configuration file in the server.
  • the above steps S401-S404 are the processes of installing the target middleware on the server. In this way, the middleware is automatically installed, which simplifies the middleware installation process.
  • FIG. 5 it is a schematic diagram of the progress of the target middleware installation. It includes four steps: record information, initialize, upload target middleware installation software, install target middleware (execute script), and synchronize configuration files.
  • the record information refers to the information set in the installation configuration interface, initialization,
  • the four steps of uploading the target middleware installation software, installing the target middleware (execute the script), and synchronizing the configuration file correspond to steps S401-S404. Displayed after the recorded information: execution is completed; displayed after initialization: executed; displayed after uploading target middleware to install software, install target middleware (execute script), and synchronous configuration file: waiting for execution.
  • the "in progress” may also include the progress of the step execution, such as data such as 50% of execution; it may also display the specific execution content according to the actual execution situation, such as "in execution", can be replaced with " Detect if ports are conflicting "and other data.
  • only specific steps in progress may be displayed on the interface, and other steps are not displayed.
  • the installation information is saved in the installation information table on the middleware automated installation platform.
  • the installed target middleware and related installation information can be queried on the middleware automated installation platform.
  • the installation information obtained from the query is shown in Table 1.
  • Table 1 there are data items such as target middleware, server information, server IP, port number, installation status, and cluster / configuration.
  • the first line of information includes: nginx-1.12.1, server environment information, 10.20.123.98, 6633, modification, successful installation, cluster information, and configuration file.
  • the underlined text in Table 1 indicates that you can view or edit related information after clicking.
  • the information obtained by the query also includes information such as the installation time, which is not shown in Table 1.
  • the installation information may also include other content, such as middleware administrators, middleware contacts, and so on.
  • the method before step S202, further includes: adding related information of the middleware.
  • adding related information of the middleware includes the following steps S601-S605.
  • S601 under the same operating system and under the environmental resources corresponding to the middleware, perform pressure tests on different versions of the middleware under different parameter configurations and different application environments, where different parameter configurations correspond to different application scenarios.
  • S602 According to the stress test results corresponding to different parameter configurations, different application environments, and different versions of the middleware and the server's demand information, select a middleware with a better / optimal stress test result, and according to the server's demand information, The parameters corresponding to the middleware are adjusted to obtain the optimized parameter configuration.
  • the requirement information of the server includes the environment information where the server is located, that is, the application environment, application scenario, and network environment. Understandably, according to the different parameter configurations corresponding to the middleware and the stress test results in different application environments, the parameter matching that is most suitable for the environmental information of the server is selected to obtain the optimized parameter configuration and the corresponding middleware. The optimized parameter configuration and the corresponding middleware are saved.
  • the better stress test result can be understood as the stress test result corresponding to the preset number of the top ranking from the highest to the lowest test result, as the better stress test result. If there is only one stress test result, the stress test result is selected as the comparative stress test result.
  • the middleware corresponding to the better stress test results is stable and has good performance. Among them, the stress test results include: under the same amount of concurrency, the forwarding capabilities corresponding to different versions of middleware, and server resources consumed.
  • the SSL module in the nginx middleware parameters needs to be turned on; when the application scenario is to use nginx as static and involves uploading and downloading of a large number of files, Turn on the file compression function of nginx middleware parameters. If the application scenario involves proxy forwarding, turn on the proxy forwarding function of nginx middleware parameters. If the server's application scenarios include https encrypted transmission, proxy forwarding, etc., then turn on the SSL module parameters and proxy forwarding parameters in the nginx middleware.
  • the middleware is pressure tested under different parameter configurations and different application scenarios, and then the parameters are adjusted according to the stress test results and server demand information to obtain the optimized parameter configuration, so that the middleware To meet the needs of enterprises, it has reached the customized configuration of middleware and the optimized configuration of middleware performance.
  • steps S601-S605 are performed to complete the addition and storage of related information of different middleware corresponding to multiple operating systems, and the related information of the saved middleware is used as the pre-stored related information of the middleware.
  • the middleware related information stored in the middleware automated installation platform is the middleware related information that is screened to meet the needs of the enterprise after the stress test.
  • the related information of the middleware has reached the customized configuration of the middleware and the performance optimization configuration of the middleware. Then, according to the middleware that achieves the customized configuration and performance optimization configuration, the middleware that matches the current server related information is selected for installation, and the customized installation of the middleware is achieved.
  • FIG. 7 is a schematic block diagram of a middleware installation device according to an embodiment of the present application.
  • the device is applied in a middleware automatic installation platform.
  • the device 70 includes an obtaining unit 701, a system matching unit 702, an environment matching unit 703, a judging unit 704, a receiving unit 705, a port setting unit 706, and an installation unit 707.
  • the obtaining unit 701 is configured to obtain related information of a server on which middleware needs to be installed.
  • the server-related information includes the environment information where the server is located, the server's configuration information, and the server's IP address.
  • the obtaining unit 701 includes: a presence judgment unit, a server obtaining unit, and a server adding unit.
  • a judging unit for judging whether there is a server that needs to install middleware. For example, if the server's IP address is entered in the input box, if the input is detected (such as the cursor is not in the input box or the total number of characters entered Reaching the number of characters corresponding to the IP address), determining whether the server already exists according to the IP address of the server.
  • the server acquiring unit is configured to acquire the related information of the server if there is a server requiring middleware installation.
  • the server adding unit is used to add server-related information if there is no server requiring middleware installation. Among them, one or more servers need to be installed with the middleware, and correspondingly, obtain related information of one or more servers.
  • the system matching unit 702 is configured to determine, according to the operating system information in the server configuration information, the first type of middleware that matches the operating system information from the pre-stored middleware related information.
  • the system matching unit 702 includes: an operating system judgment unit, a deletion unit, and a system selection matching unit.
  • the operating system determining unit is configured to determine whether the acquired operating systems of one or more servers are the same operating system according to the operating system information in the server configuration information.
  • the deleting unit is configured to delete servers corresponding to different operating systems if the acquired operating systems of the one or more servers are not the same operating system, so that the remaining servers have the same operating system.
  • the system selection matching unit is used to select the first type of middleware that matches the operating system from the pre-stored middleware related information if the operating systems of one or more servers are the same operating system.
  • the environment matching unit 703 is configured to determine a target middleware matching the environment information of the server from the first type of middleware according to the environment information of the server for recommendation.
  • the environment matching unit 703 includes a matching search unit, a matching judgment unit, and an environment selection matching unit.
  • the matching search unit is configured to find the middleware matching the environment information of the server from the first type of middleware according to the environment information of the server.
  • the matching judging unit is configured to judge whether there are multiple middlewares that match the environment information of the server.
  • the environment selection matching unit is used to recommend a middleware from a plurality of middlewares according to preset rules if there are multiple middlewares that match the environment information of the server, and it is recommended as a target middleware that matches the environment information of the server. .
  • the environment selection matching unit is also used for recommending if there is one middleware matching the environment information of the server, and using the one middleware as the target middleware matching the environment information of the server.
  • the determining unit 704 is configured to determine whether the user accepts the recommended target middleware.
  • the receiving unit 705 is configured to receive the middleware selected by the user if the user does not accept the recommended target middleware, and use the middleware selected by the user as the target middleware.
  • the port setting unit 706 is configured to set the port number of the target middleware on the server for providing services if the user accepts the recommended target middleware or the user does not accept the recommended target middleware.
  • the port setting unit 706 includes a port identification judging unit, a port interface calling unit, and a port number setting unit.
  • the port identification judging unit is configured to determine whether an identification using a different port number is received.
  • the port interface calling unit is configured to call an interface that sets multiple port numbers if an identifier using a different port number is received.
  • a port number setting unit configured to respectively set port numbers for providing services on multiple servers through the interface; and to set ports used for providing services by multiple servers if no identification using different port numbers is received Number is the same port number.
  • the installation unit 707 is configured to install the target middleware into the server according to the set port number and the IP address of the server if an installation instruction is received.
  • the middleware installation device further includes: an account setting unit, which is used to set an account for the server to install the target middleware.
  • the installation unit is further configured to install the target middleware to the account in the server according to the set port number and the IP address of the server if an installation instruction is received.
  • the account setting unit includes: an account identification judging unit, an account interface calling unit, and an installation account setting unit.
  • the account identification judging unit is configured to determine whether an identification using a different account is received.
  • the account interface calling unit is configured to call an interface for setting different accounts if an identification using a different account is received.
  • An installation account setting unit configured to respectively set the accounts corresponding to multiple servers that need to install the target middleware through the interface; and if the identifiers using different accounts are not received, set the corresponding installation needs of multiple servers
  • the account of the target middleware is the same account or a default account is used.
  • the installation unit 707 includes: an initialization unit 801, an upload unit 802, a middleware installation unit 803, and a synchronization unit 804.
  • the initialization unit 801 is configured to initialize an installation environment of a target middleware, and perform parameter verification on the installation environment of the target middleware.
  • the initialization unit 801 includes: an account initialization unit for initializing the account name and password of the server; an environment resource initialization unit for initializing the environment resources of the installation target middleware; a configuration item initialization unit for initializing the configuration items in the configuration file; A port number detection unit is used to detect whether there is a conflict in the port numbers such as whether the port number is occupied; a system version detection unit is used to detect whether the system version meets the requirements; a resource allocation unit is used to allocate a system for the installation of the target middleware Resources, etc.
  • the account initialization unit includes an account acquisition unit, an account search unit, and an account entry unit.
  • the account obtaining unit is configured to obtain a pre-configured account name and password.
  • the account search unit is configured to search the server for the pre-configured account name and password.
  • the account entry unit is used to enter the server according to the account name and password if the preset account name and password are found.
  • the environment resource initialization unit includes a command acquisition unit and an environment resource installation unit.
  • the command obtaining unit is used to obtain a command required for initializing an environment resource. If it is a liunx system, the command required is a liunx command.
  • An environment resource installation unit is configured to install a preset environment resource into a server according to a command required, such as including a system file library and a system package involved.
  • the resource allocation unit includes an allocation data acquisition unit, a resource judgment unit, a prompt unit, an optimal resource allocation unit, and a minimum resource allocation unit.
  • the allocation data obtaining unit is configured to obtain the minimum resource allocation data and the best resource allocation data preset by the target middleware.
  • the resource determining unit is configured to determine whether the remaining resource data of the server is greater than the minimum resource allocation data.
  • a prompting unit is configured to issue a prompt if the remaining resource data of the server is not greater than the minimum resource allocation data to indicate that the server resource is insufficient.
  • the resource determination unit is further configured to determine whether the remaining resource data of the server is greater than the optimal resource allocation data if the remaining resource data of the server is greater than the minimum resource allocation data.
  • the optimal resource allocation unit is used for the remaining resource data of the server is greater than the optimal resource allocation data, and the target middleware is allocated the corresponding resource in the optimal resource allocation data.
  • the minimum resource allocation unit is configured to allocate the corresponding resources in the minimum resource allocation data to the target middleware if the remaining resource data of the server is greater than the minimum resource allocation data and is not greater than the optimal resource allocation data.
  • the uploading unit 802 is configured to upload the target middleware installation software to the server if the installation environment of the target middleware is successfully initialized and the parameters of the target middleware installation environment are checked.
  • the middleware installation unit 803 is configured to install the target middleware installation package in the target middleware installation software in the server. Specifically, the target middleware installation package is parsed to generate a target middleware installation package script; and the target middleware installation package script is executed.
  • a synchronization unit 804 is configured to synchronize the installation information to a configuration file corresponding to the target middleware.
  • the middleware installation device further includes an adding unit. This adding unit is used to add information about middleware.
  • the adding unit 90 includes: a stress testing unit 901, a version parameter tuning unit 902, a configuration writing unit 903, a middleware storage unit 904, and an information storage unit 905.
  • a stress test unit 901 is used to perform stress tests on different versions of middleware under different parameter configurations and different application environments under the same operating system and environmental resources corresponding to the middleware. Among them, different parameter configurations correspond to different application scenarios. .
  • the version parameter tuning unit 902 is configured to select a middleware with a better / optimal stress test result according to the stress test results and server requirement information corresponding to different parameter configurations, different application environments, and different versions of the middleware.
  • the requirement information of the server adjusts the parameters corresponding to the middleware to obtain the optimized parameter configuration.
  • the requirement information of the server includes environment information where the server is located, that is, an application environment, an application scenario, and a network environment.
  • a configuration writing unit 903 is configured to write the optimized parameter configuration into a configuration file corresponding to the corresponding version of the middleware.
  • the middleware storage unit 904 is configured to save the configuration file, the middleware installation package of the corresponding version, and the middleware monitoring package as the corresponding middleware installation software.
  • An information saving unit 905 is configured to save information such as an application environment, an application scenario, and an operating system corresponding to the middleware installation software and the middleware installation software into relevant information of the middleware to complete all operations under the operating system. Add and save related information about middleware.
  • the above stress test unit 901, version parameter tuning unit 902, configuration writing unit 903, middleware storage unit 904, and information storage unit 905 can complete the addition and storage of related information of different middleware under multiple operating systems. .
  • the above apparatus may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in FIG. 10.
  • FIG. 10 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the device 100 includes a processor 102, a memory, and a network interface 103 connected through a system bus 101.
  • the memory may include a non-volatile storage medium 104 and an internal memory 105.
  • the non-volatile storage medium 104 can store an operating system 1041 and a computer program 1042. When the computer program 1042 is executed, it can cause the processor 102 to execute a middleware installation method.
  • the processor 102 is used to provide computing and control capabilities to support the operation of the entire device 100.
  • the internal memory 105 provides an environment for running a computer program in a non-volatile storage medium. When the computer program is executed by the processor 102, the processor 102 can cause the processor 102 to execute a middleware installation method.
  • the network interface 103 is used for network communication, such as receiving messages.
  • FIG. 10 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the device 100 to which the solution of the present application is applied.
  • the specific device 100 may Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
  • the processor 102 is configured to run a computer program stored in a memory to implement any embodiment of the foregoing middleware installation method.
  • the processor 102 may be a central processing unit (CPU), and the processor may also be another general-purpose processor or a digital signal processor (DSP). , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • a computer-readable storage medium stores a computer program.
  • the computer program includes program instructions. When the program instructions are executed by a processor, In order to implement any embodiment of the foregoing middleware installation method.
  • the storage medium includes a computer-readable storage medium, and the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • the computer-readable storage medium may be an internal storage unit of the terminal in any of the foregoing embodiments, such as a hard disk or a memory of the terminal.
  • the computer storage medium may also be an external storage device, such as a plug-in hard disk equipped on a terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, and the like.
  • the computer-readable storage medium may further include both an internal storage unit of the terminal and an external storage device.

Landscapes

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

Abstract

A middleware installation method and apparatus, and a computer device and a storage medium. The method comprises: acquiring related information of a server with middleware needing to be installed thereon (S201); according to operating system information in configuration information of the server, determining, from pre-stored related information of the middleware, first-type middleware matching the operating system information (S202); according to information of an environment where the server is located, determining, from the first-type middleware matching an operating system, a piece of target middleware matching the information of the environment where the server is located (S203); setting a port number, for providing services on the server, of the target middleware (S206); and if an installation instruction is received, installing the target middleware on the server according to the set port number and the IP address of the server (S207).

Description

中间件安装方法、装置、计算机设备及存储介质Middleware installation method, device, computer equipment and storage medium
本申请要求于2018年6月22日提交中国专利局、申请号为201810650549.3、发明名称为“中间件安装方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority from a Chinese patent application filed with the Chinese Patent Office on June 22, 2018, with application number 201810650549.3, and the invention name is "Middleware Installation Method, Device, Computer Equipment, and Storage Medium", the entire contents of which are incorporated by reference Incorporated in this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种中间件安装方法、装置、计算机设备及存储介质。The present application relates to the field of computer technology, and in particular, to a method, a device, a computer device, and a storage medium for installing middleware.
背景技术Background technique
当企业新增服务器时,一般需要在服务器上安装一些中间件,以使服务器可以运行应用程序,以发挥服务器的功能。目前服务器上的中间件安装很多都依赖手工参与,如运维人员在每个新增服务器上一个一个的安装对应的中间件。虽然有些企业已经做到安装中间件软件的功能,但是都是只停留在对中间件软件的简单安装,存在很多局限性,如有些步骤需要人工干预、如无法做到中间件的定制化配置和安装等。When an enterprise adds a new server, it is generally necessary to install some middleware on the server so that the server can run applications to play the server's functions. Currently, many middleware installations on servers rely on manual participation. For example, operation and maintenance personnel install the corresponding middleware one by one on each newly added server. Although some companies have already implemented the function of installing middleware software, they only stay in the simple installation of middleware software, and there are many limitations, such as some steps that require manual intervention, such as the inability to customize the configuration of middleware and Installation, etc.
发明内容Summary of the Invention
本申请实施例提供一种中间件安装方法、装置、计算机设备及存储介质,可以达到中间件的定制化配置和安装。The embodiments of the present application provide a method, device, computer equipment, and storage medium for installing middleware, which can achieve customized configuration and installation of middleware.
第一方面,本申请实施例提供了一种中间件安装方法,该方法包括:In a first aspect, an embodiment of the present application provides a middleware installation method. The method includes:
获取需安装中间件的服务器的相关信息。其中,所述服务器的相关信息包括所述服务器所处的环境信息、所述服务器的配置信息、所述服务器的IP地址;Get information about the server on which you want to install middleware. The related information of the server includes environment information where the server is located, configuration information of the server, and IP address of the server;
根据所述配置信息中的操作系统信息,从预存的中间件相关信息中确定与所述操作系统信息匹配的第一类中间件;Determining, according to the operating system information in the configuration information, first-type middleware that matches the operating system information from pre-stored middleware-related information;
根据所述服务器所处的环境信息,从所述第一类中间件中确定一个与所述服务器所处环境信息匹配的目标中间件以进行推荐;Determining, from the first type of middleware, a target middleware that matches the environment information where the server is located for recommendation according to the environment information where the server is located;
判断用户是否接受推荐的所述目标中间件;Determining whether the user accepts the recommended target middleware;
若用户接受推荐的所述目标中间件,设置所述目标中间件在所述服务器上 用于提供服务的端口号;If the user accepts the recommended target middleware, setting a port number of the target middleware on the server for providing services;
若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中。If an installation instruction is received, the target middleware is installed in the server according to the set port number and the IP address of the server.
第二方面,本申请实施例提供了一种中间件安装装置,该装置包括用于执行上述第一方面所述的中间件安装方法对应的单元。In a second aspect, an embodiment of the present application provides a middleware installation device, which includes a unit corresponding to the middleware installation method described in the first aspect.
第三方面,本申请实施例提供了一种计算机设备,所述计算机设备包括存储器,以及与所述存储器相连的处理器;In a third aspect, an embodiment of the present application provides a computer device, where the computer device includes a memory and a processor connected to the memory;
所述存储器用于存储计算机程序,所述处理器用于运行所述存储器中存储的计算机程序,以执行上述第一方面所述的中间件安装方法。The memory is configured to store a computer program, and the processor is configured to run the computer program stored in the memory to perform the middleware installation method according to the first aspect.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时,实现上述第一方面所述的中间件安装方法。According to a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, where the computer program includes program instructions, and the program instructions are implemented by a processor to implement the foregoing. The middleware installation method according to the first aspect.
本申请实施例通过获取需安装中间件的服务器的相关信息,从预存的中间件相关信息中确定与服务器相关信息匹配的目标中间件,若用户接受所述目标中间件,将所述目标中间件安装到所述服务器中。该实施例可以简化安装流程,达到中间件的定制化配置和安装。In the embodiment of the present application, the target middleware matching the server related information is determined from the pre-stored middleware related information by acquiring the related information of the server to be installed with the middleware. If the user accepts the target middleware, the target middleware is Installed into the server. This embodiment can simplify the installation process and achieve customized configuration and installation of middleware.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请实施例提供的一个应用场景示意图;FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application; FIG.
图2是本申请实施例提供的一种中间件安装方法的流程示意图;2 is a schematic flowchart of a middleware installation method according to an embodiment of the present application;
图3是本申请实施例提供的中间件安装配置界面的示意图;3 is a schematic diagram of a middleware installation and configuration interface according to an embodiment of the present application;
图4是本申请实施例提供的一种中间件安装方法的一子流程示意图;FIG. 4 is a schematic diagram of a sub-process of a middleware installation method according to an embodiment of the present application; FIG.
图5是本申请实施例提供的中间件安装进度的示意图;5 is a schematic diagram of a middleware installation progress provided by an embodiment of the present application;
图6是本申请实施例提供的一种中间件安装方法的另一子流程示意图;FIG. 6 is another schematic flowchart of a middleware installation method according to an embodiment of the present application; FIG.
图7是本申请实施例提供的一种中间件安装装置的示意性框图;FIG. 7 is a schematic block diagram of a middleware installation device according to an embodiment of the present application; FIG.
图8是本申请实施例提供的安装单元的示意性框图;FIG. 8 is a schematic block diagram of an installation unit according to an embodiment of the present application; FIG.
图9是本申请实施例提供的添加单元的示意性框图;FIG. 9 is a schematic block diagram of an adding unit according to an embodiment of the present application; FIG.
图10是本申请实施例提供的一种计算机设备的示意性框图。FIG. 10 is a schematic block diagram of a computer device according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部 的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In the following, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
在本申请实施例中提到的中间件(middleware)是基础软件的一大类,属于可复用软件的范畴,处于操作系统软件与用户的应用软件的中间。该中间件在操作系统、网络和数据库之上,应用软件的下层,总的作用是为处于自己上层的应用软件提供运行与开发的环境,帮助用户灵活、高效地开发和集成复杂的应用软件。The middleware mentioned in the embodiments of the present application is a large category of basic software, which belongs to the category of reusable software, and is located between the operating system software and user application software. This middleware is above the operating system, network, and database, and the lower layer of application software. The overall role is to provide an environment for running and developing the application software on its own upper layer, helping users to flexibly and efficiently develop and integrate complex application software.
图1是本申请实施例提供的一个应用场景示意图。在图1所示的应用场景中,分别包括中间件自动化安装平台(对应有web端,自动化安装平台存在于台式电脑等终端中)和服务器。其中,服务器的操作系统可以是liunx操作系统,也可以是OS操作系统,还可以是widows操作系统。在中间件自动化安装平台中,会根据企业的需求,添加不同中间件的相关信息,将不同中间件的相关信息作为预存的中间件相关信息。其中,不同中间件包括不同款不同版本的中间件。可理解为有多款不同中间件,每款中间件中可能会存在多个不同的版本。在中间件自动化安装平台中添加了中间件的相关信息后,再添加需安装中间件的服务器的相关信息,其中,服务器的相关信息包括服务器所处的环境信息、服务器的配置信息、服务器的IP地址等信息。在其他实施例中,若需安装中间件的服务器的相关信息已经存在,则直接获取该服务器的相关信息。根据服务器所处的环境信息和服务器的配置信息,从预存的中间件相关信息中确定一个匹配的目标中间件以进行推荐。判断用户是否接受推荐的目标中间件,若用户不接受推荐的目标中间件,接收用户选择的中间件,将用户所选择的中间件作为目标中间件。设置目标中间件在服务器上用于提供服务的端口号。最后若接收到安装指令,根据服务器的IP地址和设置的端口号,将目标中间件一键安装到服务器中。在一键安装的过程中,若出现安装异常等,会将报错信息反馈给用户,同时还会向用户展示安装的进度,以方便用户了解安装的进程。该方案根据服务器的相关信息从预存的中间件相关信息中确定一个匹配的目标中间件,并将该目标中间件一键安装到服务器中,简化了安装流程,同时根据服务器的相关信息来匹配中间件的安装版本,可以达到中间件的定制化配置和安装。FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. The application scenario shown in FIG. 1 includes a middleware automatic installation platform (corresponding to a web terminal, and the automatic installation platform exists in a terminal such as a desktop computer) and a server. The operating system of the server may be a liunx operating system, an OS operating system, or a widows operating system. In the middleware automation installation platform, according to the needs of the enterprise, related information of different middleware is added, and related information of different middleware is used as pre-stored middleware related information. Among them, different middleware includes different versions of middleware. It can be understood that there are multiple different middlewares, and there may be multiple different versions in each middleware. After adding the relevant information of the middleware to the middleware automation installation platform, add the relevant information of the server on which the middleware is to be installed, where the relevant information of the server includes the environment information of the server, the server configuration information, and the server IP Address and other information. In other embodiments, if the related information of the server to which the middleware is installed already exists, the related information of the server is directly obtained. According to the environment information of the server and the configuration information of the server, a matching target middleware is determined from the pre-stored middleware related information for recommendation. Determine whether the user accepts the recommended target middleware. If the user does not accept the recommended target middleware, the user selects the middleware selected by the user, and uses the middleware selected by the user as the target middleware. Sets the port number that the target middleware uses to provide services on the server. Finally, if an installation instruction is received, the target middleware is installed into the server with one click according to the server's IP address and the set port number. During the one-click installation, if an installation exception occurs, an error message will be fed back to the user, and the progress of the installation will be displayed to the user to facilitate the user's understanding of the installation process. This solution determines a matching target middleware from the pre-stored middleware related information according to the related information of the server, and installs the target middleware into the server with one click, which simplifies the installation process and matches the middle according to the server's related information. The installation version of the software can achieve the customized configuration and installation of the middleware.
以下本申请提供的方法实施例运行于中间件自动化安装平台中。The following method embodiments provided in this application run in a middleware automated installation platform.
图2是本申请实施例提供的一种中间件安装方法的流程示意图。该方法包括以下步骤S201-S207。FIG. 2 is a schematic flowchart of a middleware installation method according to an embodiment of the present application. The method includes the following steps S201-S207.
S201,获取需安装中间件的服务器的相关信息。其中,服务器的相关信息 包括服务器所处的环境信息、服务器的配置信息、服务器的IP地址。S201. Acquire information about a server on which middleware needs to be installed. The server-related information includes the environment information where the server is located, the server's configuration information, and the server's IP address.
其中,服务器所处的环境信息包括网络环境、应用环境、应用场景。其中,应用环境包括测试环境、开发环境、生产环境(对接外部系统)以及测试环境、开发环境、生产环境所对应的服务器所在集群信息等。网络环境包括网络架构、请求的情况、并发量等。应用场景包括https加密传输、代理转发等,根据不同服务器实现功能的不同而不同。服务器的配置信息包括服务器的操作系统以及操作系统的版本等。其中,操作系统包括widows操作系统、liunx操作系统、OS操作系统等。The environment information where the server is located includes the network environment, application environment, and application scenarios. The application environment includes a test environment, a development environment, a production environment (connecting to an external system), and a test environment, a development environment, and cluster information of a server corresponding to the production environment. The network environment includes the network architecture, the status of requests, and the amount of concurrency. Application scenarios include https encrypted transmission, proxy forwarding, etc., which vary depending on the functions implemented by different servers. The configuration information of the server includes the operating system of the server and the version of the operating system. Among them, the operating system includes a widows operating system, a liunx operating system, an OS operating system, and the like.
具体地,获取需安装中间件的服务器的相关信息,即步骤S201包括:判断是否已存在需安装中间件的服务器;若存在需安装中间件的服务器,获取所述服务器的相关信息;若不存在需安装中间件的服务器,添加服务器的相关信息。可根据服务器的IP地址来确定是否已存在所述服务器。如在输入框中输入服务器的IP地址,若检测到输入完毕(如输入的光标不在该输入框或者输入的总字符数达到IP地址所对应的字符数),根据服务器的IP地址来确定是否已存在所述服务器。其中,需安装中间件的服务器可以是一个,也可以是多个,那么对应的,获取一个或者多个服务器的相关信息。可以理解为,在一个或者多个不同的服务器上同时安装该中间件。即批量安装中间件到服务器上,如此,不必一个一个的安装中间件到每个需要安装中间件的服务器上,大大节省了时间、人力成本以及对应的工作量,提高了安装中间件的效率。Specifically, obtaining relevant information of the server to be installed with the middleware, that is, step S201 includes: judging whether a server requiring the installation of the middleware already exists; if there is a server requiring the installation of the middleware, obtaining the relevant information of the server; if not, You need to install the middleware server, and add information about the server. Whether the server already exists may be determined according to the IP address of the server. If the server's IP address is entered in the input box, if the input is detected (such as the cursor is not in the input box or the total number of characters entered reaches the number of characters corresponding to the IP address), determine whether it has been The server exists. Among them, one or more servers need to be installed with the middleware, and correspondingly, obtain related information of one or more servers. It can be understood that the middleware is installed on one or more different servers at the same time. That is, the middleware is installed in batches on the server. In this way, it is not necessary to install the middleware on each server that needs to be installed, which greatly saves time, labor costs, and corresponding workload, and improves the efficiency of installing middleware.
S202,根据服务器配置信息中的操作系统信息,从预存的中间件相关信息中确定与操作系统信息匹配的第一类中间件。S202. According to the operating system information in the server configuration information, determine the first type of middleware that matches the operating system information from the pre-stored middleware related information.
其中,中间件的相关信息包括中间件安装软件、与中间件安装软件匹配的应用环境、应用场景、操作系统等信息。其中,中间件安装软件包括中间件安装包、配置文件、中间件监控包等。其中,中间件监控包用于监控该中间件,如监控该中间件的运行状态,比如检测中间件是否可用,请求下载该中间件的量是否异常增大,或被黑客恶意攻击导致中间件异常等;配置文件中包括该中间件对应的版本、环境资源、调优后的参数配置等。其中,环境资源指的是在安装对应中间件之前,需要操作系统具备的一些环境资源,比如需要操作系统具备的一些函数库等,该环境资源可以让该中间件安装后可以在操作系统上正常运行。比如nginx中间件所对应的环境资源,包括GCC(GNU Compiler Collection)编译器、C++、pcre库、zlib库、OpenSSL库等。The related information of the middleware includes information about the middleware installation software, the application environment, the application scenario, and the operating system that match the middleware installation software. Among them, the middleware installation software includes a middleware installation package, a configuration file, a middleware monitoring package, and the like. Among them, the middleware monitoring package is used to monitor the middleware, such as monitoring the running status of the middleware, such as detecting whether the middleware is available, whether the amount of downloading the middleware has increased abnormally, or the middleware is abnormal due to malicious attacks by hackers Etc .; the configuration file includes the version corresponding to the middleware, environmental resources, and parameter configuration after tuning. Among them, the environmental resource refers to some environmental resources required by the operating system before installing the corresponding middleware, such as some function libraries required by the operating system. The environmental resources can allow the middleware to work normally on the operating system after installation. run. For example, the environment resources corresponding to nginx middleware include GCC (GNU Compiler Collection) compiler, C ++, pcre library, zlib library, OpenSSL library, etc.
具体地,根据服务器配置信息中的操作系统信息,从预存的中间件相关信 息中确定与操作系统信息匹配的第一类中间件,即步骤S202,包括:根据服务器配置信息中的操作系统信息,判断获取的一个或多个服务器的操作系统是否为同一操作系统;若不为同一操作系统,删除不相同的操作系统所对应的服务器,以使剩余的服务器具有同一操作系统;若为同一个操作系统,则从预存的中间件相关信息中选择与操作系统匹配的第一类中间件。可以理解为,若需安装中间件的服务器只有一个,则直接从预存的中间件相关信息中选择并安装与服务器操作系统匹配的中间件,若需安装中间件对应的服务器有多个,那么多个服务器的操作系统需要相同,才可以批量安装同一款中间件。Specifically, according to the operating system information in the server configuration information, determining the first type of middleware that matches the operating system information from the pre-stored middleware related information, that is, step S202, includes: according to the operating system information in the server configuration information, Determine whether the operating systems of the obtained one or more servers are the same operating system; if they are not the same operating system, delete the servers corresponding to the different operating systems so that the remaining servers have the same operating system; if they are the same operation The system selects the first type of middleware that matches the operating system from the pre-stored middleware related information. It can be understood that if there is only one server to install middleware, directly select and install the middleware matching the server operating system from the pre-stored middleware related information. If there are multiple servers corresponding to the middleware installation, there are many The operating systems of the two servers need to be the same to install the same middleware in batches.
S203,根据服务器所处的环境信息,从第一类中间件中确定一个与服务器所处环境信息匹配的目标中间件以进行推荐。S203. According to the environment information of the server, determine a target middleware from the first type of middleware that matches the environment information of the server for recommendation.
目标中间件是既与服务器的操作系统信息匹配,同时又与服务器所处环境信息匹配的中间件。The target middleware is the middleware that matches both the server's operating system information and the server's environment information.
具体地,步骤S203,包括:根据服务器所处的环境信息,从第一类中间件中查找出与服务器所处环境信息匹配的中间件;判断与服务器所处环境信息匹配的中间件是否有多个;若有多个,按照预设规则从多个中选择一个中间件,作为与服务器所处环境信息匹配的目标中间件以进行推荐;若有一个中间件,将该一个中间件作为与服务器所处环境信息匹配的目标中间件以进行推荐。其中,若与服务器所处环境信息匹配的中间件有多个,可以理解为,与服务器所处环境信息匹配的中间件有多个不同的版本,该多个不同的版本都与服务器所处环境信息匹配。其中,按照预设规则从多个中间件中选择一个中间件,包括:按照版本最高的原则从多个中间件中选择一个中间件;或者按照安装率最高的原则从多个中间件中选择一个中间件;或者按照随机原则从多个中间件中随机选择一个中间件;或者按照版本、安装率结合的原则从个中间件中随机选择一个中间件;或者显示多个中间件,接收用户从多个中间件中选择的一个中间件;或者按照其他合适的原则从多个中间件中选择一个中间件。将所选择的中间件作为与服务器所处环境信息匹配的目标中间件。Specifically, step S203 includes: searching for middleware matching the environment information of the server from the first type of middleware according to the environment information of the server; and determining whether there are many middleware matching the environment information of the server. If there is more than one, choose a middleware from the multiple according to preset rules, and use it as the target middleware that matches the environment information of the server for recommendation; if there is one, use that one middleware as the server Target middleware matching environment information for recommendation. If there are multiple middlewares that match the environment information of the server, it can be understood that there are multiple different versions of the middleware that match the environment information of the server, and the multiple different versions are all related to the environment of the server. Information matches. Among them, selecting one middleware from multiple middlewares according to preset rules includes: selecting one middleware from multiple middlewares according to the principle of highest version; or selecting one from multiple middlewares according to the principle of highest installation rate Middleware; or randomly select one middleware from multiple middlewares according to the random principle; or randomly select one middleware from multiple middlewares based on the combination of version and installation rate; or display multiple middlewares and receive users from multiple Choose one middleware from each middleware; or select one middleware from multiple middleware according to other suitable principles. Use the selected middleware as the target middleware that matches the environment information of the server.
S204,判断用户是否接受推荐的目标中间件。S204. Determine whether the user accepts the recommended target middleware.
在本实施例中,推荐的目标中间件显示在中间件自动化安装平台的web界面(如安装配置界面)中,具体地,如显示在安装配置界面中的中间件字段所对应的输入框或者选择框中。若检测到用户对所述输入框或者选择框中的数据进行编辑如进行删除,则确定用户不接受推荐的目标中间件;否则,确定用户接受推荐的目标中间件。其中,进行编辑可以理解为,对所述输入框或者选择 框中的数据进行增加或者删除或修改,如若仅将光标放入所述输入框或者选择框中,而没有引起其他任何的操作,则视为没有进行编辑。In this embodiment, the recommended target middleware is displayed in a web interface (such as an installation configuration interface) of the middleware automated installation platform, and specifically, as an input box or selection corresponding to a middleware field displayed in the installation configuration interface Box. If it is detected that the user edits or deletes the data in the input box or the selection box, it is determined that the user does not accept the recommended target middleware; otherwise, it is determined that the user accepts the recommended target middleware. Editing can be understood as adding, deleting, or modifying data in the input box or selection box. If the cursor is placed in the input box or selection box without causing any other operation, then Treated as not being edited.
S205,若用户不接受推荐的目标中间件,接收用户选择的中间件,将用户选择的中间件作为目标中间件。S205: If the user does not accept the recommended target middleware, receive the middleware selected by the user, and use the middleware selected by the user as the target middleware.
其中,接收用户选择的中间件,将用户选择的中间件作为目标中间件,包括:接收用户在中间件字段所对应的输入框中输入的中间件,将用户所输入的中间件作为目标中间件;或者在中间件字段所对应的选择框中显示与服务器相关信息匹配的中间件以供用户选择,接收用户在中间件字段所对应的选择框中选择的中间件,将用户所选择的中间件作为目标中间件。Wherein, receiving the middleware selected by the user and using the middleware selected by the user as the target middleware includes receiving the middleware input by the user in the input box corresponding to the middleware field, and using the middleware input by the user as the target middleware Or display the middleware matching the server related information in the selection box corresponding to the middleware field for the user to select, receive the middleware selected by the user in the selection box corresponding to the middleware field, and copy the middleware selected by the user As the target middleware.
S206,设置目标中间件在服务器上用于提供服务的端口号。S206. Set the port number of the target middleware on the server for providing services.
若用户接受推荐的目标中间件,或者用户不接受推荐的目标中间件,接收用户选择的目标中间件后,设置目标中间件在服务器上用于提供服务的端口号。端口号指的是TCP/IP协议中的端口,端口号的范围从0到65535,比如用于浏览网页服务的80端口,用于FTP服务的21端口等等。一台拥有IP地址的终端可以提供许多网络服务,比如Web服务、FTP服务、SMTP服务等。这些服务可以通过1个IP地址来实现,而IP地址与网络服务的关系是一对多的关系,因此实际上是通过“IP地址+端口号”来区分不同的服务的。If the user accepts the recommended target middleware, or the user does not accept the recommended target middleware, after receiving the target middleware selected by the user, set the port number of the target middleware for providing services on the server. The port number refers to the port in the TCP / IP protocol, and the port number ranges from 0 to 65535, such as port 80 for browsing web services, port 21 for FTP services, and so on. A terminal with an IP address can provide many network services, such as Web services, FTP services, SMTP services, and so on. These services can be implemented by one IP address, and the relationship between IP addresses and network services is a one-to-many relationship, so in fact, different services are distinguished by "IP address + port number".
若需安装目标中间件的服务器有多个,所述设置所述目标中间件在所述服务器上用于提供服务的端口号,即步骤S206,包括:判断是否接收到使用不同端口号的标识;若接收到使用不同端口号的标识,调用设置多个端口号的接口;通过所述接口,分别设置多个服务器上用于提供服务的端口号;若未接收到使用不同端口号的标识,设置多个服务器用于提供服务的端口号为同一端口号。如在中间件自动化安装平台的web界面(如安装配置界面)上显示“使用不同端口号”的相关按钮,若检测到用户点击了该按钮,确定接收到使用不同端口号的标识,则调用设置多个端口号的接口,该接口可以通过多个输入框来表示,多个输入框中输入的数据与多个服务器一一对应。通过该接口分别设置该目标中间件在多个服务器上用户提供服务的端口号。一般情况下,默认使用同一端口号,可以理解为,安装同样目标中间件的服务器很大可能是位于同一集群中,在同一集群中的服务器,该目标中间件用于提供服务器的端口号一般使用相同的端口号。If there are multiple servers on which the target middleware needs to be installed, the step of setting the port number on which the target middleware is used to provide services, that is, step S206, includes: determining whether an identifier using a different port number is received; If an identifier using a different port number is received, an interface for setting multiple port numbers is called; through the interface, the port numbers for providing services on multiple servers are respectively set; if the identifier using a different port number is not received, setting The port number used by multiple servers to provide services is the same port number. For example, if the related button of “Use a different port number” is displayed on the web interface of the middleware automation installation platform (such as the installation and configuration interface), if it is detected that the user clicks the button, and it is determined that a different port number is received, the setting is called An interface with multiple port numbers. This interface can be represented by multiple input boxes. The data entered in multiple input boxes corresponds to multiple servers one by one. Through this interface, set the port numbers of the target middleware users to provide services on multiple servers. Under normal circumstances, the same port number is used by default. It can be understood that the servers installed with the same target middleware are most likely located in the same cluster. The servers in the same cluster use the target middleware to provide the port number of the server. The same port number.
S207,若接收到安装指令,根据设置的端口号和服务器的IP地址,将目标中间件安装到服务器中。S207. If the installation instruction is received, install the target middleware into the server according to the set port number and the IP address of the server.
如在界面中显示“一键安装”、“安装”等相关按钮,若检测到用户点击了“一键安装”、“安装”等相关按钮,则接收到安装指令。若接收到安装指令,根据设置的端口号和服务器的IP地址,将目标中间件安装到服务器中。该实施例根据服务器的相关信息选择与服务器匹配的中间件,实现了中间件的定制化配置和安装。For example, if related buttons such as "One-click installation" and "Install" are displayed in the interface, if it is detected that the user clicks the related buttons such as "One-click installation" or "Install", an installation instruction is received. If an installation instruction is received, the target middleware is installed in the server according to the set port number and the IP address of the server. This embodiment selects the middleware matching the server according to the relevant information of the server, and realizes the customized configuration and installation of the middleware.
在一实施例中,若需安装目标中间件的服务器有多个,每个服务器中对应有多个不同的账户,不同的账户对应不同的权限。如账户administrator、user1、user2等分别对应不同的权限。那么,在接收到安装指令之前,所述方法还包括:设置所述服务器需安装所述目标中间件的账户。所述若接收到安装指令,根据设置的端口号和服务器的IP地址,将目标中间件安装到服务器中,包括:若接收到安装指令,根据设置的端口号和服务器的IP地址,将目标中间件安装到服务器中的所述账户下。In one embodiment, if there are multiple servers that need to install the target middleware, each server corresponds to multiple different accounts, and different accounts correspond to different permissions. For example, the account administrator, user1, user2, and so on correspond to different permissions. Then, before receiving the installation instruction, the method further includes: setting up an account for the server to install the target middleware. If the installation instruction is received, installing the target middleware into the server according to the set port number and the IP address of the server includes: if the installation instruction is received, installing the target middleware according to the set port number and the IP address of the server The files are installed under the account in the server.
具体地,设置所述服务器需安装所述目标中间件的账户,包括:判断是否接收到使用不同账户的标识;若接收到使用不同账户的标识,调用设置不同账户的接口;通过所述接口,分别设置多个服务器所对应的需安装所述目标中间件的账户;若未接收到使用不同账户的标识,设置多个服务器所对应的需安装所述目标中间件的账户为同一账户或者使用默认的账户。如在中间件自动化安装平台的web界面(如安装配置界面)上显示“使用不同账户”的相关按钮,若检测到用户点击了该按钮,确定接收到使用不同账户的标识,则调用设置不同账户的接口,该接口可以通过多个输入框来表示,多个输入框中输入的数据与多个服务器一一对应。通过该接口分别设置多个服务器所对应的需安装所述目标中间件的账户。多数情况下,使用默认的账户,如默认的账户是administrator。需要注意的是,该实施例中提到的账户可以包括账户名和密码,以表示通过该账户名和密码进入服务器中,以将目标中间件安装在该账户下。有些情况下,没有设置密码,那么认为密码为空。Specifically, setting an account for which the server needs to install the target middleware includes: determining whether an identifier using a different account is received; if receiving an identifier using a different account, calling an interface for setting a different account; and through the interface, Set up the accounts corresponding to multiple servers that need to install the target middleware respectively; if the IDs using different accounts are not received, set the accounts corresponding to multiple servers that need to install the target middleware to be the same account or use the default Account. For example, if the related button of “Use different account” is displayed on the web interface (such as installation and configuration interface) of the middleware automated installation platform, if it is detected that the user clicks the button, and it is determined that a different account ID is received, then call to set up a different account The interface can be represented by multiple input boxes, and the data entered in multiple input boxes corresponds to multiple servers one-to-one. Through this interface, accounts corresponding to multiple servers that need to install the target middleware are respectively set. In most cases, the default account is used, for example, the default account is administrator. It should be noted that the account mentioned in this embodiment may include an account name and password to indicate that the account is entered into the server through the account name and password to install the target middleware under the account. In some cases, if no password is set, the password is considered to be empty.
图3是本申请实施例提供的中间件安装配置界面的示意图。在该安装配置界面上,有对应的服务器的IP地址字段、推荐的中间件字段、端口号字段、以及“一键安装”按钮等信息。在服务器的IP地址字段对应的文本框中显示有两个IP地址信息,10.20.123.98、10.20.123.99。在推荐的中间件字段对应的下拉框中有一个推荐的目标中间件:nginx-1.12.1。其中,nginx为目标中间件名称,1.12.1为目标中间件对应的版本。在服务器的IP地址字段对应的文本框中、推荐的中间件字段对应的下拉框中,都对应有“x”号。点击该“x”号,可以将 对应的项删除,如将nginx-1.12.1目标中间件删除。将nginx-1.12.1目标中间件删除,意味着用户不接受推荐的目标中间件。将nginx-1.12.1目标中间件删除后,可以点击下拉框选择对应的中间件,将选择的中间件作为目标中间件。在端口号字段对应的文本框中,可以输入端口号,如端口号6633。在端口号的下方,有一个单选按钮,该单选按钮指示:使用不同端口号。若检测到点击该“使用不同端口号”的单选按钮,那么接收到使用不同端口号的标识。设置完成后,点击“一键安装”按钮,将会在两个IP地址信息对应的服务器上一键安装中间件字段对应的目标中间件,且设置服务器提供服务的端口号为6633。需要说明的是,图3仅仅是示例。需要注意的是,图3中的显示的所有信息都会保存到配置文件中。FIG. 3 is a schematic diagram of a middleware installation and configuration interface according to an embodiment of the present application. On the installation configuration interface, there are information such as the IP address field of the corresponding server, the recommended middleware field, the port number field, and the "One-click installation" button. In the text box corresponding to the IP address field of the server, there are two IP address information, 10.20.123.98, 10.20.123.99. There is a recommended target middleware in the drop-down box corresponding to the recommended middleware field: nginx-1.12.1. Among them, nginx is the target middleware name and 1.12.1 is the version corresponding to the target middleware. In the text box corresponding to the server's IP address field and the drop-down box corresponding to the recommended middleware field, there are corresponding "x" numbers. Click the “x” to delete the corresponding item, such as deleting the nginx-1.12.1 target middleware. Deleting the nginx-1.12.1 target middleware means that the user does not accept the recommended target middleware. After deleting the nginx-1.12.1 target middleware, you can click the drop-down box to select the corresponding middleware, and use the selected middleware as the target middleware. In the text box corresponding to the port number field, you can enter a port number, such as port number 6633. Below the port number, there is a radio button that indicates: use a different port number. If it is detected that the "Use a different port number" radio button is clicked, then an identification using a different port number is received. After the setting is completed, click the "One-click installation" button, and the target middleware corresponding to the middleware field will be installed on the two servers corresponding to the IP address information by one click, and the port number provided by the server is 6633. It should be noted that FIG. 3 is merely an example. It should be noted that all the information shown in Figure 3 will be saved to the configuration file.
在其他实施例中,图3中还可以加入服务器的主机名称信息,以方便记忆;还可以加入服务器的其他相关信息,如服务器所处的环境信息、服务器的配置信息等,以方便用户了解服务器的相关信息,以进一步确认需安装目标中间件的服务器。在其他实施例中,还可以加入中间件管理员、中间件联系人等信息。该中间件管理员可以理解为该目标中间件的所有人,即创建人;中间件联系人可以理解为有权对该目标中间件进行操作的工作人员,中间件联系人可以多个。在其他实施例中,还可以加入服务器所对应需安装目标中间件的账户信息,以根据该账户信息将目标中间件安装到服务器中的该账户下。In other embodiments, the host name information of the server may be added in FIG. 3 to facilitate the memorization; other related information of the server may also be added, such as the environment information of the server, the configuration information of the server, etc., so as to facilitate users to understand the server. Related information to further confirm the server on which the target middleware needs to be installed. In other embodiments, information such as a middleware administrator and a middleware contact may also be added. The middleware administrator can be understood as the owner of the target middleware, that is, the creator; the middleware contact can be understood as a worker who is authorized to operate the target middleware, and there can be multiple middleware contacts. In other embodiments, the account information of the target middleware to be installed corresponding to the server may also be added to install the target middleware to the account in the server according to the account information.
在一实施例中,如图4所示,将目标中间件安装到服务器中,包括以下步骤S401-S404。In an embodiment, as shown in FIG. 4, installing the target middleware into the server includes the following steps S401-S404.
S401,初始化目标中间件的安装环境,对目标中间件的安装环境进行参数校验。S401: Initialize the installation environment of the target middleware, and perform parameter verification on the installation environment of the target middleware.
其中,初始化目标中间件的安装环境包括初始化服务器的账户名和密码、初始化安装目标中间件的环境资源、初始化配置文件中的配置项等。其中,初始化服务器的账户名和密码,可以理解为,在一个服务器上可能涉及有多个账户,而对应的目标中间件的安装和使用是其中某个账户的特定权限。具体的,初始化服务器的账户名和密码,包括:获取预先配置的账户名和密码;在服务器中查找该预先配置的账户名和密码;若查找到该预设配置的账户名和密码,根据该账户名和密码进入服务器中。多数情况下,使用默认的账户名和密码,如默认账户名为administrator、密码为123等。预先配置的账户名和密码,可以是在中间件自动化安装平台的web界面(如安装配置界面)上预先设置的多个不同的账户名和密码,也可以是使用默认的账户名和密码。初始化配置文件 中对应的环境资源,可以理解为,安装每一个软件之前,需要操作系统具备一定的功能和环境,如目标中间件运行所需要的库函数等。初始化安装目标中间件的环境资源,包括:获取初始化环境资源所需要使用的命令,如若为liunx系统,则所需要使用的命令是liunx命令;根据所需要使用的命令,将预先设置的环境资源安装到服务器中,如包括环境资源所涉及的系统文件库、系统包等。如安装过程中,需要使用一些系统的命令,比如hostname、ping等命令,所以需要在安装之前把相关的系统命令初始化好以及准备好安装该软件需要用到的系统库和lib文件。初始化配置文件中的配置项即为按照配置文件中的配置项进行初始化。The installation environment of the initialization target middleware includes the account name and password of the initialization server, the environment resources of the installation target middleware, and the configuration items in the initialization configuration file. Among them, the account name and password of the initialization server can be understood as that there may be multiple accounts on one server, and the installation and use of the corresponding target middleware are specific permissions of one of the accounts. Specifically, initializing the account name and password of the server includes: obtaining a pre-configured account name and password; finding the pre-configured account name and password in the server; if the preset configured account name and password are found, entering based on the account name and password Server. In most cases, the default account name and password are used. For example, the default account name is administrator and the password is 123. The pre-configured account name and password may be a plurality of different account names and passwords preset on a web interface (such as an installation configuration interface) of the middleware automated installation platform, or may use a default account name and password. The corresponding environment resources in the initialization configuration file can be understood as: before installing each software, the operating system must have certain functions and environments, such as library functions required by the target middleware to run. Initialize the environment resources of the installation target middleware, including: the commands required to obtain the environment resources for initialization, if it is a liunx system, the commands required are liunx commands; according to the required commands, the preset environment resources are installed To the server, including system file libraries and system packages involved in environmental resources. For example, during the installation process, you need to use some system commands, such as hostname, ping and other commands, so you need to initialize the relevant system commands before installation and prepare the system libraries and lib files needed to install the software. The configuration items in the initialization configuration file are initialized according to the configuration items in the configuration file.
对目标中间件的安装环境进行参数校验包括检测端口号是否存在冲突如端口号是否被占用、检测系统版本是否符合要求、为所述目标中间件的安装分配系统资源等。其中,检测系统版本是否符合要求,可以理解为有些目标中间件的版本对服务器的操作系统是有要求的,有些软件的版本基于更高的操作系统版本,如redhat7和centos7等。为所述目标中间件的安装分配系统资源,可以理解为,对于任何目标中间件的安装都需要占用相关的服务器的系统资源,比如CPU,内存,IO等,如占用多少内存、使用CPU核数的多少等。对于每一个目标中间件,有启动目标中间件的最低资源分配数据和最佳资源分配数据,若服务器剩余的资源不足以启动该目标中间件,那就不应该允许该目标中间件在服务器安装。具体的,为所述目标中间件的安装分配系统资源,包括:获取目标中间件预设的最低资源分配数据和最佳资源分配数据;判断服务器剩余的资源数据是否大于最低资源分配数据;若不大于最低资源分配数据,则发出提示,以表示服务器资源不足,意味着为目标中间件的安装分配系统资源不成功;若大于最低资源分配数据,判断是否大于最佳资源分配数据;若大于最佳资源分配数据,则为目标中间件分配最佳资源分配数据中对应的资源;若不大于最佳资源分配数据,则为目标中间件分配最低资源分配数据中对应的资源。需要指出的是,以上提及的初始化目标中间件的安装环境以及对目标中间件的安装环境进行参数校验中涉及的内容只是列举,在其他的实施例中,还可能会涉及其他的内容。同时需要注意的是,以上提及的初始化目标中间件的安装环境以及对目标中间件的安装环境进行参数校验中涉及的内容并不限定具体的执行顺序。具体地执行顺序可按照实际需求来决定。The parameter verification of the installation environment of the target middleware includes detecting whether the port numbers conflict, such as whether the port numbers are occupied, detecting whether the system version meets the requirements, and allocating system resources for the installation of the target middleware. Among them, detecting whether the system version meets the requirements can be understood as that some target middleware versions require the server operating system, and some software versions are based on higher operating system versions, such as redhat7 and centos7. Allocating system resources for the installation of the target middleware can be understood as the installation of any target middleware needs to occupy the system resources of the relevant server, such as CPU, memory, IO, etc., such as how much memory is occupied and the number of CPU cores used How much wait. For each target middleware, there are minimum resource allocation data and optimal resource allocation data for starting the target middleware. If the remaining resources of the server are insufficient to start the target middleware, then the target middleware should not be allowed to be installed on the server. Specifically, allocating system resources for the installation of the target middleware includes: obtaining the minimum resource allocation data and the best resource allocation data preset by the target middleware; determining whether the remaining resource data of the server is greater than the minimum resource allocation data; if not If it is greater than the minimum resource allocation data, a prompt is issued to indicate that server resources are insufficient, which means that the allocation of system resources for the installation of the target middleware is unsuccessful; if it is greater than the minimum resource allocation data, determine whether it is greater than the optimal resource allocation data; if it is greater than the optimal resource allocation data, The resource allocation data allocates the corresponding resources in the optimal resource allocation data to the target middleware; if it is not greater than the optimal resource allocation data, the corresponding resources in the lowest resource allocation data are allocated to the target middleware. It should be noted that the above-mentioned contents involved in initializing the installation environment of the target middleware and performing parameter verification on the installation environment of the target middleware are just enumerations. In other embodiments, other contents may also be involved. At the same time, it should be noted that the above-mentioned initialization environment of the target middleware installation environment and parameter verification of the target middleware installation environment does not limit the specific execution order. The specific execution order can be determined according to actual needs.
S402,若初始化目标中间件的安装环境成功,且通过对目标中间件安装环境的参数检验,上传目标中间件安装软件至服务器中。S402. If the installation environment of the target middleware is successfully initialized, and the parameters of the target middleware installation environment are checked, upload the target middleware installation software to the server.
S403,在服务器中安装目标中间件安装软件中的目标中间件安装包。具体地,解析目标中间件安装包,生成目标中间件安装包脚本;执行所述目标中间件安装包脚本。S403. Install the target middleware installation package in the target middleware installation software in the server. Specifically, the target middleware installation package is parsed to generate a target middleware installation package script; and the target middleware installation package script is executed.
S404,将安装信息同步至目标中间件对应的配置文件中。S404: Synchronize the installation information to a configuration file corresponding to the target middleware.
其中,安装信息包括安装完成时间、服务器的相关信息、目标中间件、设置的目标中间件用于提供服务的端口号、所述版本对应的目标中间件所占用的服务器资源等。在其他实施例中,安装信息还包括设置的账号、中间件管理员、中间件联系人等信息。需要注意的是,这里提到的配置文件包括服务器中的配置文件(将目标中间件安装软件上传到服务器中,因为目标中间件安装软件中包括有配置文件,因此服务器中涉及有配置文件),同时包括中间件自动化安装平台中安装信息表中包括的配置文件。在安装完成时,该安装信息表中包括的配置文件的内容与服务器中的配置文件的内容一致。The installation information includes the installation completion time, server-related information, target middleware, the set port number of the target middleware used to provide services, and server resources occupied by the target middleware corresponding to the version. In other embodiments, the installation information further includes information such as a set account, a middleware administrator, and a middleware contact. It should be noted that the configuration files mentioned here include the configuration files in the server (upload the target middleware installation software to the server, because the target middleware installation software includes configuration files, so the server involves configuration files), It also includes the configuration files included in the installation information table in the middleware automated installation platform. When the installation is complete, the content of the configuration file included in the installation information table is consistent with the content of the configuration file in the server.
以上步骤S401-S404为在服务器上安装目标中间件的过程。如此,自动安装中间件,简化了中间件安装的流程。The above steps S401-S404 are the processes of installing the target middleware on the server. In this way, the middleware is automatically installed, which simplifies the middleware installation process.
在安装目标中间件的过程中,会展示安装的进度,以方便用户了解安装的进程。如图5所示,为目标中间件安装进度的示意图。其中,包括四个步骤:记录信息、初始化、上传目标中间件安装软件、安装目标中间件(执行脚本)、同步配置文件,其中,记录信息指的是记录安装配置界面中设置的信息,初始化、上传目标中间件安装软件、安装目标中间件(执行脚本)、同步配置文件这四个步骤对应步骤S401-S404。在记录信息后面显示:执行完毕;在初始化后面显示:执行中;在上传目标中间件安装软件、安装目标中间件(执行脚本)、同步配置文件后面显示:等待执行。需要指出的是,该安装进度只是为示例。在其他实施例中,在“执行中”,也可以包括步骤执行的进度,如执行50%等数据;也可以根据实际执行情况显示具体执行的内容,如在“执行中”,可以替换成“检测端口是否冲突”等数据。在其他实施例中,在该界面上也可以只显示具体正在执行中的步骤,其他的步骤都不显示。During the installation of the target middleware, the progress of the installation will be displayed to facilitate users to understand the progress of the installation. As shown in Figure 5, it is a schematic diagram of the progress of the target middleware installation. It includes four steps: record information, initialize, upload target middleware installation software, install target middleware (execute script), and synchronize configuration files. The record information refers to the information set in the installation configuration interface, initialization, The four steps of uploading the target middleware installation software, installing the target middleware (execute the script), and synchronizing the configuration file correspond to steps S401-S404. Displayed after the recorded information: execution is completed; displayed after initialization: executed; displayed after uploading target middleware to install software, install target middleware (execute script), and synchronous configuration file: waiting for execution. It should be noted that the installation progress is only an example. In other embodiments, the "in progress" may also include the progress of the step execution, such as data such as 50% of execution; it may also display the specific execution content according to the actual execution situation, such as "in execution", can be replaced with " Detect if ports are conflicting "and other data. In other embodiments, only specific steps in progress may be displayed on the interface, and other steps are not displayed.
在安装目标中间件的过程中,还会捕获异常。当安装的过程中出现任何异常,都会进行提示,以提高用户的体验。During the installation of the target middleware, exceptions are also caught. When any abnormality occurs during the installation, a prompt will be given to improve the user experience.
在目标中间件安装完成后,在中间件自动化安装平台上的安装信息表中会保存安装信息。可在中间件自动化安装平台上查询到安装的目标中间件以及相关的安装信息。如查询得到的安装信息如表1所示。在表1中,有目标中间件、服务器信息、服务器IP、端口号、安装状态、集群/配置等数据项。如第一行信 息分别包括:nginx-1.12.1,服务器所处环境信息,10.20.123.98,6633、修改,安装成功,集群信息、配置文件。其中,在表1中有下划线的文字部分,表示点击之后可以查看相关信息或者对相关信息进行编辑。如,点击“服务器所处环境信息”可以查看服务器所处环境信息,点击“修改”可以修改端口号信息,点击“集群信息”可以查看服务器所属集群,点击“配置文件”可以查看该目标中间件所对应的配置文件以及修改所对应的配置文件中的信息,在配置文件中可以查看到所述版本对应的目标中间件所占用的服务器资源等。在本实施例中,查询得到的信息还包括安装时间等信息,在表1中没有显示。在其他实施例中,安装信息还可以包括其他的内容,如中间件管理员、中间件联系人等。After the target middleware installation is complete, the installation information is saved in the installation information table on the middleware automated installation platform. The installed target middleware and related installation information can be queried on the middleware automated installation platform. For example, the installation information obtained from the query is shown in Table 1. In Table 1, there are data items such as target middleware, server information, server IP, port number, installation status, and cluster / configuration. For example, the first line of information includes: nginx-1.12.1, server environment information, 10.20.123.98, 6633, modification, successful installation, cluster information, and configuration file. Among them, the underlined text in Table 1 indicates that you can view or edit related information after clicking. For example, click "Environment Information of the Server" to view the environment information of the server, click "Modify" to modify the port number information, click "Cluster Information" to view the cluster to which the server belongs, and click "Configuration File" to view the target middleware The corresponding configuration file and the information in the corresponding configuration file are modified, and the server resources occupied by the target middleware corresponding to the version can be viewed in the configuration file. In this embodiment, the information obtained by the query also includes information such as the installation time, which is not shown in Table 1. In other embodiments, the installation information may also include other content, such as middleware administrators, middleware contacts, and so on.
Figure PCTCN2018109442-appb-000001
Figure PCTCN2018109442-appb-000001
表1 查询得到的安装信息Table 1 Installation information obtained by query
在其他实施例中,在步骤S202之前,所述方法还包括:添加中间件的相关信息。如图6所示,添加中间件的相关信息,包括:以下步骤S601-S605。In other embodiments, before step S202, the method further includes: adding related information of the middleware. As shown in FIG. 6, adding related information of the middleware includes the following steps S601-S605.
S601,在同一操作系统下且在中间件对应的环境资源下,在不同参数配置、不同应用环境下对不同版本的中间件进行压力测试,其中,不同参数配置对应不同应用场景。S601, under the same operating system and under the environmental resources corresponding to the middleware, perform pressure tests on different versions of the middleware under different parameter configurations and different application environments, where different parameter configurations correspond to different application scenarios.
S602,根据不同参数配置、不同应用环境、不同版本的中间件所对应的压力测试结果和服务器的需求信息,选择压力测试结果较优/最优的中间件,以及根据服务器的需求信息对所述中间件对应的参数进行调整,以得到调优后的参数配置,其中,服务器的需求信息包括服务器所处的环境信息,即应用环境、应用场景、网络环境。可以理解地,根据中间件对应的不同参数配置、不同应用环境下的压力测试结果,选择最适合服务器所处环境信息的参数搭配,以得到调优后的参数配置和对应的中间件,将该调优后的参数配置和对应的中间件保存。最适合服务器所处环境信息、该调优后的参数配置和对应的中间件可能有一个,也可能有多个。压力测试结果较优可以理解为,压力测试结果从高到低取排名靠前的预设个数所对应的压力测试结果,作为较优的压力测试结果。若压力测试结果只有一个,选取该压力测试结果作为较为的压力测试结果。较 优的压力测试结果所对应的中间件稳定、性能适佳。其中,压力测试结果包括:在同一并发量下,不同版本的中间件对应的转发能力、消耗的服务器资源等。对于参数的调整,如对于nginx中间件,当应用场景涉及到https加密传输时,需要将nginx中间件参数中的SSL模块打开;应用场景是将nginx作为静态,且涉及大量文件的上传下载时,将nginx中间件参数的文件压缩功能打开;若应用场景涉及到代理转发,那么将nginx中间件参数的代理转发功能打开等。若服务器的应用场景包括https加密传输,代理转发等,那么将该nginx中间件中的SSL模块参数、代理转发参数打开。根据在环境资源下,在不同参数配置以及不同应用场景下对该中间件进行压力测试,再根据压力测试结果和服务器的需求信息,调整参数,以得到调优后的参数配置,使得该中间件满足企业的需求,达到了中间件的定制化配置以及中间件的性能最优化配置。S602: According to the stress test results corresponding to different parameter configurations, different application environments, and different versions of the middleware and the server's demand information, select a middleware with a better / optimal stress test result, and according to the server's demand information, The parameters corresponding to the middleware are adjusted to obtain the optimized parameter configuration. The requirement information of the server includes the environment information where the server is located, that is, the application environment, application scenario, and network environment. Understandably, according to the different parameter configurations corresponding to the middleware and the stress test results in different application environments, the parameter matching that is most suitable for the environmental information of the server is selected to obtain the optimized parameter configuration and the corresponding middleware. The optimized parameter configuration and the corresponding middleware are saved. There may be one or more of the most suitable server environment information, the adjusted parameter configuration, and the corresponding middleware. The better stress test result can be understood as the stress test result corresponding to the preset number of the top ranking from the highest to the lowest test result, as the better stress test result. If there is only one stress test result, the stress test result is selected as the comparative stress test result. The middleware corresponding to the better stress test results is stable and has good performance. Among them, the stress test results include: under the same amount of concurrency, the forwarding capabilities corresponding to different versions of middleware, and server resources consumed. For parameter adjustments, such as for nginx middleware, when the application scenario involves https encrypted transmission, the SSL module in the nginx middleware parameters needs to be turned on; when the application scenario is to use nginx as static and involves uploading and downloading of a large number of files, Turn on the file compression function of nginx middleware parameters. If the application scenario involves proxy forwarding, turn on the proxy forwarding function of nginx middleware parameters. If the server's application scenarios include https encrypted transmission, proxy forwarding, etc., then turn on the SSL module parameters and proxy forwarding parameters in the nginx middleware. According to the environment resources, the middleware is pressure tested under different parameter configurations and different application scenarios, and then the parameters are adjusted according to the stress test results and server demand information to obtain the optimized parameter configuration, so that the middleware To meet the needs of enterprises, it has reached the customized configuration of middleware and the optimized configuration of middleware performance.
S603,将调优后的参数配置写入到所述中间件对应版本所对应的配置文件中。S603. Write the optimized parameter configuration into a configuration file corresponding to the corresponding version of the middleware.
S604,将配置文件、对应版本的中间件安装包、中间件监控包保存为对应中间件安装软件。S604. Save the configuration file, the corresponding version of the middleware installation package, and the middleware monitoring package as the corresponding middleware installation software.
S605,将对应所述中间件安装软件,与中间件安装软件匹配的应用环境、应用场景、操作系统等信息保存至中间件的相关信息中以完成在所述操作系统下所述中间件的相关信息的添加和保存。S605. Save the application environment, application scenario, and operating system information corresponding to the middleware installation software and the middleware installation software to the relevant information of the middleware to complete the correlation of the middleware under the operating system. Addition and preservation of information.
执行上述步骤S601-S605,以完成在多个操作系统下所对应的不同中间件的相关信息的添加和保存,将保存后的中间件的相关信息作为预存的中间件的相关信息。The above steps S601-S605 are performed to complete the addition and storage of related information of different middleware corresponding to multiple operating systems, and the related information of the saved middleware is used as the pre-stored related information of the middleware.
可以理解为,在中间件自动化安装平台中保存的中间件相关信息是经过压力测试后,筛选的适合企业需求的中间件相关信息。该中间件相关信息达到了中间件的定制化配置和中间件的性能最优化配置。再根据达到定制化配置和性能最优化配置的中间件中选择出符合当前服务器相关信息的中间件进行安装,达到了中间件的定制化安装。It can be understood that the middleware related information stored in the middleware automated installation platform is the middleware related information that is screened to meet the needs of the enterprise after the stress test. The related information of the middleware has reached the customized configuration of the middleware and the performance optimization configuration of the middleware. Then, according to the middleware that achieves the customized configuration and performance optimization configuration, the middleware that matches the current server related information is selected for installation, and the customized installation of the middleware is achieved.
在后续开发的过程中,若涉及有新的中间件或者新的中间件版本,则将该新的中间件或者新的中间件版本保存至中间件自动化安装平台中的中间件相关信息中,以供后续的安装使用。In the process of subsequent development, if a new middleware or a new middleware version is involved, save the new middleware or new middleware version to the middleware related information in the middleware automated installation platform to For subsequent installations.
图7是本申请实施例提供的一种中间件安装装置的示意性框图。该装置应用于中间件自动化安装平台中。如图7所示,该装置70包括获取单元701、系 统匹配单元702、环境匹配单元703、判断单元704、接收单元705、端口设置单元706、安装单元707。FIG. 7 is a schematic block diagram of a middleware installation device according to an embodiment of the present application. The device is applied in a middleware automatic installation platform. As shown in FIG. 7, the device 70 includes an obtaining unit 701, a system matching unit 702, an environment matching unit 703, a judging unit 704, a receiving unit 705, a port setting unit 706, and an installation unit 707.
获取单元701,用于获取需安装中间件的服务器的相关信息。其中服务器的相关信息包括服务器所处的环境信息、服务器的配置信息、服务器的IP地址。The obtaining unit 701 is configured to obtain related information of a server on which middleware needs to be installed. The server-related information includes the environment information where the server is located, the server's configuration information, and the server's IP address.
具体地,获取单元701,包括:存在判断单元、服务器获取单元、服务器添加单元。其中,存在判断单元,用于判断是否已存在需安装中间件的服务器,如在输入框中输入服务器的IP地址,若检测到输入完毕(如输入的光标不在该输入框或者输入的总字符数达到IP地址所对应的字符数),根据服务器的IP地址来确定是否已存在所述服务器。服务器获取单元,用于若存在需安装中间件的服务器,获取所述服务器的相关信息。服务器添加单元,用于若不存在需安装中间件的服务器,添加服务器的相关信息。其中,需安装中间件的服务器可以是一个,也可以是多个,那么对应的,获取一个或者多个服务器的相关信息。Specifically, the obtaining unit 701 includes: a presence judgment unit, a server obtaining unit, and a server adding unit. Wherein, there is a judging unit for judging whether there is a server that needs to install middleware. For example, if the server's IP address is entered in the input box, if the input is detected (such as the cursor is not in the input box or the total number of characters entered Reaching the number of characters corresponding to the IP address), determining whether the server already exists according to the IP address of the server. The server acquiring unit is configured to acquire the related information of the server if there is a server requiring middleware installation. The server adding unit is used to add server-related information if there is no server requiring middleware installation. Among them, one or more servers need to be installed with the middleware, and correspondingly, obtain related information of one or more servers.
系统匹配单元702,用于根据服务器配置信息中的操作系统信息,从预存的中间件相关信息中确定与操作系统信息匹配的第一类中间件。The system matching unit 702 is configured to determine, according to the operating system information in the server configuration information, the first type of middleware that matches the operating system information from the pre-stored middleware related information.
具体地,系统匹配单元702,包括:操作系统判断单元、删除单元、系统选择匹配单元。其中,操作系统判断单元,用于根据服务器配置信息中的操作系统信息,判断获取的一个或多个服务器的操作系统是否为同一操作系统。删除单元,用于若获取的一个或多个服务器的操作系统不为同一操作系统,删除不相同的操作系统所对应的服务器,以使剩余的服务器具有同一操作系统。系统选择匹配单元,用于若一个或多个服务器的操作系统为同一个操作系统,则从预存的中间件相关信息中选择与操作系统匹配的第一类中间件。Specifically, the system matching unit 702 includes: an operating system judgment unit, a deletion unit, and a system selection matching unit. The operating system determining unit is configured to determine whether the acquired operating systems of one or more servers are the same operating system according to the operating system information in the server configuration information. The deleting unit is configured to delete servers corresponding to different operating systems if the acquired operating systems of the one or more servers are not the same operating system, so that the remaining servers have the same operating system. The system selection matching unit is used to select the first type of middleware that matches the operating system from the pre-stored middleware related information if the operating systems of one or more servers are the same operating system.
环境匹配单元703,用于根据服务器所处的环境信息,从第一类中间件中确定一个与服务器所处环境信息匹配的目标中间件以进行推荐。The environment matching unit 703 is configured to determine a target middleware matching the environment information of the server from the first type of middleware according to the environment information of the server for recommendation.
具体地,环境匹配单元703,包括:匹配查找单元、匹配判断单元、环境选择匹配单元。其中,匹配查找单元,用于根据服务器所处的环境信息,从第一类中间件中查找出与服务器所处环境信息匹配的中间件。匹配判断单元,用于判断与服务器所处环境信息匹配的中间件是否有多个。环境选择匹配单元,用于若与服务器所处环境信息匹配的中间件有多个,按照预设规则从多个中选择一个中间件,作为与服务器所处环境信息匹配的目标中间件以进行推荐。环境选择匹配单元,还用于若与服务器所处环境信息匹配的中间件有一个,将该一个中间件作为与服务器所处环境信息匹配的目标中间件以进行推荐。Specifically, the environment matching unit 703 includes a matching search unit, a matching judgment unit, and an environment selection matching unit. The matching search unit is configured to find the middleware matching the environment information of the server from the first type of middleware according to the environment information of the server. The matching judging unit is configured to judge whether there are multiple middlewares that match the environment information of the server. The environment selection matching unit is used to recommend a middleware from a plurality of middlewares according to preset rules if there are multiple middlewares that match the environment information of the server, and it is recommended as a target middleware that matches the environment information of the server. . The environment selection matching unit is also used for recommending if there is one middleware matching the environment information of the server, and using the one middleware as the target middleware matching the environment information of the server.
判断单元704,用于判断用户是否接受推荐的目标中间件。The determining unit 704 is configured to determine whether the user accepts the recommended target middleware.
接收单元705,用于若用户不接受推荐的目标中间件,接收用户选择的中间件,将用户选择的中间件作为目标中间件。The receiving unit 705 is configured to receive the middleware selected by the user if the user does not accept the recommended target middleware, and use the middleware selected by the user as the target middleware.
端口设置单元706,用于若用户接受推荐的目标中间件,或者用户不接受推荐的目标中间件,接收用户选择的目标中间件后,设置目标中间件在服务器上用于提供服务的端口号。The port setting unit 706 is configured to set the port number of the target middleware on the server for providing services if the user accepts the recommended target middleware or the user does not accept the recommended target middleware.
具体地,若需安装目标中间件的服务器有多个,端口设置单元706,包括:端口标识判断单元、端口接口调用单元、端口号设置单元。其中,端口标识判断单元,用于判断是否接收到使用不同端口号的标识。端口接口调用单元,用于若接收到使用不同端口号的标识,调用设置多个端口号的接口。端口号设置单元,用于通过所述接口,分别设置多个服务器上用于提供服务的端口号;以及用于若未接收到使用不同端口号的标识,设置多个服务器用于提供服务的端口号为同一端口号。Specifically, if there are multiple servers that need to install the target middleware, the port setting unit 706 includes a port identification judging unit, a port interface calling unit, and a port number setting unit. The port identification judging unit is configured to determine whether an identification using a different port number is received. The port interface calling unit is configured to call an interface that sets multiple port numbers if an identifier using a different port number is received. A port number setting unit configured to respectively set port numbers for providing services on multiple servers through the interface; and to set ports used for providing services by multiple servers if no identification using different port numbers is received Number is the same port number.
安装单元707,用于若接收到安装指令,根据设置的端口号和服务器的IP地址,将目标中间件安装到服务器中。The installation unit 707 is configured to install the target middleware into the server according to the set port number and the IP address of the server if an installation instruction is received.
在一实施例中,若需安装目标中间件的服务器有多个,每个服务器中对应有多个不同的账户,不同的账户对应不同的权限。如账户administrator、user1、user2等分别对应不同的权限。那么,所述中间件安装装置还包括:账户设置单元,该账户设置单元,用于设置所述服务器需安装所述目标中间件的账户。安装单元,还用于若接收到安装指令,根据设置的端口号和服务器的IP地址,将目标中间件安装到服务器中的所述账户下。In one embodiment, if there are multiple servers that need to install the target middleware, each server corresponds to multiple different accounts, and different accounts correspond to different permissions. For example, the account administrator, user1, user2, and so on correspond to different permissions. Then, the middleware installation device further includes: an account setting unit, which is used to set an account for the server to install the target middleware. The installation unit is further configured to install the target middleware to the account in the server according to the set port number and the IP address of the server if an installation instruction is received.
具体地,所述账户设置单元,包括:账户标识判断单元、账户接口调用单元、安装账户设置单元。其中,账户标识判断单元,用于判断是否接收到使用不同账户的标识。账户接口调用单元,用于若接收到使用不同账户的标识,调用设置不同账户的接口。安装账户设置单元,用于通过所述接口,分别设置多个服务器所对应的需安装所述目标中间件的账户;以及若未接收到使用不同账户的标识,设置多个服务器所对应的需安装所述目标中间件的账户为同一账户或者使用默认的账户。Specifically, the account setting unit includes: an account identification judging unit, an account interface calling unit, and an installation account setting unit. The account identification judging unit is configured to determine whether an identification using a different account is received. The account interface calling unit is configured to call an interface for setting different accounts if an identification using a different account is received. An installation account setting unit, configured to respectively set the accounts corresponding to multiple servers that need to install the target middleware through the interface; and if the identifiers using different accounts are not received, set the corresponding installation needs of multiple servers The account of the target middleware is the same account or a default account is used.
在一实施例中,如图8所示,安装单元707,包括:初始化单元801、上传单元802、中间件安装单元803、同步单元804。In an embodiment, as shown in FIG. 8, the installation unit 707 includes: an initialization unit 801, an upload unit 802, a middleware installation unit 803, and a synchronization unit 804.
初始化单元801,用于初始化目标中间件的安装环境、对目标中间件的安装环境进行参数校验。初始化单元801,包括:账户初始化单元,用于初始化 服务器的账户名和密码;环境资源初始化单元,用于初始化安装目标中间件的环境资源;配置项初始化单元,用于初始化配置文件中的配置项;端口号检测单元,用于检测端口号是否存在冲突如端口号是否被占用;系统版本检测单元,用于检测系统版本是否符合要求;资源分配单元,用于为所述目标中间件的安装分配系统资源等。The initialization unit 801 is configured to initialize an installation environment of a target middleware, and perform parameter verification on the installation environment of the target middleware. The initialization unit 801 includes: an account initialization unit for initializing the account name and password of the server; an environment resource initialization unit for initializing the environment resources of the installation target middleware; a configuration item initialization unit for initializing the configuration items in the configuration file; A port number detection unit is used to detect whether there is a conflict in the port numbers such as whether the port number is occupied; a system version detection unit is used to detect whether the system version meets the requirements; a resource allocation unit is used to allocate a system for the installation of the target middleware Resources, etc.
其中,账户初始化单元,包括:账户获取单元、账户查找单元、账户进入单元。其中,账户获取单元,用于获取预先配置的账户名和密码。账户查找单元,用于在服务器中查找该预先配置的账户名和密码。账户进入单元,用于若查找到该预设配置的账户名和密码,根据该账户名和密码进入服务器中。The account initialization unit includes an account acquisition unit, an account search unit, and an account entry unit. The account obtaining unit is configured to obtain a pre-configured account name and password. The account search unit is configured to search the server for the pre-configured account name and password. The account entry unit is used to enter the server according to the account name and password if the preset account name and password are found.
环境资源初始化单元,包括:命令获取单元、环境资源安装单元。其中,命令获取单元,用于获取初始化环境资源所需要使用的命令,如若为liunx系统,则所需要使用的命令是liunx命令。环境资源安装单元,用于根据所需要使用的命令,将预先设置的环境资源安装到服务器中,如包括所涉及的系统文件库、系统包等。The environment resource initialization unit includes a command acquisition unit and an environment resource installation unit. The command obtaining unit is used to obtain a command required for initializing an environment resource. If it is a liunx system, the command required is a liunx command. An environment resource installation unit is configured to install a preset environment resource into a server according to a command required, such as including a system file library and a system package involved.
资源分配单元,包括:分配数据获取单元、资源判断单元、提示单元、最佳资源分配单元、最低资源分配单元。其中,分配数据获取单元,用于获取目标中间件预设的最低资源分配数据和最佳资源分配数据。资源判断单元,用于判断服务器剩余的资源数据是否大于最低资源分配数据。提示单元,用于若服务器剩余的资源数据不大于最低资源分配数据,则发出提示,以表示服务器资源不足。资源判断单元,还用于若服务器剩余的资源数据大于最低资源分配数据,判断服务器剩余的资源数据是否大于最佳资源分配数据。最佳资源分配单元,用于服务器剩余的资源数据大于最佳资源分配数据,则为目标中间件分配最佳资源分配数据中对应的资源。最低资源分配单元,用于若服务器剩余的资源数据大于最低资源分配数据,且不大于最佳资源分配数据,则为目标中间件分配最低资源分配数据中对应的资源。The resource allocation unit includes an allocation data acquisition unit, a resource judgment unit, a prompt unit, an optimal resource allocation unit, and a minimum resource allocation unit. The allocation data obtaining unit is configured to obtain the minimum resource allocation data and the best resource allocation data preset by the target middleware. The resource determining unit is configured to determine whether the remaining resource data of the server is greater than the minimum resource allocation data. A prompting unit is configured to issue a prompt if the remaining resource data of the server is not greater than the minimum resource allocation data to indicate that the server resource is insufficient. The resource determination unit is further configured to determine whether the remaining resource data of the server is greater than the optimal resource allocation data if the remaining resource data of the server is greater than the minimum resource allocation data. The optimal resource allocation unit is used for the remaining resource data of the server is greater than the optimal resource allocation data, and the target middleware is allocated the corresponding resource in the optimal resource allocation data. The minimum resource allocation unit is configured to allocate the corresponding resources in the minimum resource allocation data to the target middleware if the remaining resource data of the server is greater than the minimum resource allocation data and is not greater than the optimal resource allocation data.
上传单元802,用于若初始化目标中间件的安装环境成功,且通过对目标中间件安装环境的参数检验,上传目标中间件安装软件至服务器中。The uploading unit 802 is configured to upload the target middleware installation software to the server if the installation environment of the target middleware is successfully initialized and the parameters of the target middleware installation environment are checked.
中间件安装单元803,用于在服务器中安装目标中间件安装软件中的目标中间件安装包。具体地,解析所述目标中间件安装包,生成目标中间件安装包脚本;执行所述目标中间件安装包脚本。The middleware installation unit 803 is configured to install the target middleware installation package in the target middleware installation software in the server. Specifically, the target middleware installation package is parsed to generate a target middleware installation package script; and the target middleware installation package script is executed.
同步单元804,用于将安装信息同步至所述目标中间件对应的配置文件中。A synchronization unit 804 is configured to synchronize the installation information to a configuration file corresponding to the target middleware.
在其他实施例中,中间件安装装置还包括添加单元。该添加单元,用于添 加中间件的相关信息。In other embodiments, the middleware installation device further includes an adding unit. This adding unit is used to add information about middleware.
具体地,如图9所示,添加单元90,包括:压力测试单元901、版本参数调优单元902、配置写入单元903、中间件保存单元904、信息保存单元905。Specifically, as shown in FIG. 9, the adding unit 90 includes: a stress testing unit 901, a version parameter tuning unit 902, a configuration writing unit 903, a middleware storage unit 904, and an information storage unit 905.
压力测试单元901,用于在同一操作系统下且在中间件对应的环境资源下,在不同参数配置、不同应用环境下对不同版本的中间件进行压力测试,其中,不同参数配置对应不同应用场景。A stress test unit 901 is used to perform stress tests on different versions of middleware under different parameter configurations and different application environments under the same operating system and environmental resources corresponding to the middleware. Among them, different parameter configurations correspond to different application scenarios. .
版本参数调优单元902,用于根据不同参数配置、不同应用环境、不同版本的中间件所对应的压力测试结果和服务器的需求信息,选择压力测试结果较优/最优的中间件,以及根据服务器的需求信息对所述中间件对应的参数进行调整,以得到调优后的参数配置,其中,服务器的需求信息包括服务器所处的环境信息,即应用环境、应用场景、网络环境。The version parameter tuning unit 902 is configured to select a middleware with a better / optimal stress test result according to the stress test results and server requirement information corresponding to different parameter configurations, different application environments, and different versions of the middleware. The requirement information of the server adjusts the parameters corresponding to the middleware to obtain the optimized parameter configuration. The requirement information of the server includes environment information where the server is located, that is, an application environment, an application scenario, and a network environment.
配置写入单元903,用于将调优后的参数配置写入到所述中间件对应版本所对应的配置文件中。A configuration writing unit 903 is configured to write the optimized parameter configuration into a configuration file corresponding to the corresponding version of the middleware.
中间件保存单元904,用于将配置文件、对应版本的中间件安装包、中间件监控包保存为对应中间件安装软件。The middleware storage unit 904 is configured to save the configuration file, the middleware installation package of the corresponding version, and the middleware monitoring package as the corresponding middleware installation software.
信息保存单元905,用于将对应所述中间件安装软件,与中间件安装软件匹配的应用环境、应用场景、操作系统等信息保存至中间件的相关信息中以完成在所述操作系统下所述中间件的相关信息的添加和保存。An information saving unit 905 is configured to save information such as an application environment, an application scenario, and an operating system corresponding to the middleware installation software and the middleware installation software into relevant information of the middleware to complete all operations under the operating system. Add and save related information about middleware.
通过以上压力测试单元901、版本参数调优单元902、配置写入单元903、中间件保存单元904、信息保存单元905,可完成在多个操作系统下,不同中间件的相关信息的添加和保存。The above stress test unit 901, version parameter tuning unit 902, configuration writing unit 903, middleware storage unit 904, and information storage unit 905 can complete the addition and storage of related information of different middleware under multiple operating systems. .
上述装置实施例的实现过程和达到的有益效果可参看对应的方法实施例对应的描述。For the implementation process and the beneficial effects achieved by the foregoing device embodiments, refer to the corresponding description of the corresponding method embodiments.
上述装置可以实现为一种计算机程序的形式,计算机程序可以在如图10所示的计算机设备上运行。The above apparatus may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in FIG. 10.
图10为本申请实施例提供的一种计算机设备的示意性框图。该设备100包括通过系统总线101连接的处理器102、存储器和网络接口103,其中,存储器可以包括非易失性存储介质104和内存储器105。FIG. 10 is a schematic block diagram of a computer device according to an embodiment of the present application. The device 100 includes a processor 102, a memory, and a network interface 103 connected through a system bus 101. The memory may include a non-volatile storage medium 104 and an internal memory 105.
该非易失性存储介质104可存储操作系统1041和计算机程序1042。该计算机程序1042被执行时,可使得处理器102执行中间件安装方法。该处理器102用于提供计算和控制能力,支撑整个设备100的运行。该内存储器105为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器 102执行时,可使得处理器102执行中间件安装方法。该网络接口103用于进行网络通信,如接收消息等。本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的设备100的限定,具体的设备100可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The non-volatile storage medium 104 can store an operating system 1041 and a computer program 1042. When the computer program 1042 is executed, it can cause the processor 102 to execute a middleware installation method. The processor 102 is used to provide computing and control capabilities to support the operation of the entire device 100. The internal memory 105 provides an environment for running a computer program in a non-volatile storage medium. When the computer program is executed by the processor 102, the processor 102 can cause the processor 102 to execute a middleware installation method. The network interface 103 is used for network communication, such as receiving messages. Those skilled in the art can understand that the structure shown in FIG. 10 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the device 100 to which the solution of the present application is applied. The specific device 100 may Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
其中,所述处理器102用于运行存储在存储器中的计算机程序,以实现前述中间件安装方法的任一实施例。The processor 102 is configured to run a computer program stored in a memory to implement any embodiment of the foregoing middleware installation method.
应当理解,在本申请实施例中,所称处理器102可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that, in the embodiment of the present application, the processor 102 may be a central processing unit (CPU), and the processor may also be another general-purpose processor or a digital signal processor (DSP). , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
在本申请的另一实施例中提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时,以实现前述中间件安装方法的任一实施例。In another embodiment of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, In order to implement any embodiment of the foregoing middleware installation method.
存储介质包括计算机可读存储介质,所述计算机可读存储介质可以是非易失性计算机可读存储介质。所述计算机可读存储介质可以是前述任一实施例中的终端的内部存储单元,例如终端的硬盘或内存。所述计算机存储介质也可以是外部存储设备,例如终端上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡等。进一步地,所述计算机可读存储介质还可以既包括所述终端的内部存储单元也包括外部存储设备。The storage medium includes a computer-readable storage medium, and the computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium may be an internal storage unit of the terminal in any of the foregoing embodiments, such as a hard disk or a memory of the terminal. The computer storage medium may also be an external storage device, such as a plug-in hard disk equipped on a terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, and the like. Further, the computer-readable storage medium may further include both an internal storage unit of the terminal and an external storage device.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置、设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置、设备和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, device, and method may be implemented in other manners. For example, the device embodiments described above are only schematic, and the division of the units is only a logical function division. In actual implementation, there may be another division manner. Those skilled in the art can clearly understand that, for the convenience and brevity of the description, for the specific working processes of the devices, devices, and units described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described herein. The above is only a specific implementation of this application, but the scope of protection of this application is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements should be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (20)

  1. 一种中间件安装方法,其包括:A middleware installation method includes:
    获取需安装中间件的服务器的相关信息,其中,所述服务器的相关信息包括所述服务器所处的环境信息、所述服务器的配置信息、所述服务器的IP地址;Acquiring related information of a server to which middleware is to be installed, wherein the related information of the server includes environment information where the server is located, configuration information of the server, and IP address of the server;
    根据所述配置信息中的操作系统信息,从预存的中间件相关信息中确定与所述操作系统信息匹配的第一类中间件;Determining, according to the operating system information in the configuration information, first-type middleware that matches the operating system information from pre-stored middleware-related information;
    根据所述服务器所处的环境信息,从所述第一类中间件中确定一个与所述服务器所处环境信息匹配的目标中间件以进行推荐;Determining, from the first type of middleware, a target middleware that matches the environment information where the server is located for recommendation according to the environment information where the server is located;
    判断用户是否接受推荐的所述目标中间件;Determining whether the user accepts the recommended target middleware;
    若用户接受推荐的所述目标中间件,设置所述目标中间件在所述服务器上用于提供服务的端口号;If the user accepts the recommended target middleware, setting a port number of the target middleware for providing services on the server;
    若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中。If an installation instruction is received, the target middleware is installed in the server according to the set port number and the IP address of the server.
  2. 根据权利要求1所述的方法,其中,所述将所述目标中间件安装到所述服务器中,包括:The method according to claim 1, wherein the installing the target middleware into the server comprises:
    初始化所述目标中间件的安装环境,以及对所述目标中间件的安装环境进行参数校验;Initialize the installation environment of the target middleware, and perform parameter verification on the installation environment of the target middleware;
    若初始化所述目标中间件的安装环境成功,且通过对所述目标中间件安装环境的参数检验,上传目标中间件安装软件至服务器中;If the installation environment of the target middleware is successfully initialized, and the parameters of the target middleware installation environment are checked, upload the target middleware installation software to the server;
    在服务器中安装所述目标中间件安装软件中的目标中间件安装包;Installing a target middleware installation package in the target middleware installation software in a server;
    将安装信息同步至所述目标中间件对应的配置文件中。Synchronize the installation information to a configuration file corresponding to the target middleware.
  3. 根据权利要求2所述的方法,其中,所述初始化所述目标中间件的安装环境包括初始化所述目标中间件的环境资源,所述初始化所述目标中间件的环境资源,包括:The method according to claim 2, wherein the initializing the installation environment of the target middleware comprises initializing an environment resource of the target middleware, and the initializing the environment resource of the target middleware comprises:
    获取初始化环境资源所需要使用的命令;Get the commands needed to initialize the environment resources;
    根据所需要使用的命令,将预先设置的环境资源安装到服务器中。Install the preset environment resources into the server according to the required commands.
  4. 根据权利要求2所述的方法,其中,在所述上传目标中间件安装软件至服务器中之前,所述方法还包括:The method according to claim 2, wherein before the uploading target middleware installation software to a server, the method further comprises:
    获取所述目标中间件预设的最低资源分配数据和最佳资源分配数据;Acquiring the minimum resource allocation data and the optimal resource allocation data preset by the target middleware;
    若所述服务器剩余的资源数据不大于最低资源分配数据,则进行提示,以表示所述服务器资源不足;If the remaining resource data of the server is not greater than the minimum resource allocation data, a prompt is performed to indicate that the server resource is insufficient;
    若所述服务器剩余的资源数据大于最低资源分配数据,且大于最佳资源分配数据,则为所述目标中间件分配最佳资源分配数据中对应的资源;If the remaining resource data of the server is greater than the minimum resource allocation data and greater than the optimal resource allocation data, assigning the corresponding resources in the optimal resource allocation data to the target middleware;
    若所述服务器剩余的资源数据大于最低资源分配数据且不大于最佳资源分配数据,则为所述目标中间件分配最低资源分配数据中对应的资源。If the remaining resource data of the server is greater than the minimum resource allocation data and not greater than the optimal resource allocation data, the target middleware is allocated the corresponding resource in the minimum resource allocation data.
  5. 根据权利要求1所述的方法,其中,若需安装目标中间件的服务器有多个,所述设置所述目标中间件在所述服务器上用于提供服务的端口号,包括:The method according to claim 1, wherein if there are multiple servers on which the target middleware is to be installed, the setting the port number of the target middleware for providing services on the server comprises:
    判断是否接收到使用不同端口号的标识;Judging whether an identification using a different port number has been received;
    若接收到使用不同端口号的标识,调用设置多个端口号的接口;If an identifier using a different port number is received, an interface for setting multiple port numbers is called;
    通过所述接口,分别设置多个服务器上用于提供服务的端口号;Setting port numbers for providing services on multiple servers through the interface;
    若未接收到使用不同端口号的标识,设置多个服务器用于提供服务的端口号为同一端口号。If no identification using different port numbers is received, set the port numbers used by multiple servers to provide services to the same port number.
  6. 根据权利要求1所述的方法,其中,若需安装中间件的服务器有多个,所述根据所述配置信息中的操作系统信息,从预存的中间件相关信息中确定与所述操作系统信息匹配的第一类中间件,包括:The method according to claim 1, wherein if there are multiple servers to be installed with the middleware, the operating system information is determined from the pre-stored middleware related information according to the operating system information in the configuration information. Matching first-class middleware, including:
    根据所述配置信息中的操作系统信息,判断获取的多个服务器的操作系统是否为同一个操作系统;Determining whether the acquired operating systems of multiple servers are the same operating system according to the operating system information in the configuration information;
    若不为同一个操作系统,删除不相同的操作系统所对应的服务器,以使剩余的服务器具有相同的操作系统;If they are not the same operating system, delete the servers corresponding to the different operating systems so that the remaining servers have the same operating system;
    若为同一个操作系统,则从预存的中间件相关信息中选择与操作系统匹配的第一类中间件。If it is the same operating system, the first type of middleware matching the operating system is selected from the pre-stored middleware related information.
  7. 根据权利要求1所述的方法,其中,在接收到安装指令之前,所述方法还包括:The method according to claim 1, wherein before receiving the installation instruction, the method further comprises:
    设置所述服务器需安装所述目标中间件的账户;Setting up an account where the server needs to install the target middleware;
    所述若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中,包括:若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中的所述账 户下。If the installation instruction is received, installing the target middleware into the server according to the set port number and the IP address of the server includes: if the installation instruction is received, according to the set port number and the server The IP address of the server, install the target middleware under the account in the server.
  8. 一种中间件安装装置,其包括:A middleware installation device includes:
    获取单元,用于获取需安装中间件的服务器的相关信息,其中,所述服务器的相关信息包括所述服务器所处的环境信息、所述服务器的配置信息、所述服务器的IP地址;An obtaining unit, configured to obtain related information of a server to be installed with middleware, wherein the related information of the server includes environment information where the server is located, configuration information of the server, and IP address of the server;
    系统匹配单元,用于根据所述配置信息中的操作系统信息,从预存的中间件相关信息中确定与所述操作系统信息匹配的第一类中间件;A system matching unit, configured to determine, according to the operating system information in the configuration information, a first type of middleware that matches the operating system information from pre-stored middleware related information;
    环境匹配单元,用于根据所述服务器所处的环境信息,从所述第一类中间件中确定一个与所述服务器所处环境信息匹配的目标中间件以进行推荐;An environment matching unit, configured to determine, from the first type of middleware, a target middleware matching the environment information of the server according to the environment information of the server for recommendation;
    判断单元,用于判断用户是否接受推荐的所述目标中间件;A judging unit, configured to judge whether a user accepts the recommended target middleware;
    端口设置单元,用于若用户接受推荐的所述目标中间件,设置所述目标中间件在所述服务器上用于提供服务的端口号;A port setting unit, configured to set a port number of the target middleware for providing a service on the server if the user accepts the recommended target middleware;
    安装单元,用于若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中。An installation unit is configured to install the target middleware into the server according to a set port number and an IP address of the server if an installation instruction is received.
  9. 如权利要求8所述的中间件安装装置,其中,所述安装单元包括:The middleware mounting device according to claim 8, wherein the mounting unit comprises:
    初始化单元,用于初始化所述目标中间件的安装环境,以及对所述目标中间件的安装环境进行参数校验;An initialization unit, configured to initialize an installation environment of the target middleware, and perform parameter verification on the installation environment of the target middleware;
    上传单元,用于若初始化所述目标中间件的安装环境成功,且通过对所述目标中间件安装环境的参数检验,上传目标中间件安装软件至服务器中;An uploading unit for uploading the target middleware installation software to the server if the installation environment of the target middleware is successfully initialized and the parameters of the target middleware installation environment are checked;
    中间件安装单元,用于在服务器中安装所述目标中间件安装软件中的目标中间件安装包;A middleware installation unit, configured to install a target middleware installation package in the target middleware installation software in a server;
    同步单元,用于将安装信息同步至所述目标中间件对应的配置文件中。A synchronization unit, configured to synchronize the installation information to a configuration file corresponding to the target middleware.
  10. 如权利要求9所述的中间件安装装置,其中,所述初始化单元包括环境资源初始化单元,所述环境资源初始化单元,包括:The middleware installation device according to claim 9, wherein the initialization unit comprises an environment resource initialization unit, and the environment resource initialization unit comprises:
    命令获取单元,用于获取初始化环境资源所需要使用的命令;A command obtaining unit, configured to obtain a command used to initialize an environment resource;
    环境资源安装单元,用于根据所需要使用的命令,将预先设置的环境资源安装到服务器中。An environment resource installation unit is configured to install a preset environment resource into a server according to a command required.
  11. 一种计算机设备,包括存储器,以及与所述存储器相连的处理器;其中,A computer device includes a memory and a processor connected to the memory; wherein,
    所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储 的计算机程序,以执行如下步骤:The memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the following steps:
    获取需安装中间件的服务器的相关信息,其中,所述服务器的相关信息包括所述服务器所处的环境信息、所述服务器的配置信息、所述服务器的IP地址;Acquiring related information of a server to which middleware is to be installed, wherein the related information of the server includes environment information where the server is located, configuration information of the server, and IP address of the server;
    根据所述配置信息中的操作系统信息,从预存的中间件相关信息中确定与所述操作系统信息匹配的第一类中间件;Determining, according to the operating system information in the configuration information, first-type middleware that matches the operating system information from pre-stored middleware-related information;
    根据所述服务器所处的环境信息,从所述第一类中间件中确定一个与所述服务器所处环境信息匹配的目标中间件以进行推荐;Determining, from the first type of middleware, a target middleware that matches the environment information where the server is located for recommendation according to the environment information where the server is located;
    判断用户是否接受推荐的所述目标中间件;Determining whether the user accepts the recommended target middleware;
    若用户接受推荐的所述目标中间件,设置所述目标中间件在所述服务器上用于提供服务的端口号;If the user accepts the recommended target middleware, setting a port number of the target middleware for providing services on the server;
    若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中。If an installation instruction is received, the target middleware is installed in the server according to the set port number and the IP address of the server.
  12. 根据权利要求11所述的计算机设备,其中,所述处理器在执行所述将所述目标中间件安装到所述服务器中的步骤时,具体执行如下步骤:The computer device according to claim 11, wherein when the processor executes the step of installing the target middleware into the server, the processor specifically executes the following steps:
    初始化所述目标中间件的安装环境,以及对所述目标中间件的安装环境进行参数校验;Initialize the installation environment of the target middleware, and perform parameter verification on the installation environment of the target middleware;
    若初始化所述目标中间件的安装环境成功,且通过对所述目标中间件安装环境的参数检验,上传目标中间件安装软件至服务器中;If the installation environment of the target middleware is successfully initialized, and the parameters of the target middleware installation environment are checked, upload the target middleware installation software to the server;
    在服务器中安装所述目标中间件安装软件中的目标中间件安装包;Installing a target middleware installation package in the target middleware installation software in a server;
    将安装信息同步至所述目标中间件对应的配置文件中。Synchronize the installation information to a configuration file corresponding to the target middleware.
  13. 根据权利要求12所述的计算机设备,其中,所述处理器在执行所述初始化所述目标中间件的安装环境的步骤时,包括具体执行步骤:初始化所述目标中间件的环境资源;所述处理器在执行所述初始化所述目标中间件的环境资源的步骤时,具体执行如下步骤:The computer device according to claim 12, wherein when the processor executes the step of initializing an installation environment of the target middleware, the processor includes a specific execution step: initializing an environment resource of the target middleware; the When the processor executes the step of initializing the environment resources of the target middleware, the processor specifically performs the following steps:
    获取初始化环境资源所需要使用的命令;Get the commands needed to initialize the environment resources;
    根据所需要使用的命令,将预先设置的环境资源安装到服务器中。Install the preset environment resources into the server according to the required commands.
  14. 根据权利要求12所述的计算机设备,其中,所述处理器在执行所述上传目标中间件安装软件至服务器中的步骤之前,还具体执行如下步骤:The computer device according to claim 12, wherein before executing the step of uploading the target middleware installation software to the server, the processor further specifically performs the following steps:
    获取所述目标中间件预设的最低资源分配数据和最佳资源分配数据;Acquiring the minimum resource allocation data and the optimal resource allocation data preset by the target middleware;
    若所述服务器剩余的资源数据不大于最低资源分配数据,则进行提示,以表示所述服务器资源不足;If the remaining resource data of the server is not greater than the minimum resource allocation data, a prompt is performed to indicate that the server resource is insufficient;
    若所述服务器剩余的资源数据大于最低资源分配数据,且大于最佳资源分配数据,则为所述目标中间件分配最佳资源分配数据中对应的资源;If the remaining resource data of the server is greater than the minimum resource allocation data and greater than the optimal resource allocation data, assigning the corresponding resources in the optimal resource allocation data to the target middleware;
    若所述服务器剩余的资源数据大于最低资源分配数据且不大于最佳资源分配数据,则为所述目标中间件分配最低资源分配数据中对应的资源。If the remaining resource data of the server is greater than the minimum resource allocation data and not greater than the optimal resource allocation data, the target middleware is allocated the corresponding resource in the minimum resource allocation data.
  15. 根据权利要求11所述的计算机设备,其中,若需安装目标中间件的服务器有多个,所述处理器在执行所述设置所述目标中间件在所述服务器上用于提供服务的端口号的步骤时,具体执行如下步骤:The computer device according to claim 11, wherein if there are multiple servers on which the target middleware is to be installed, the processor executes the setting of the port number of the target middleware for providing services on the server The steps are as follows:
    判断是否接收到使用不同端口号的标识;Judging whether an identification using a different port number has been received;
    若接收到使用不同端口号的标识,调用设置多个端口号的接口;If an identifier using a different port number is received, an interface for setting multiple port numbers is called;
    通过所述接口,分别设置多个服务器上用于提供服务的端口号;Setting port numbers for providing services on multiple servers through the interface;
    若未接收到使用不同端口号的标识,设置多个服务器用于提供服务的端口号为同一端口号。If no identification using different port numbers is received, set the port numbers used by multiple servers to provide services to the same port number.
  16. 根据权利要求11所述的计算机设备,其中,所述处理器在执行所述根据所述配置信息中的操作系统信息,从预存的中间件相关信息中确定与所述操作系统信息匹配的第一类中间件的步骤时,具体执行如下步骤:The computer device according to claim 11, wherein the processor, when executing the operating system information in the configuration information, determines a first matching the operating system information from pre-stored middleware related information. In the steps of class middleware, the following steps are performed:
    根据所述配置信息中的操作系统信息,判断获取的多个服务器的操作系统是否为同一个操作系统;Determining whether the acquired operating systems of multiple servers are the same operating system according to the operating system information in the configuration information;
    若不为同一个操作系统,删除不相同的操作系统所对应的服务器,以使剩余的服务器具有相同的操作系统;If they are not the same operating system, delete the servers corresponding to the different operating systems so that the remaining servers have the same operating system;
    若为同一个操作系统,则从预存的中间件相关信息中选择与操作系统匹配的第一类中间件。If it is the same operating system, the first type of middleware matching the operating system is selected from the pre-stored middleware related information.
  17. 根据权利要求11所述的计算机设备,其中,所述处理器在执行所述接收到安装指令的步骤之前,还具体执行步骤:设置所述服务器需安装所述目标中间件的账户;所述处理器在执行所述若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中的步骤时,具体执行步骤:若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中的所述账户下。The computer device according to claim 11, wherein before the processor executes the step of receiving the installation instruction, the processor further specifically executes the steps of: setting up an account for the server to install the target middleware; and the processing When the device executes the step of installing the target middleware into the server according to the set port number and the IP address of the server if the installation instruction is received, the specific execution step is: if the installation instruction is received, Installing the target middleware under the account in the server according to the set port number and the IP address of the server.
  18. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时,实现如下步骤:A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, where the computer program includes program instructions, and when the program instructions are executed by a processor, the following steps are implemented:
    获取需安装中间件的服务器的相关信息,其中,所述服务器的相关信息包括所述服务器所处的环境信息、所述服务器的配置信息、所述服务器的IP地址;Acquiring related information of a server to which middleware is to be installed, wherein the related information of the server includes environment information where the server is located, configuration information of the server, and IP address of the server;
    根据所述配置信息中的操作系统信息,从预存的中间件相关信息中确定与所述操作系统信息匹配的第一类中间件;Determining, according to the operating system information in the configuration information, first-type middleware that matches the operating system information from pre-stored middleware-related information;
    根据所述服务器所处的环境信息,从所述第一类中间件中确定一个与所述服务器所处环境信息匹配的目标中间件以进行推荐;Determining, from the first type of middleware, a target middleware that matches the environment information where the server is located for recommendation according to the environment information where the server is located;
    判断用户是否接受推荐的所述目标中间件;Determining whether the user accepts the recommended target middleware;
    若用户接受推荐的所述目标中间件,设置所述目标中间件在所述服务器上用于提供服务的端口号;If the user accepts the recommended target middleware, setting a port number of the target middleware for providing services on the server;
    若接收到安装指令,根据设置的端口号和所述服务器的IP地址,将所述目标中间件安装到所述服务器中。If an installation instruction is received, the target middleware is installed in the server according to the set port number and the IP address of the server.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述处理器在执行所述将所述目标中间件安装到所述服务器中的步骤时,具体实现如下步骤:The computer-readable storage medium according to claim 18, wherein when the processor executes the step of installing the target middleware into the server, the processor specifically implements the following steps:
    初始化所述目标中间件的安装环境,以及对所述目标中间件的安装环境进行参数校验;Initialize the installation environment of the target middleware, and perform parameter verification on the installation environment of the target middleware;
    若初始化所述目标中间件的安装环境成功,且通过对所述目标中间件安装环境的参数检验,上传目标中间件安装软件至服务器中;If the installation environment of the target middleware is successfully initialized, and the parameters of the target middleware installation environment are checked, upload the target middleware installation software to the server;
    在服务器中安装所述目标中间件安装软件中的目标中间件安装包;Installing a target middleware installation package in the target middleware installation software in a server;
    将安装信息同步至所述目标中间件对应的配置文件中。Synchronize the installation information to a configuration file corresponding to the target middleware.
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述处理器在执行所述初始化所述目标中间件的安装环境的步骤时,包括具体实现步骤:初始化所述目标中间件的环境资源;所述处理器在执行所述初始化所述目标中间件的环境资源的步骤时,具体实现如下步骤:The computer-readable storage medium of claim 19, wherein when the processor executes the step of initializing the installation environment of the target middleware, the processor includes a specific implementation step: initializing an environmental resource of the target middleware ; When the processor executes the step of initializing the environmental resources of the target middleware, the following steps are specifically implemented:
    获取初始化环境资源所需要使用的命令;Get the commands needed to initialize the environment resources;
    根据所需要使用的命令,将预先设置的环境资源安装到服务器中。Install the preset environment resources into the server according to the required commands.
PCT/CN2018/109442 2018-06-22 2018-10-09 Middleware installation method and apparatus, and computer device and storage medium WO2019242162A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810650549.3 2018-06-22
CN201810650549.3A CN108845808B (en) 2018-06-22 2018-06-22 Middleware installation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2019242162A1 true WO2019242162A1 (en) 2019-12-26

Family

ID=64202269

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/109442 WO2019242162A1 (en) 2018-06-22 2018-10-09 Middleware installation method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN108845808B (en)
WO (1) WO2019242162A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901912A (en) * 2019-03-01 2019-06-18 厦门容能科技有限公司 A method of recommending the configuration of cloud host
CN110099096B (en) * 2019-03-12 2023-04-28 平安普惠企业管理有限公司 Application program configuration method, device, computer equipment and storage medium
CN110083401A (en) * 2019-03-12 2019-08-02 平安普惠企业管理有限公司 Method of adjustment, device, computer equipment and the storage medium of application program configuration
CN109918094A (en) * 2019-03-20 2019-06-21 浪潮商用机器有限公司 A kind of dispositions method, device and the medium of WebSphere middleware cluster
CN110213120B (en) * 2019-04-24 2020-12-04 深圳智链物联科技有限公司 Message middleware pressure measurement method and device and terminal equipment
CN111708560A (en) * 2020-06-17 2020-09-25 云和恩墨(北京)信息技术有限公司 Automatic deployment method and device of database high-availability management system
CN112114833A (en) * 2020-09-21 2020-12-22 中国建设银行股份有限公司 Device and method for determining middleware installation and deployment
CN112784251A (en) * 2021-01-29 2021-05-11 北京明略昭辉科技有限公司 Intelligent integrated cabinet platform, deployment method, computer equipment and storage medium
CN115766430A (en) * 2022-11-21 2023-03-07 中电云数智科技有限公司 Method for deploying cluster service based on hatched middleware instance

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160380817A1 (en) * 2015-06-29 2016-12-29 International Business Machines Corporation Assessing computing environment changes using specification documents
CN106325951A (en) * 2016-08-30 2017-01-11 广西电网有限责任公司 Automatic deployment method for application system supporting multiple databases and multiple middleware types
CN107577470A (en) * 2017-09-05 2018-01-12 郑州云海信息技术有限公司 One kind applies dispositions method and system
CN107766060A (en) * 2017-10-31 2018-03-06 新华三云计算技术有限公司 Application configuration dispositions method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9697451B2 (en) * 2013-09-27 2017-07-04 Integro, Llc RFID tag embedded within a molded connector and a tracking system therefor
CN103942063B (en) * 2013-11-08 2017-04-26 国家电网公司 Centralized configuration and remote deployment method for Java Web application
CN106131175B (en) * 2016-07-01 2019-05-21 微梦创科网络科技(中国)有限公司 A kind of acquisition of information, information-pushing method and equipment
CN106059841B (en) * 2016-08-10 2019-10-01 北京北信源软件股份有限公司 The method that the middleware of a kind of pair of deployment is monitored
CN107885539A (en) * 2016-09-28 2018-04-06 平安科技(深圳)有限公司 A kind of middleware management method and server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160380817A1 (en) * 2015-06-29 2016-12-29 International Business Machines Corporation Assessing computing environment changes using specification documents
CN106325951A (en) * 2016-08-30 2017-01-11 广西电网有限责任公司 Automatic deployment method for application system supporting multiple databases and multiple middleware types
CN107577470A (en) * 2017-09-05 2018-01-12 郑州云海信息技术有限公司 One kind applies dispositions method and system
CN107766060A (en) * 2017-10-31 2018-03-06 新华三云计算技术有限公司 Application configuration dispositions method and device

Also Published As

Publication number Publication date
CN108845808B (en) 2020-09-29
CN108845808A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
WO2019242162A1 (en) Middleware installation method and apparatus, and computer device and storage medium
US11151083B2 (en) Generating target application packages for groups of computing devices
US10127069B2 (en) Methods and apparatus to automatically configure monitoring of a virtual machine
US20190190898A1 (en) Methods and systems for managing internet preferences
WO2018072634A1 (en) Application processing method and device
US10296440B2 (en) Multi-tenant aware debugging methods and systems
US8756588B2 (en) Contextual exception management in multi-tenant systems
US11431558B2 (en) Data shipper agent management and configuration systems and methods
CN111695156A (en) Service platform access method, device, equipment and storage medium
US8438418B2 (en) Simplifying automated software maintenance of data centers
CN110119350B (en) Software development kit testing method, device and equipment and computer storage medium
CN113312064B (en) Method and device for installing and configuring physical machine and computer readable medium
JP2013080275A (en) Setting control device, setting control method, and setting control program
US11763219B2 (en) Titanium task-engine system
WO2019237583A1 (en) Nginx software installation method and apparatus, computer device, and storage medium
US11757976B2 (en) Unified application management for heterogeneous application delivery
CN110880990A (en) Configuration checking method and device for big data cluster component and computing equipment
CN116170274A (en) Web application access method, device, system and computing equipment
US20090144701A1 (en) Methods and systems for providing configuration data
CN113328880B (en) Method, system, medium and apparatus for deployment of distributed cluster system
CN113742110A (en) Message transmission method and device, electronic equipment and storage medium
CN115918116A (en) Information processing method, device and storage medium
US8504684B1 (en) Control of data storage system management application activation
US10432465B2 (en) Automatic provisioning of a network access point
US11412044B1 (en) Discovery of resources in a virtual private cloud

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18923031

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18923031

Country of ref document: EP

Kind code of ref document: A1