1.用xftp、WinSCP(我使用的)等文件傳輸工具將jar包上傳到服務(wù)器;
示例:我將data-collection-jar-with-dependencies.jar的jar包上傳到服務(wù)器的/home/hdfs/data-collection目錄下
2.用xshell連接服務(wù)器,在服務(wù)器上運(yùn)行jar包。
示例:cd /home/hdfs/data-collection
(java -jar data-collection-jar-with-dependencies.jar &)
其他相關(guān)命令
獲取正在運(yùn)行jar包進(jìn)程的pid
示例:ps aux|grep data-collection-jar-with-dependencies.jar
殺死進(jìn)程編號為pid的進(jìn)程
示例:kill -9 pid
輸出日志的最后2000行
tail -2000 日志目錄
示例:tail -2000 /home/hdfs/data-collection/logs/log4j.log