SpringBoot项目Jar包部署至Linux云服务器上

SpringBoot项目Jar包部署至Linux云服务器上

# 查看端口使用情况
[root@VM-0-17-centos home]# netstat -anp | grep 8088
tcp6       0      0 :::8088                 :::*                    LISTEN      2911/java  
# 查看端口是否被占用
[root@VM-0-17-centos home]# sudo lsof -i:8088
COMMAND  PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
java    2911 root   15u  IPv6 60557517      0t0  TCP *:radan-http (LISTEN)
# 如上所示,端口被PID为2911占用
# kill掉这个2911的进程
[root@VM-0-17-centos home]# sudo kill -9 2911
# 再次查看端口是否被占用
[root@VM-0-17-centos home]# sudo lsof -i:8088
[1]+  Killed                  nohup java -jar rtdcsi-server-0.0.1-SNAPSHOT.jar
# 如上所示,这个端口所被占用的进程已经被killed
# 进入home目录,将原有jar包删掉
[root@VM-0-17-centos home]# ls
nohup.out  rtdcsi-server-0.0.1-SNAPSHOT.jar  www
[root@VM-0-17-centos home]# rm -rf rtdcsi-server-0.0.1-SNAPSHOT.jar 
# 输入如下命令,即可部署项目,输入网址测试无误即可
[root@VM-0-17-centos home]# nohup java -jar rtdcsi-server-0.0.1-SNAPSHOT.jar &
[1] 6300
[root@VM-0-17-centos home]# nohup: ignoring input and appending output to ‘nohup.out’

你可能感兴趣的:(Jar包远程部署,java,spring,boot,linux)