使用ray up启动Ray集群时无法关闭rsync的问题
问题
我使用Ray 2.3.1与Python 3.8.9,尝试通过ray up启动单节点Ray集群:本地节点运行ray up命令,目标节点作为集群头节点,已确认本地可SSH连接目标节点。
- 最初采用官方
example-full.yaml配置文件,执行ray up config.yaml时出现错误:FileNotFoundError: [Errno 2] No such file or directory: 'rsync' - 由于所有节点已挂载共享NAS,无需rsync同步功能,我注释了配置中的
file_mounts、file_mounts_sync_continuously、rsync_filter、cluster_synced_files字段后重新执行,仍出现相同错误
现咨询:如何在使用Cluster Launcher时关闭文件同步?或有何简便方法解决该错误?
修改后的配置文件如下:
cluster_name: default provider: type: local head_ip: YOUR_HEAD_NODE_HOSTNAME worker_ips: [] auth: ssh_user: root min_workers: 0 max_workers: 0 upscaling_speed: 1.0 idle_timeout_minutes: 5 initialization_commands: [] setup_commands: [] head_setup_commands: [] worker_setup_commands: [] head_start_ray_commands: - ray stop - ulimit -c unlimited && ray start --head --port=6379 worker_start_ray_commands: - ray stop - ray start --address=$RAY_HEAD_IP:6379
解决方案
方法1:强制关闭所有文件同步逻辑
即便注释了相关字段,Ray Cluster Launcher默认仍可能尝试用rsync完成基础同步操作。你可以在配置文件中显式添加以下配置,彻底禁用文件同步:
- 在配置顶层添加:
file_mounts: {} cluster_synced_files: [] file_mounts_sync_continuously: false rsync_filter: []
- 在
provider块中添加no_sync: true参数(针对local provider生效):
provider: type: local head_ip: YOUR_HEAD_NODE_HOSTNAME worker_ips: [] no_sync: true # 新增该行,跳过所有文件同步步骤
该配置会完全依赖共享NAS的挂载,不再触发任何rsync相关操作。
方法2:快速安装rsync解决缺失问题
如果不想修改配置,直接在本地节点安装rsync即可消除错误:
- Debian/Ubuntu系统:
sudo apt-get install rsync -y - RHEL/CentOS系统:
sudo yum install rsync -y - macOS系统:
brew install rsync
报错根源是本地节点找不到rsync命令,而非目标节点,因此本地安装后即可正常执行ray up。
内容的提问来源于stack exchange,提问作者shinvu
相关产品推荐
相关产品推荐

