spring boot 项目如何在 linux 上部署启动?

欢迎关注博主公众号:【矿洞程序员】文章由陈晓阳原创。
本人微信:chenxiaoyangzxy. 免费提供本人大量学习资料。

以下方法基于:CentOS Linux release 7.2.1511 (Core)
1打包部署,在spring boot 项目中 添加打包插件依赖

 
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    ${project.name}
                    true
                
            
        
    

2:上传至 /home/yfmcp/{服务名}/jar包
3 创建服务相关的service后缀配置文件 /etc/systemd/system

[Unit]
Description=mcp-config
After=syslog.target
[Service]
ExecStart= /home/yfmcp/jdk/jdk1.8.0_181/bin/java -jar  /home/yfmcp/config/mcp-config.jar
[Install]
WantedBy=nulti-user.target*

4 启动服务

systemctl start mcp-config
systemctl status mcp-config  查看服务状态



后台日志在哪里?

你可能感兴趣的:(linux)