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?

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.

1 Like