# Running ray stop shutdowns all processes of different ray clusters

**URL:** <https://discuss.ray.io/t/running-ray-stop-shutdowns-all-processes-of-different-ray-clusters/2276>\
**Category:** Ray Clusters\
**Created:** [May 24, 2021, 9:27pm UTC](https://discuss.ray.io/t/running-ray-stop-shutdowns-all-processes-of-different-ray-clusters/2276 "2021-05-24T21:27:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asm582](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/asm582/32/669_2.png) [@asm582](https://discuss.ray.io/u/asm582)\
**Post date:** [May 24, 2021, 9:27pm UTC](https://discuss.ray.io/t/running-ray-stop-shutdowns-all-processes-of-different-ray-clusters/2276/1 "2021-05-24T21:27:37Z")

</div>

Hello,

I start two local ray instances on laptop using ray.init(), running ray stop on CLI causes both the instances to shutdown. Should ray stop have an argument of head node so that we stop desired ray instances?

instance 1:

```auto
conda activate ray
(ray) $ python
Python 3.7.0 (default, Jun 28 2018, 07:39:16) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ray
>>> ray.init()
2021-05-24 17:21:36,008	INFO services.py:1174 -- View the Ray dashboard at http://127.0.0.1:8265
{'node_ip_address': '192.168.1.5', 'raylet_ip_address': '192.168.1.5', 'redis_address': '192.168.1.5:6379', 'object_store_address': '/tmp/ray/session_2021-05-24_17-21-35_125024_32834/sockets/plasma_store', 'raylet_socket_name': '/tmp/ray/session_2021-05-24_17-21-35_125024_32834/sockets/raylet', 'webui_url': '127.0.0.1:8265', 'session_dir': '/tmp/ray/session_2021-05-24_17-21-35_125024_32834', 'metrics_export_port': 60121, 'node_id': 'a9fc8975e9e6dbc1c62f01a5d97ac95948ec03cff77bd1ea03c11bf2'}

```

Instance 2

```auto
$ conda activate ray

(ray) $ python

Python 3.7.0 (default, Jun 28 2018, 07:39:16)

[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import ray

>>> ray.init()

2021-05-24 17:22:03,372 INFO services.py:1174 -- View the Ray dashboard at **http://127.0.0.1:8266**

{'node_ip_address': '192.168.1.5', 'raylet_ip_address': '192.168.1.5', 'redis_address': '192.168.1.5:52137', 'object_store_address': '/tmp/ray/session_2021-05-24_17-22-02_719214_32969/sockets/plasma_store', 'raylet_socket_name': '/tmp/ray/session_2021-05-24_17-22-02_719214_32969/sockets/raylet', 'webui_url': '127.0.0.1:8266', 'session_dir': '/tmp/ray/session_2021-05-24_17-22-02_719214_32969', 'metrics_export_port': 54012, 'node_id': '10eebf10b8295bb7050d518a709af21019c4ba77eed0a9638ee2fe30'}

```

Running ray stop will shutdown both the cluster:

```auto
$ conda activate ray

(ray) $ ray stop

Stopped all 28 Ray processes.

```

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [May 25, 2021, 2:57am UTC](https://discuss.ray.io/t/running-ray-stop-shutdowns-all-processes-of-different-ray-clusters/2276/2 "2021-05-25T02:57:34Z")

</div>

cc @Alex who is working on namespaces.

---

<div class="post-metadata">

**Author:** ![tarjintor](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tarjintor/32/3552_2.png) [@tarjintor](https://discuss.ray.io/u/tarjintor)\
**Post date:** [April 19, 2023, 9:27am UTC](https://discuss.ray.io/t/running-ray-stop-shutdowns-all-processes-of-different-ray-clusters/2276/3 "2023-04-19T09:27:34Z")

</div>

it seems this issue still exists,any way to achieve this now in 2023.4?

---

<div class="post-metadata">

**Author:** ![tarjintor](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tarjintor/32/3552_2.png) [@tarjintor](https://discuss.ray.io/u/tarjintor)\
**Post date:** [April 24, 2023, 2:21am UTC](https://discuss.ray.io/t/running-ray-stop-shutdowns-all-processes-of-different-ray-clusters/2276/4 "2023-04-24T02:21:02Z")

</div>

I find another solution,just use subprocess call ray start with “–block”, and the main process watch an outside database to stop the subprocess,that will work fine
