zoukankan      html  css  js  c++  java
  • springboot 2.x centos 7.0 部署

    1  pom

    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
    <mainClass>com.xx.xxApplication</mainClass>
    </configuration>
    </plugin>

    2 application.properties
    server.port=xxxx   (部署端口号)

    3 打好项目jar包(非war)

       mvn clean package

    4 yum install -y java-1.8.0-openjdk-devel.x86_64

    5.cd /etc/systemd/system  

    vi xxxxx.service

    [Unit]
    Description=xxxx service
    After=syslog.target
    
    [Service]
    Type=simple
    ExecStart= /usr/bin/java -jar xxxx-0.0.1-SNAPSHOT.jar
    
    [Install]
    WantedBy=multi-user.target

    6  systemctl enable xxxx.service

    7  shutdown -r now 

    done!!!

        刷新服务配置文件
      systemctl daemon-reload
      
      服务设置为开机启动
      systemctl enable xxxx.service
      
      启动服务
      systemctl start  xxxx.service

      停止服务
      systemctl stop xxxx.service

      查看服务状态
      systemctl status  xxxx.service

        查看日志
      journalctl -u xxxx.service

  • 相关阅读:
    最长有效括号
    C++ 环形缓存区的实现
    vector的原理与底层实现
    聚合分析与分组
    求两个数的最大公约数
    单例模式
    工厂方法模式
    责任链模式
    适配器模式
    策略模式
  • 原文地址:https://www.cnblogs.com/Garin/p/12992792.html
Copyright © 2011-2022 走看看