# How do you connect Ray Client to a cluster managed by a coordinator server?

**URL:** <https://discuss.ray.io/t/how-do-you-connect-ray-client-to-a-cluster-managed-by-a-coordinator-server/3084>\
**Category:** Ray Clusters\
**Created:** [July 30, 2021, 7:27pm UTC](https://discuss.ray.io/t/how-do-you-connect-ray-client-to-a-cluster-managed-by-a-coordinator-server/3084 "2021-07-30T19:27:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![djakubiec](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/djakubiec/32/1151_2.png) [@djakubiec](https://discuss.ray.io/u/djakubiec)\
**Post date:** [July 30, 2021, 7:27pm UTC](https://discuss.ray.io/t/how-do-you-connect-ray-client-to-a-cluster-managed-by-a-coordinator-server/3084/1 "2021-07-30T19:27:45Z")

</div>

We have two Ray clusters running on our on-premise nodes via Ray’s `coordinator_server`.

I know we can run scripts on each cluster via `ray exec` like this:

```auto
ray exec cluster1.yaml script1.py
ray exec cluster2.yaml script2.py

```

But how would we use Ray Client to connect to the desired cluster? Usually we would do something like:

```auto
ray.init("ray://<head_node_host>:10001")

```

But since the coordinator somewhat arbitrarily chooses the head node during cluster start up, how would a Ray Client script know what the head node host is?

It seems like there should be some command like:

```auto
ray.init(coordinator="10.0.0.1:20000", cluster="cluster1")

```

But I haven’t been able to find anything like that in the docs. Is there a way to use Ray Client with coordinator-managed clusters?
