- head node
sudo apt install redis
sudo service redis stop # 装好redis之后守护进程自动运行。ray会再开一个守护进程,为了避免不必要的麻烦停掉redis
pip uninstall numpy
pip install numpy==1.16.0
ray start --head --redis-port=6379
打印:
Started Ray on this node. You can add additional nodes to the cluster by calling
ray start --address='192.168.1.129:6379' --redis-password='5241590000000000'
from the node you wish to add. You can connect a driver to the cluster from Python by running
import ray
ray.init(address='auto', redis_password='5241590000000000')
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 stop
- slaves
尝试在子节点打开ray
ray start --address=192.168.1.129:6379
但是报错
Exception: Version mismatch: The cluster was started with:
Ray: 0.8.1
Python: 3.6.8
Pyarrow: 0.14.0.RAY
This process on node 192.168.1.116 was started with:
Ray: 0.8.1
Python: 3.6.10
Pyarrow: 0.14.0.RAY
于是
conda install python=3.6.8
In [3]: ray.init(address='auto', redis_password='5241590000000000')
2020-02-10 13:02:58,376 WARNING worker.py:682 -- WARNING: Not updating worker name since `setproctitle` is not installed. Install this with `pip install setproctitle` (or ray[debug]) to enable monitoring of worker processes.
Out[3]:
{'node_ip_address': '192.168.1.129',
'redis_address': '192.168.1.129:6379',
'object_store_address': '/tmp/ray/session_2020-02-10_12-36-11_167736_31237/sockets/plasma_store',
'raylet_socket_name': '/tmp/ray/session_2020-02-10_12-36-11_167736_31237/sockets/raylet',
'webui_url': None,
'session_dir': '/tmp/ray/session_2020-02-10_12-36-11_167736_31237'}