Release and deployment of Spring Cloud micro-service project

Source: Internet
Author: User

Ranhou Zai

General Javaweb project to publish, generally on three ways:

1. Put the project directly under Tomcat's WebApps to start Tomcat.

2. Package the project into a war package and put it under WebApps, launch Tomcat and automatically unzip the war package.

3. Use the method that shows the definition context (both of which are implicitly defined contexts), that is, the method of changing the configuration file, either create an XML file under Tomcat's Conf/catalina/localhost directory, or in Tomcat's conf/ Add a context element to the Server.xml file.

But now is the micro-service architecture, what is the micro-service, is a number of projects, and each project is equivalent to a previous project, has brought a tomcat. And then here we have a very handy way to deploy the release, using the Run Jar package to publish. Here are the steps:

The development tools we use here are Spring tool Suite, the Project Builder is maven

1. To clear the original jar package in the project, here we only focus on the jar package in each project target folder.

Click Project, right button, run as Maven clean

(Attached: If there is a bug in the Clean Post Project when developing, it is because the referenced jar package is clean and can be restored by right-maven->update project)

After clean, check the project's target folder without the jar package.

2. Create the JAR package:

Project Right-click, run As->maven Build ...

Then write the package in goals:

Then run on the line.

Each project goes through these two steps, and then there are the corresponding packages.

Then this time we want to run the project is very convenient, as long as the command line, go to the jar package corresponding to the directory to knock

Java-jar Xxxxxxxx.jar

Can.

For convenience, we generally write a script here, in this line of code, saved as. bat, double-click the file project will run.

Then talk about the deployment, here first with the Windows system, in order to facilitate testing:

One, the Windows service system configuration

Three main tasks: Install IIS services, JDK (Java), configure security Workgroup (opening port)

1. Install the IIS service, open Server Manager-add roles and Features--select >web Server (IIS) in the role, select > (. NET Framework 4.5) in the feature, IIS can host the Web core, and RPC on the HTTP proxy can follow.

The 2.JDK installation is the same as the local PC installation.

3. Configure the Security workgroup (the port that the network can access): Cloud server ecs--> Network and security-security group. Click on the configuration rules, configure the appropriate port in the configuration interface (for microservices, you only need to configure the Ingress port interface, such as gate one port).

Release and deployment of Spring Cloud micro-service project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.