[Spring Boot Spring Boot] use of Alibaba Cloud Toolkit (Idea plug-in) local one-click deployment Spring Boot project to a remote server

A, Alibaba Cloud Toolkit (Idea plug-in) installed

Step 1: Open Intellij of Settings (under Windows) or Preferences (Mac next) window

Step 2: Go to Plugins option to search for "Alibaba Cloud Toolkit", and can be installed, as shown below:

 

The results confirm the installation:

After the plug-in installed successfully, restart Intellij, if you see Alibaba Cloud Toolkit icon in the toolbar, then the installation was successful.

 

 

 

 

Second, configure your Host (ie, add your server)

 

 

 

 

 

Third, the deployment of your Spring Boot project

1. Select Deploy to Host

 

2. perform configuration before deployment

 

 

 

Deployment Parameter Description 

1) Deploy File: deployment file contains two ways.

  Maven Build:如果当前工程采用 Maven 构建,可以使用 Cloud Toolkit 直接构建并部署。
  Upload File:如果当前工程并非采用 Maven 构建,或者本地已经存在打包好的部署文件,可以选择并直接上传本地的部署文件。
2)Target Deploy ECS:在下拉列表中选择地域,然后在地域中选择要部署的 ECS 实例。
3)Deploy Location :输入在 ECS 上部署路径,如 /mnt/javaProject/base-eureka
4)Commond:输入应用启动命令,如 sh /mnt/javaProject/base-eureka/restart.sh。表示在完成应用包的部署后,需要执行的命令 —— 对于 Spring Boot 程序而言,通常是一句 java -jar XXXX.jar 的启动命令。

/mnt/javaProject/base-eureka/restart.sh内容如下:

source ~/.bash_profile
ps -ef|grep  base-eureka.jar | grep -v grep |awk '{print $2}' | xargs kill -9
nohup java -jar /mnt/javaProject/base-eureka/base-eureka.jar --spring.profiles.active=one > nohup.log 3>&1 &
nohup java -jar /mnt/javaProject/base-eureka/base-eureka.jar --spring.profiles.active=two > nohup2.log 2>&1 &
nohup java -jar /mnt/javaProject/base-eureka/base-eureka.jar --spring.profiles.active=three > nohup3.log 2>&1 &

3.点击发布,可能出现[ERROR] The cloud assistant is not installed on the ECS的错误

 

解决办法见:

https://www.cnblogs.com/756623607-zhang/p/11442791.html 

 

4.再次发布就可以了

 

Guess you like

Origin www.cnblogs.com/756623607-zhang/p/11442732.html