Deploy a multi-module microservice application using Cloud Toolkit

更新时间:
复制 MD 格式

Large projects often contain multiple microservices that must be deployed to separate servers. This topic describes how to use Cloud Toolkit to quickly deploy these multi-module applications.

Create a host

  1. Open your project in IntelliJ IDEA.
  2. In the top menu bar of IntelliJ IDEA, choose Tools > Alibaba Cloud > Alibaba Cloud View > Host.
  3. Click Add Host on the right. On the Add Host page, configure the host parameters.add host

    The following table describes the parameters.

    ParameterDescription
    Host ListThe IP address of the host. If you have multiple hosts, enter each IP address on a new line.
    PortThe port of the host.
    SSH ProfileThe Secure Shell (SSH) key.
    • Create new profile: Create a new private key. Set Profile Name, Method, Username, and Password. For Method, select Password or Select a Private Key.
    • Use existing profile: Use an existing private key.
    For more information about SSH keys, see User data privacy.
    Note After you configure the host parameters, click Test Connection to verify the connection. If you specify multiple host IP addresses, only the connection to the first host is tested.
  4. Review the parameters and click Add.

Deployment methods

  1. In the configuration list in the upper-right corner of IntelliJ IDEA, click Edit Configuration....
  2. On the Run/Debug Configuration page, click + in the upper-left corner and select Deploy to Host.Deploy to Host

    The following table describes the deployment parameters.

    ParameterDescription
    NameThe name of the deployment. Use an English name.
    File
    • Maven Build: If your project uses Maven, you can build and deploy it directly.
    • Upload File: If your project does not use Maven, or if you have a packaged deployment file on your local machine, select and upload the local file.
    • Gradle Build: If your project uses Gradle, you can build and deploy it directly.
    Target HostThe target host.
    Target DirectoryThe path on the target host where you want to deploy the microservice.
    After deployThe command to execute after the file is uploaded.
    Before launchPackages the project for deployment.
  3. Review the deployment parameters, click Apply, and then click OK.

View deployment logs

You can view the Deploy to Host logs to check whether the deployment file was uploaded successfully and to see the results of the command execution.