CN110941438A - MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment - Google Patents

MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment Download PDF

Info

Publication number
CN110941438A
CN110941438A CN201911262963.8A CN201911262963A CN110941438A CN 110941438 A CN110941438 A CN 110941438A CN 201911262963 A CN201911262963 A CN 201911262963A CN 110941438 A CN110941438 A CN 110941438A
Authority
CN
China
Prior art keywords
installation
deployment
redis
mysql
tomcat
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911262963.8A
Other languages
Chinese (zh)
Inventor
崔志立
赵曙光
陈建明
翟文辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Donghua University
National Dong Hwa University
Original Assignee
Donghua University
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 Donghua University filed Critical Donghua University
Priority to CN201911262963.8A priority Critical patent/CN110941438A/en
Publication of CN110941438A publication Critical patent/CN110941438A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to an automatic deployment method of MySQL, Redis and Tomcat in an offline Centos7 environment, which comprises the following steps: MySQL installation and deployment, Redis installation and Tomcat installation and deployment in a Centos7 environment. MySQL installation and deployment solve the problems of Centos7 installation environment and MySQL dependence; the installation and deployment of Redis solve the problems of compiler gcc required by Redis compilation and the installation and quick downloading required by gcc; tomcat installation deployment solves the Tomcat dependency problem as well as the project deployment problem. Whether the corresponding middleware is installed or not can be determined by deleting the specific folder before deployment, and after all installation is finished, the installation package dependence, project source codes and the like used for installation are automatically deleted to protect intellectual property rights, so that the automatic deployment and automatic starting of a command line of a project are realized.

Description

MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment
Technical Field
The invention relates to an automatic MySQL, Redis and Tomcat deployment method, and belongs to the field of automatic operation and maintenance.
Background
Centos is one of the Linux releases, is completely open-source, is stable and safe, and makes it one of the popular systems of server systems, and Centos7 is the latest system and has a maria db database.
MySQL is a relational database, supports important characteristics such as affairs, index, multi-version control and abnormal recovery, is accepted and largely used by Internet enterprises, entrepreneurship companies and the like due to the characteristics of open source and light weight, and is the relational database with the largest number of operation examples at present. Linux is the most mainstream operating system of a data center, most MySQL is also operated on the Linux system, and the MySQL deployment method based on Linux is discussed in the invention.
Compared with the mainstream business relational database, MySQL is relatively simple to install and deploy, and can be easily completed through a software package management tool of a Linux distribution version. Only, the MySQL software packages which are defined in advance are installed in the way, and other versions cannot be used or installation directories cannot be changed. The existing MySQL automated deployment script cannot adapt to the new Centos7 operating system.
Redis is a key-value structured database system. The network and the memory storage are supported, and the network and the memory storage are supported, so that the network and the memory storage have good performances of persistence, extremely strong io capability, higher concurrency capacity and the like, and Redis is widely used by Internet companies.
Jdk is a software development kit of Java language, which is the core of the whole Java development and provides a compiling and running environment for Java program development, now provided and maintained by Oracle corporation. Programs written in Java need Jdk to provide a runtime environment, more than 6.0 Tomcat can be run without depending on Jdk, and the programs can be directly used in Jre (Java runtime environment), but less than 5.5 Tomcat must be installed in Jdk, so that Jdk is necessary to be deployed on a server where Tomcat is deployed.
Tomcat is an item that Apache software fund is open, supports HTML, provides support for jsp and Servlet, is free, open, light, advanced in technology and stable in performance, is widely used by Internet companies, and has an ever-increasing status due to the prevalence of Spring MVC and Spring Boot frameworks. When a Web project needs to be deployed in batch, because software environments of all servers are different and do not have networking conditions, the existing yum installation mode and existing scripts cannot meet the requirements, MySQL and Redis installation needs to be manually installed by workers, then MySQL and Redis installation is carried out, configuration files need to be manually modified, starting parameters are set, and related ports are opened after installation is completed, highly confidential information such as company source codes and the like needs to be deployed in most cases, a deployed installation package needs to be separated from a starting package, the fact that the installed package does not have secondary installation capacity and project starting capacity is guaranteed, intellectual property of a company is protected, and due rights of clients are protected.
Disclosure of Invention
The purpose of the invention is: and the tasks of MySQL, Redis and Tomcat installation and deployment are automatically completed.
In order to achieve the above object, the technical solution of the present invention is to provide an automatic MySQL, Redis, and Tomcat deployment method in an offline centros 7 environment, which is characterized by comprising:
the MySQL installation and deployment under the Centos7 environment comprises the following steps:
after MariaDB carried by the system under the Centos7 environment is automatically unloaded, MySQL dependency resolution is carried out, after MySQL dependency installation and execution are finished, a tar package provided by an Oracle official party is used for installation and deployment, a MySQL external communication interface is opened, a configuration file is covered by the configuration file in the installation package for modification, and finally MySQL is started;
the installation and deployment of Redis in a Centos7 environment comprises the following steps:
firstly, a compiler gcc required by Redis compilation and installation of dependence required by gcc are executed, then, the compilation and installation of Redis are carried out, a prepared Redis configuration file covers an original configuration file of the Redis, the configuration is completed, finally, a relevant port of the Redis is opened, and the Redis is started;
the installation and deployment of Tomcat in the Centos7 environment comprises the following steps:
firstly, making jdk installation and deployment to create conditions for Tomcat installation and deployment, then using Tomcat as a container for project deployment, adopting a tar package installation mode, installing and modifying a configuration file of Tomcat, simultaneously deleting all Tomcat items under a webpps folder, and copying the items needing to be operated to the webpps directory;
whether the corresponding middleware is installed or not is determined by deleting the specific folder before deployment, and after all installation is finished, the dependency of the installation package and the source code of the project used for installation are automatically deleted to protect intellectual property, so that the automatic deployment and automatic starting of a command line of the project are realized.
Preferably, the jdk installation and deployment are in an rpm installation mode.
Preferably, the dependencies in the installation package are downloaded with the download parameters in the command line in a MySQL and gcc installation manner of yum.
Preferably, a second-level directory init is set in a file structure adopted by the installation package, and all files under the second-level directory init are automatically deleted after installation.
Preferably, a second-level directory startup.sh and a third-level directory install.sh belonging to the second-level directory init are set in a file structure adopted by the installation package, the startup.sh performs deployment and installation under the condition that the install.sh file exists, the whole project is started, and the starting of the installed and deployed project is completed under the condition that the install.sh does not exist.
Preferably, all installation packages are arranged under the instance catalog, configuration files of a third-level catalog service, toJdk, toTomcat, toMySQL and toRedis belonging to a second-level catalog instance are set, the configuration files of jdk, Tomcat, MySQL and Redis in toJdk, toTomcat, toMySQL and toRedis are respectively set, and the service is a project war package needing to be deployed.
Preferably, the file structure adopted by the installation package is further provided with two-level directories, Tomcat, MySQL, Redis and Jdk, wherein Tomcat, MySQL, Redis and Jdk are installation positions of corresponding software, so that the separation of installation configuration and startup is realized.
Due to the adoption of the technical scheme, compared with the prior art, the invention has the following advantages and positive effects:
1) and deployment is rapid. The invention can rapidly complete the deployment of the project and the related middleware, and greatly improves the deployment efficiency.
2) Deployment startup convenience. A row of command lines completes the deployment and launch of the project.
3) Centros 7 adaptability. Can adapt to the system environment of the centros 7 operating system.
Drawings
FIG. 1 is a schematic diagram of a directory structure of the present invention;
FIG. 2 is a schematic start-up flow of the present invention;
FIG. 3 is a deployment flow diagram of the present invention.
Detailed Description
The invention will be further illustrated with reference to the following specific examples. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Further, it should be understood that various changes or modifications of the present invention may be made by those skilled in the art after reading the teaching of the present invention, and such equivalents may fall within the scope of the present invention as defined in the appended claims.
The embodiment of the invention relates to an automatic deployment method of MySQL, Redis and Tomcat in an offline Centos7 environment, which comprises the following steps: MySQL installation and deployment, Redis installation and deployment, jdk installation and deployment and Tomcat installation and deployment in a Centos7 environment. The MySQL installation and deployment solve the problems of Centos7 installation environment and MySQL dependence, and the MySQL deployment is completed; the installation and deployment of Redis solve the problems of compiler gcc required by Redis compilation and the installation and quick downloading required by gcc, and complete the compilation, installation and configuration of Redis; and the Tomcat installation and deployment solve the problem of Tomcat dependence and the problem of project deployment, and complete the installation and configuration of Tomcat. Whether the corresponding middleware is installed or not can be determined by deleting the specific folder before deployment, and after all installation is finished, the installation package dependence, project source codes and the like used for installation are automatically deleted to protect intellectual property rights, so that the automatic deployment and automatic starting of a command line of a project are realized. When the analysis is carried out, the method comprises the following steps:
step 1: and (5) installation and deployment of MySQL.
Step 1 comprises the following steps:
step 1-1: unloading the MariaDB database in the Centos7 to solve the problem of the conflict between MySQL and MariaDB;
step 1-2: installing dependency and MySQL required by MySQL;
step 1-3: and reading a random password generated in the installation process recorded in the MySQL log file, and modifying the initialization password of MySQL.
Step 1-4: and covering the MySQL configuration file with the configuration file in the tomMySQL folder shown in the figure 1, and opening a MySQL port.
Step 2: installation deployment of Redis.
The step 2 comprises the following steps:
step 2-1: installing dependency required by Redis, and installing Redis to a position below a Redis folder shown in FIG. 1;
step 2-2: the configuration file under the toRedis folder directory shown in fig. 1 overwrites the Redis configuration file.
Step 2-3: the Redis associated port is opened.
And step 3: the jdk is installed using the rpm mode in preparation for Tomcat deployment.
And 4, step 4: and installing and deploying Tomcat.
Step 4 comprises the following steps:
step 4-1: installing Tomcat under the Tomcat folder shown in fig. 1;
step 4-2: overwriting the configuration file in Tomcat shown in fig. 1 with the Tomcat configuration file;
step 4-3: deleting self-contained items under webapps in the Tomcat folder, and copying the items in the service folder shown in FIG. 1 to be under the webapps folder;
and 4-5: open Tomcat associated port.
It can be easily found that the invention can complete the automatic deployment of projects and middleware according to the actual situation of the Centos7, and can also adapt to the offline installation environment. Compared with the existing deployment method, the automatic deployment method using MySQL, Redis and Tomcat in the offline Centos7 environment has the following three advantages: 1) and deployment is rapid. The invention can rapidly complete the deployment of the project and the related middleware, and greatly improves the deployment efficiency; 2) deployment startup convenience. One row of command lines completes the deployment and the starting of the project; 3) centros 7 adaptability. Can adapt to the installation environment of the Centos7 operating system.

Claims (7)

1. An automatic MySQL, Redis and Tomcat deployment method in an offline Centos7 environment is characterized by comprising the following steps:
the MySQL installation and deployment under the Centos7 environment comprises the following steps:
after MariaDB carried by the system under the Centos7 environment is automatically unloaded, MySQL dependency resolution is carried out, after MySQL dependency installation and execution are finished, a tar package provided by an Oracle official party is used for installation and deployment, a MySQL external communication interface is opened, a configuration file is covered by the configuration file in the installation package for modification, and finally MySQL is started;
the installation and deployment of Redis in a Centos7 environment comprises the following steps:
firstly, a compiler gcc required by Redis compilation and installation of dependence required by gcc are executed, then, the compilation and installation of Redis are carried out, a prepared Redis configuration file covers an original configuration file of the Redis, the configuration is completed, finally, a relevant port of the Redis is opened, and the Redis is started;
the installation and deployment of Tomcat in the Centos7 environment comprises the following steps:
firstly, making jdk installation and deployment to create conditions for Tomcat installation and deployment, then using Tomcat as a container for project deployment, adopting a tar package installation mode, installing and modifying a configuration file of Tomcat, simultaneously deleting all Tomcat items under a webpps folder, and copying the items needing to be operated to the webpps directory;
whether the corresponding middleware is installed or not is determined by deleting the specific folder before deployment, and after all installation is finished, the dependency of the installation package and the source code of the project used for installation are automatically deleted to protect intellectual property, so that the automatic deployment and automatic starting of a command line of the project are realized.
2. The MySQL, Redis and Tomcat automatic deployment method in the offline Centos7 environment according to claim 1, wherein the jdk installation and deployment are implemented by rpm installation.
3. The method for MySQL, Redis and Tomcat automatic deployment in the offline Centos7 environment according to claim 1, wherein the dependencies in the installation package are downloaded with downloadonly parameters in a command line by installing MySQL and gcc mode through yum.
4. The method for MySQL, Redis and Tomcat automatic deployment in the offline Centos7 environment according to claim 1, wherein a secondary directory init is set in a file structure adopted by the installation package, and all files under the secondary directory init are automatically deleted after installation.
5. The MySQL, Redis and Tomcat automatic deployment method under the offline Centos7 environment according to claim 4, wherein a file structure adopted by the installation package is provided with a secondary directory startup.sh and a tertiary directory install.sh belonging to the secondary directory init, the startup is carried out when the startup.sh file exists, the whole project is started, and the startup of the installed and deployed project is completed when the install.sh does not exist.
6. The method for MySQL, Redis and Tomcat automatic deployment in an offline Centos7 environment according to claim 5, wherein all instances under the install directory are installation packages, and configuration files of a third-level directory service, toJdk, toTomcat, ToMySQL and toRedis belonging to a second-level directory install are set, wherein the configuration files are jdk, ToTotomcat, ToMySQL and ToRedis respectively, and the service is a project war package to be deployed.
7. The method for MySQL, Redis and Tomcat automatic deployment in offline Centos7 environment according to claim 6, wherein a file structure adopted by the installation package is further provided with secondary directories Tomcat, MySQL, Redis and Jdk, and Tomcat, MySQL, Redis and Jdk are installation positions of corresponding software, so as to realize separation of installation configuration and startup.
CN201911262963.8A 2019-12-11 2019-12-11 MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment Pending CN110941438A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911262963.8A CN110941438A (en) 2019-12-11 2019-12-11 MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911262963.8A CN110941438A (en) 2019-12-11 2019-12-11 MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment

