Multiple ray heads (on one machine) from CLI

Is it possible to instantiate multiple ray heads when using the CLI? ray start does let me specify a port for the head node but ray stop doesn’t seem to have any arguments to specify which ray instance I want to stop.

I guess when using Python API (ray.init()) this is somehow handled automatically?

1 Like

It isn’t recommended to run multiple head nodes on a single machine, but if you really need to, I think you could use kill -9 to directly kill a specific GCS server process. You can use pgrep gcs_server to find these instances, and if you kill one, the associated Ray node should also clean itself up.

I believe ray.init() will autoconnect to the latest Ray cluster, so you may also have to pass in the specific IP printed by the ray start command for this to work.

2 Likes

@mil.ad to start multiple ray heads with ray CLI, see Error in `ray job submit` on local machine if multiple clusters are running at the same time - #17 by davidxia

1 Like