简体   繁体   English

如何在多个远程计算机上运行Jython脚本?

[英]How can I run a Jython script on mutiple, remote machines?

So I have some shell scripts that extract and transform certain data in .tar.gz format. 因此,我有一些Shell脚本可以提取和转换.tar.gz格式的某些数据。 The extraction/transformation takes a large set of data and transforms it into individual files that can be used to populate a database. 提取/转换需要大量数据并将其转换为可用于填充数据库的单个文件。 Because the set of data is very large, I need to use "GNU parallel" to run the process on multiple machines. 因为数据集非常大,所以我需要使用“ GNU并行”在多台计算机上运行该进程。 These scripts serve as wrapper scripts for my Java application. 这些脚本用作Java应用程序的包装器脚本。

However, I was looking to integrate this process with my Java application in a more direct manner that allows for higher level testing. 但是,我一直希望以更直接的方式将此过程与Java应用程序集成,以允许进行更高级别的测试。 My first thought was to replace the shell scripts with Jython and call my Java methods and applications directly from Jython instead. 我的第一个想法是用Jython替换shell脚本,然后直接从Jython调用我的Java方法和应用程序。 However, I can't seem to find a program similar to GNU parallel that will allow me to run the script simultaneously across multiple machines. 但是,我似乎找不到与GNU parallel类似的程序,该程序可以让我在多台计算机上同时运行脚本。

Any thoughts/ideas? 有什么想法/想法吗?

Not sure if this is precisely what you need, but have a look at Jsch: http://www.jcraft.com/jsch/examples/ 不知道这是否正是您所需要的,但是请看一下Jsch: http : //www.jcraft.com/jsch/examples/

Particularly the Exec.java and Shell.java examples: 特别是Exec.java和Shell.java示例:

http://www.jcraft.com/jsch/examples/Exec.java.html http://www.jcraft.com/jsch/examples/Exec.java.html

http://www.jcraft.com/jsch/examples/Shell.java.html http://www.jcraft.com/jsch/examples/Shell.java.html

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

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