1. 程式人生 > >jar包在伺服器部署及執行的相關命令

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