开发者

how do I run multiple programs on different machines at same time?

开发者 https://www.devze.com 2023-02-11 14:05 出处:网络
I have a 12 computers cluster and I have a java program(the same) on each one, so I want to run these programs at the same time, how can i do this?

I have a 12 computers cluster and I have a java program(the same) on each one, so I want to run these programs at the same time, how can i do this?

I already can copy (scp) files from one computer to another开发者_开发百科 via ssh like

#!/bin/bash
scp /route1/file1 user@computerX:/route2$
scp /route1/file1 user@computerY:/route2$

so I was wondering if something like this can be done to run the programs that I have on each computer


You can run commands via

#!/bin/bash    
ssh user@host1 <command>
ssh user@host2 <command>

You will need to use Key Based Auth to avoid entering your password when the script runs.

Alternatively take a look at Fabric for a neat way of controlling multiple hosts.


I recommend typing:

man ssh

and see what it says. That command will run commands remotely for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消