This tutorial will show you how to use the Cloud Toolkit to deploy your application on Enterprise Distributed Application Service (EDAS).
Enterprise Distributed Application Services (https://www.alibabacloud.com/en/product/edas) (EDAS) is a PaaS platform that involves applications and microservices. It provides a variety of application release capabilities and lightweight microservices solutions to help you solve monitoring, diagnostics, and high availability O & M issues in your application and service management processes. EDAS is available in the Spring Cloud and Dubbo environments.
The coding method is the same whether you compile a Java application that runs on EDAS or a Java application that runs locally. Therefore, in this article, we will explain how to deploy using a Java Servlet for printing "Hello World" on a Web page as an example.
public class IndexServlet extends HttpServlet {
private static final long serialVersionUID = -112210702214857712L;
@Override
public void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException {
PrintWriter writer = resp.getWriter();
// Demo: Use Alibaba Cloud Toolkit to modify the code of a local application and deploy the application to the cloud.
writer.write("Deploy from alibaba cloud toolkit. 2018-10-24");
return;
}
@Override
protected void doPost( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException {
return;
}}
[This link](https://alicloud-common.oss-ap-southeast-1.aliyuncs.com/Cloud_Toolkit_Blog/IndexSer...%5B%E9%93%B6%E6%97%B6%5D.1540514368. You can download the source code from zip? spm = a2c65.11461447.0.0.69096c5bNP5YC4 & file = IndexSer ...% 5B% E9% 93% B6% E6% 97% B6% 5D.1540514368.zip).
The above code is a standard Java project for displaying the string "Hello World" on a web page.
Alibaba Cloud provides Eclipse-based plugins for developers to efficiently deploy applications written in the local IDE to EDAS.
Plugin URL: https://www.aliyun.com/product/cloudtoolkit_en
The procedure for installing this Eclipse-based plug-in is similar to a typical plug-in, so we won't go into details here.
After installing the plugin, select it and configure the preferences.
Top Menu> Window> Preferences> Alibaba Cloud Toolkit> Account
When the following page is displayed, set the AK and SK of the Alibaba Cloud account, and the setting of the environment setting is completed (If you are using a RAM user account, enter the AK and SK of the RAM user ).
Right-click on the project name in Eclipse and select Alibaba Cloud> Deploy to EDAS from the shortcut menu. The following deployment screen will be displayed.
In the EDAS Deployment Settings dialog box, set regions, namespaces, applications, and groups based on your requirements, select a deployment package generation mode, and click Deploy.
Note: If you have not created the application in EDAS, click Create Application in EDAS Console in the upper right corner of the dialog box to go to the EDAS Console and create the application. For more information on how to create an application, see https://www.alibabacloud.com/help/doc-detail/99912.html See .html).
Application pane parameter description:
-Region: Indicates the region of the application. --Namespace: Indicates the application namespace. --Application: Represents the application name. --Group: Indicates a group of applications.
Deploy file: You have two options.
--Build Maven: If you are using Maven to build your current project, you can use Alibaba Cloud Toolkit to build and deploy your application directly. --File Upload: If you are not using Maven to build your current project, or if you already have a locally packaged deployment file, you can select your local deployment file and upload it directly.
Recommended Posts