0

我正在尝试使用 dispy 将工作分配给 ec2 实例。

我关注了:

通过 ssh 隧道将 dispy 与端口转发一起使用

http://dispy.sourceforge.net/dispy.html#cloud

但它不会去任何地方,客户端脚本被挂起并且服务器节点没有收到任何东西。

我现在拥有的是:

从我的机器:

ssh -i mypemfile.pem -R 51347:localhost:51347 ubuntu@ec2-52-30-185-175.eu-west-1.compute.amazonaws.com

然后在远程机器上:

sudo dispynode.py --ext_ip_addr ec2-52-30-185-175.eu-west-1.compute.amazonaws.com -d

我得到:

2016-02-03 18:38:39,410 - dispynode - dispynode version 4.6.7
2016-02-03 18:38:39,414 - asyncoro - poller: epoll
2016-02-03 18:38:39,417 - dispynode - serving 1 cpus at 172.31.26.18:51348
2016-02-03 18:38:39,417 - dispynode - tcp server at 172.31.26.18:51348
2016-02-03 18:38:39,422 - asyncoro - waiting for 2 coroutines to terminate
Enter "quit" or "exit" to terminate dispynode,
  "stop" to stop service, "start" to restart service,
  "cpus" to change CPUs used, anything else to get status:

在我运行的客户端机器上:

import dispy
def f(x):
    return 2*x
cluster = dispy.JobCluster(f,nodes=['ec2-52-30-185-175.eu-west-1.compute.amazonaws.com'],ext_ip_addr='localhost')
job = cluster.submit(2)
print('result: %s' % job())

什么也没有发生,它只是卡住了。谢谢

4

0 回答 0