Publications (1)

Publication Number Publication Date
CN110941438A true CN110941438A (en) 2020-03-31

Family

ID=69910079

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911262963.8A Pending CN110941438A (en) 2019-12-11 2019-12-11 MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment

Country Status (1)

Country Link
CN (1) CN110941438A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785228A (en) * 2024-02-22 2024-03-29 恒生电子股份有限公司 Application deployment method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9128792B2 (en) * 2012-09-28 2015-09-08 Wal-Mart Stores, Inc. Systems and methods for installing, managing, and provisioning applications
CN106843936A (en) * 2016-12-29 2017-06-13 北京航天测控技术有限公司 A kind of method of automatically dispose Web applied environments

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9128792B2 (en) * 2012-09-28 2015-09-08 Wal-Mart Stores, Inc. Systems and methods for installing, managing, and provisioning applications
CN106843936A (en) * 2016-12-29 2017-06-13 北京航天测控技术有限公司 A kind of method of automatically dispose Web applied environments

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
!-- --: "运维类-CentOS7.6离线安装MySQL8.0https://blog.csdn.net/milkbrother1988/article/details/103412555", 《CSDN》 *
CCTEXT: "Centos7离线安装redis https://www.cnblogs.com/yy3b2007com/p/10513752.html", 《博客园》 *
XDYIXIA: "centos7安装jdk和tomcat https://www.cnblogs.com/xdyixia/p/11653694.html", 《博客园》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785228A (en) * 2024-02-22 2024-03-29 恒生电子股份有限公司 Application deployment method and device
CN117785228B (en) * 2024-02-22 2024-05-28 恒生电子股份有限公司 Application deployment method and device

Similar Documents

Publication Publication Date Title
CN107577475B (en) Software package management method and system of data center cluster system
US10922067B1 (en) System and method for installing, updating and uninstalling applications
US8296758B2 (en) Deployment and versioning of applications
US8151277B2 (en) Method and system for dynamic remote injection of in-process agents into virtual machine based applications
US20140196022A1 (en) Cloud Based Application Packaging
US8464246B2 (en) Automation of mainframe software deployment
US8863108B2 (en) Finding out if software will run on an operating system without installing that software
US20130174117A1 (en) Single development test environment
US20170192773A1 (en) Mobile applications
CN113434158B (en) Custom management method, device, equipment and medium for big data component
KR20080082623A (en) Metadata driven deployment of applications
US8615737B2 (en) Systems and methods for building software packages in secure development environments
US8887122B2 (en) Find and track information of interface usage of software libraries by other software
CN112148297A (en) Intelligent server encryption and packaging method and device
CN117099079A (en) System configuration freezing and change management of services deployed via continuous delivery configured on a data center in a cloud platform
KR102052776B1 (en) Installation engine and package format for parallelizable, reliable installations
CN106502713A (en) A kind of method for upgrading software and system
CN109360029A (en) A kind of Self-management approach of remote terminal advertisement machine
CN113986395A (en) Packaging method for applying dependent self-contained technology under linux system
CN115437653A (en) Method for privatized deployment by using container technology
CN110941438A (en) MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment
CN115421765A (en) Big data management deployment method applied to domestic operating system
CN115113972A (en) Application transformation method, system, cluster, medium and program product
CN111522623B (en) Modularized software multi-process running system
CN108304184B (en) Compiling method and device

Legal Events

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

Application publication date: 20200331

RJ01 Rejection of invention patent application after publication