gpt4 book ai didi

bash - gnu-parallel:exec:perl:找不到

转载 作者:行者123 更新时间:2023-12-02 14:20:52 24 4
gpt4 key购买 nike

我有3个EC2实例,分别作为OS Centos7。
我已在其中一个实例(server1)上并行安装。

可以访问,因此没有SSH问题
ssh root@ip-10-0-xx-xx.xx-xx-1.compute.internal date给了我日期。

ssh $SERVER echo works
works

在这里,我创建了一个ALL_SERVERS-文件,其中包含服务器的主机名(root@ip-10-0-xx-xx.xx-xx-1.compute.internal)。

现在,我用名称test编写了一个简短的bash脚本:
#!/bin/bash
echo 'hello'

我要运行此脚本(从server1开始)。同时在server2和server3上。
parallel ./test.sh --sshloginfile ALL_SERVERS

但这只是显示 Academic tradition requires you to cite works you base your article on....几次输入后,它就会显示问候(仅在我的server1上)。

有人可以解释我在做什么错。

编辑:
还尝试了没有文件的情况:
    parallel --sshlogin root@ip-10-0-xx-xx.xx-xx-1.compute.internal echo hello

output: bash: line 0: exec: perl: not found

我也尝试过这个:
parallel --tag --nonall --slf ALL_SERVERS

现在我得到:
root@ip-10-0-0-xx.xx-xx-1.compute.internal  bash: line 0: exec: perl: not found
root@ip-10-0-0-xx.xx-xx-1.compute.internal bash: line 0: exec: perl: not found

最佳答案

这个:

parallel ./test.sh --sshloginfile ALL_SERVERS

与以下内容不同:
parallel --sshloginfile ALL_SERVERS ./test.sh

你要最后一个。

必须在工作程序上安装 perl
ssh remote perl -e \''print "OK\n"'\'

必须返回确定。

关于bash - gnu-parallel:exec:perl:找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35033350/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com