# CrateDB cluster node, how to use all the nodes

**URL:** <https://community.cratedb.com/t/cratedb-cluster-node-how-to-use-all-the-nodes/1296>\
**Category:** CrateDB\
**Created:** [November 22, 2022, 1:03pm UTC](https://community.cratedb.com/t/cratedb-cluster-node-how-to-use-all-the-nodes/1296 "2022-11-22T13:03:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BANDANA\_PANDEY](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/bandana_pandey/32/740_2.png) [@BANDANA\_PANDEY](https://community.cratedb.com/u/BANDANA_PANDEY)\
**Post date:** [November 22, 2022, 1:03pm UTC](https://community.cratedb.com/t/cratedb-cluster-node-how-to-use-all-the-nodes/1296/1 "2022-11-22T13:03:07Z")

</div>

Hi everyone,

I have 3 node crateDB cluster like this:

```auto
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3e73dabc643c crate:5.0.0 "/docker-entrypoint.…" 5 weeks ago Up 5 weeks 4300/tcp, 0.0.0.0:4202->4200/tcp, :::4202->4200/tcp, 0.0.0.0:5433->5432/tcp, :::5433->5432/tcp work-cratedb02-1
d35b21cd6e8b crate:5.0.0 "/docker-entrypoint.…" 5 weeks ago Up 7 days 4300/tcp, 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp, 0.0.0.0:4201->4200/tcp, :::4201->4200/tcp work-cratedb01-1
205e6ba07384 crate:5.0.0 "/docker-entrypoint.…" 5 weeks ago Up 2 weeks 4300/tcp, 0.0.0.0:4203->4200/tcp, :::4203->4200/tcp, 0.0.0.0:5434->5432/tcp, :::5434->5432/tcp work-cratedb03-1

```

And I am using HTTP Endpoint for running sql using something like this:

```auto
curl -sS -H 'Content-Type: application/json' -X POST 'InstanceIP:4201/_sql' -d '{"stmt":"select * from demo_table limit 2"}'

```

I want to know, is there a way where we do not have to specify port of a single node in the url like 4201 because as mentioned above there are three nodes and I want to utilize all three for read and write instead of just using one, so that it will load balance across all the three nodes thus enhancing read and write operations

Any help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [November 22, 2022, 1:18pm UTC](https://community.cratedb.com/t/cratedb-cluster-node-how-to-use-all-the-nodes/1296/2 "2022-11-22T13:18:39Z")

</div>

Hi,

> I want to utilize all three for read and write instead of just using one, so that it will load balance across all the three nodes thus enhancing read and write operations

There are 2 sides to this, one is which node your client application (`curl` in this case) will send the request to, then there is the execution of the query.  
Regardless of which node receives the query, CrateDB will try to use all the resources of all nodes to complete the request as soon as possible, you can read about [sharding](https://crate.io/docs/crate/reference/en/5.1/general/ddl/sharding.html) and [replicas](https://crate.io/docs/crate/reference/en/5.1/general/ddl/replication.html), that is how CrateDB distributes data across the nodes.

Which node your client application sends the request to is still important so that if there are lots of clients the requests can be balanced and in case a node is not available another node can still be reached.  
Ideally you would deploy what is called a [load balancer](https://community.cratedb.com/t/what-do-you-recommend-as-a-load-balancer/805), this is the same that you could use for any http web server. If you are looking for a simpler solution you could have all nodes on the same port but on different IP addresses and use [DNS round-robin](https://en.wikipedia.org/wiki/Round-robin_DNS)
