jar包在服务器部署及运行的相关命令

1.用xftp、WinSCP(我使用的)等文件传输工具将jar包上传到服务器;

示例:我将data-collection-jar-with-dependencies.jar的jar包上传到服务器的/home/hdfs/data-collection目录下

2.用xshell连接服务器,在服务器上运行jar包。

示例:cd /home/hdfs/data-collection
 (java -jar data-collection-jar-with-dependencies.jar &)

其他相关命令

获取正在运行jar包进程的pid

示例:ps aux|grep data-collection-jar-with-dependencies.jar

杀死进程编号为pid的进程
示例:kill -9 pid

输出日志的最后2000行

tail -2000  日志目录

示例:tail -2000 /home/hdfs/data-collection/logs/log4j.log

你可能感兴趣的:(jar包在服务器部署及运行的相关命令)