简体   繁体   English

如何在不同的Linux系统上同时运行jar

[英]how to run a jar on different linux systems at the same time

I have a jar and I need a utility which can read a file containing ipaddresses and run this jar on those systems. 我有一个jar,我需要一个实用程序,该实用程序可以读取包含ipaddresses的文件并在那些系统上运行此jar。 How can I do this. 我怎样才能做到这一点。

Or what strategy I should apply for this 或者我应该采用什么策略

The question is missing some key info of what you have, but still you can go like this. 问题是缺少您所拥有的一些关键信息,但是您仍然可以像这样去。

  1. Make a script and loop over the ip adresses 制作脚本并遍历ip地址
  2. Copy the jar file to hosts, I assume you have access on them 将jar文件复制到主机,我假设您可以访问它们
  3. Run the jar 运行罐子
 #!/bin/sh while read ipadress do scp <YOURPATHTOJAR>/<YOURJARFILE>.jar <YOURUSER>@$ipadress:~/ ssh -f <YOURUSER>@$ipaddress "java ~/<YOURJARFILE>.jar" done 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM