Did you set port 9300.... Can you try 9200
spring.data.elasticsearch.cluster-nodes=localhost:9200
You can not connect to the 9300 transport client port in Elasticsearch 7.x+
Looks like you are running Elasticsearch 8.1.3 ... Definitely can not connect to the transport client.
What version of spring data Elasticsearch
https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/
Your going to need to use the high level rest client
Which I think is already deprecated see