我想在具有多个节点的集群上运行 ray。我只能将非交互式作业提交到集群,所以我不确定如何在作业运行时以编程方式获取 redis 地址。
我相当确定在多个节点上启动 ray 的方式是这样的:
ray start --head
for host in $(srun hostname | grep -v $(hostname)); do
ssh $host ray start --redis-address=$redis_address
done
但我需要知道头节点的redis地址。当您启动头节点时,它会打印:
Started Ray on this node. You can add additional nodes to the cluster by calling
ray start --redis-address 8.8.8.8:59465
from the node you wish to add. You can connect a driver to the cluster from Python by running
import ray
ray.init(redis_address="8.8.8.8:59465")
If you have trouble connecting from a different machine, check that your firewall is configured properly. If you wish to terminate the processes that have been started, run
我正计划捕获输出ray start --head &> tee redis_port.txt
,然后grep
输入redis_address.txt
以查找redis地址,但似乎输出的那部分没有被捕获redis_address.txt
,我查看了由射线会话创建的临时目录中的所有.out
和文件,但没有.err
其中也有。
必须有一些更好的方法来做到这一点。查找头节点的redis端口的预期方法是什么?