After changing port number in Elasticsearch.yml file its get Failed to start Elasticsearch

Elasticsearch v7.5.2 (I'm using it)
Changing Port from 9200 to 9300

See below images you will get understand why i am facing this issue for the past 3 days

i want to give port number of 9300 instead of 9200 in elasticsearch.yml file. After changing the port number i restart the service of elasticsearch after that its get failed to start and when i give http.port on 9200 it work fine but not on 9300.

what is transport.tcp.port: 9300, i added in elasticsearch.yml file its correct or wrong to please see all images in attached.

please do help me urgently

Port 9300 is the default port used by the transport layer, i.e. communication between elalsticsearch nodes if you have a multi-mode cluster.

Since you set http.port: 9300, you need set transport.port to something else. Otherwise you'll get port conflict.

transport.tcp.port is for old version of Elasticsearch. Since you have v7.5.2, it should not concern you.

In one of your screenshot, there is an error message says "Received handshake message from unsupported version: [5.0.0] minimal compatible version is: [6.8.0]". You will need to make sure there is no other "old" elasticsearch instance running and trying to join the cluster.

ok Thanks

i will remove old version of elasticsearch but i want to add 9300 port

I added but its get failed to start. Can you give me steps how i can change

Explicity set transport.port to something else in the configuration yml file, e.g.:

http.port: 9300
transport.port: 9400
1 Like

Thanks its Work for me

i want to how to remove the old version of elasticsearch because i search in google try it but i dont know whether old version has been remove or not .

if you give me some commands i will try it

please help me below error with images

failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available:

Screenshot from 2020-04-14 12-39-07

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with </> icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

There is no evidence of anything related to elasticsearch in this stacktrace.
Why do you think it's an issue with elasticsearch?

ok
please have a look at below issue

Im using ubuntu 18.04

failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available:

this is my application.properties

ELASTICSEARCH_HOST=localhost
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=${ELASTICSEARCH_HOST}:9300
#spring.data.elasticsearch.local=false
#spring.data.elasticsearch.properties.transport.tcp.connect_timeout=60s
#spring.data.elasticsearch.properties.*=
spring.data.elasticsearch.repositories.enabled=true
#spring.data.elasticsearch.properties.host = server
#spring.data.elasticsearch.properties.elasticsearch.port = 9300```

is elasticsearch running locally?

If not, could you share the full logs of elasticsearch?

Yes its running locally
and also please do share me how to remove old version of elasticsearch i search from google and try but i dont know whether it has remove or not

here is the full logs

[2020-04-14T08:54:55,209][INFO ][o.e.e.NodeEnvironment    ] [DevOps] heap size [990.7mb], compressed ordinary object pointers [true]
[2020-04-14T08:54:55,308][INFO ][o.e.n.Node               ] [DevOps] node name [DevOps], node ID [ImFqlsTCR1qRzqi8RHIIvA], cluster name [elasticsearch]
[2020-04-14T08:54:55,309][INFO ][o.e.n.Node               ] [DevOps] version[7.5.2], pid[2755], build[default/deb/8bec50e1e0ad29dad5653712cf3bb580cd1afcdf/2020-01-15T12:11:52.313576Z], OS[Linux/5.3.0-40-generic/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/13.0.1/13.0.1+9]
[2020-04-14T08:54:55,310][INFO ][o.e.n.Node               ] [DevOps] JVM home [/usr/share/elasticsearch/jdk]
[2020-04-14T08:54:55,310][INFO ][o.e.n.Node               ] [DevOps] JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=COMPAT, -Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/elasticsearch-2306537318249287079, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=deb, -Des.bundled_jdk=true]
[2020-04-14T08:55:01,821][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [aggs-matrix-stats]
[2020-04-14T08:55:01,822][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [analysis-common]
[2020-04-14T08:55:01,822][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [flattened]
[2020-04-14T08:55:01,822][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [frozen-indices]
[2020-04-14T08:55:01,823][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [ingest-common]
[2020-04-14T08:55:01,823][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [ingest-geoip]
[2020-04-14T08:55:01,823][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [ingest-user-agent]
[2020-04-14T08:55:01,824][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [lang-expression]
[2020-04-14T08:55:01,824][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [lang-mustache]
[2020-04-14T08:55:01,824][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [lang-painless]
[2020-04-14T08:55:01,825][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [mapper-extras]
[2020-04-14T08:55:01,825][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [parent-join]
[2020-04-14T08:55:01,825][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [percolator]
[2020-04-14T08:55:01,825][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [rank-eval]
[2020-04-14T08:55:01,828][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [reindex]
[2020-04-14T08:55:01,828][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [repository-url]
[2020-04-14T08:55:01,829][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [search-business-rules]
[2020-04-14T08:55:01,829][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [spatial]
[2020-04-14T08:55:01,829][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [systemd]
[2020-04-14T08:55:01,830][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [transform]
[2020-04-14T08:55:01,830][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [transport-netty4]
[2020-04-14T08:55:01,830][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [vectors]
[2020-04-14T08:55:01,831][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-analytics]
[2020-04-14T08:55:01,831][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-ccr]
[2020-04-14T08:55:01,831][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-core]
[2020-04-14T08:55:01,831][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-deprecation]
[2020-04-14T08:55:01,832][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-enrich]
[2020-04-14T08:55:01,832][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-graph]
[2020-04-14T08:55:01,832][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-ilm]
[2020-04-14T08:55:01,832][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-logstash]
[2020-04-14T08:55:01,833][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-ml]
[2020-04-14T08:55:01,833][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-monitoring]
[2020-04-14T08:55:01,833][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-rollup]
[2020-04-14T08:55:01,834][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-security]
[2020-04-14T08:55:01,834][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-sql]
[2020-04-14T08:55:01,834][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-voting-only-node]
[2020-04-14T08:55:01,835][INFO ][o.e.p.PluginsService     ] [DevOps] loaded module [x-pack-watcher]
[2020-04-14T08:55:01,835][INFO ][o.e.p.PluginsService     ] [DevOps] no plugins loaded
[2020-04-14T08:55:09,710][INFO ][o.e.x.s.a.s.FileRolesStore] [DevOps] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
[2020-04-14T08:55:11,106][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [DevOps] [controller/3542] [Main.cc@110] controller (64 bit): Version 7.5.2 (Build 68f6981dfb8e2d) Copyright (c) 2020 Elasticsearch BV
[2020-04-14T08:55:12,621][DEBUG][o.e.a.ActionModule       ] [DevOps] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2020-04-14T08:55:12,979][INFO ][o.e.d.DiscoveryModule    ] [DevOps] using discovery type [zen] and seed hosts providers [settings]
[2020-04-14T08:55:15,321][INFO ][o.e.n.Node               ] [DevOps] initialized
[2020-04-14T08:55:15,321][INFO ][o.e.n.Node               ] [DevOps] starting ...
[2020-04-14T08:55:15,914][INFO ][o.e.t.TransportService   ] [DevOps] publish_address {127.0.0.1:9400}, bound_addresses {127.0.0.1:9400}
[2020-04-14T08:55:17,533][WARN ][o.e.b.BootstrapChecks    ] [DevOps] the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2020-04-14T08:55:17,548][INFO ][o.e.c.c.Coordinator      ] [DevOps] cluster UUID [i90L8f9rSNidimSWzXH9wQ]
[2020-04-14T08:55:17,642][INFO ][o.e.c.c.ClusterBootstrapService] [DevOps] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2020-04-14T08:55:18,174][INFO ][o.e.c.s.MasterService    ] [DevOps] elected-as-master ([1] nodes joined)[{DevOps}{ImFqlsTCR1qRzqi8RHIIvA}{EctUl7DcSTW4t9abIag5lA}{127.0.0.1}{127.0.0.1:9400}{dilm}{ml.machine_memory=16251056128, xpack.installed=true, ml.max_open_jobs=20} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 152, version: 886, delta: master node changed {previous [], current [{DevOps}{ImFqlsTCR1qRzqi8RHIIvA}{EctUl7DcSTW4t9abIag5lA}{127.0.0.1}{127.0.0.1:9400}{dilm}{ml.machine_memory=16251056128, xpack.installed=true, ml.max_open_jobs=20}]}
[2020-04-14T08:55:20,513][INFO ][o.e.c.s.ClusterApplierService] [DevOps] master node changed {previous [], current [{DevOps}{ImFqlsTCR1qRzqi8RHIIvA}{EctUl7DcSTW4t9abIag5lA}{127.0.0.1}{127.0.0.1:9400}{dilm}{ml.machine_memory=16251056128, xpack.installed=true, ml.max_open_jobs=20}]}, term: 152, version: 886, reason: Publication{term=152, version=886}
[2020-04-14T08:55:20,711][INFO ][o.e.h.AbstractHttpServerTransport] [DevOps] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2020-04-14T08:55:20,711][INFO ][o.e.n.Node               ] [DevOps] started
[2020-04-14T08:55:22,671][INFO ][o.e.l.LicenseService     ] [DevOps] license [fa4b1c77-76d7-4837-affb-07aa84995b74] mode [basic] - valid
[2020-04-14T08:55:22,673][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [DevOps] Active license is now [BASIC]; Security is disabled
[2020-04-14T08:55:22,714][INFO ][o.e.g.GatewayService     ] [DevOps] recovered [3] indices into cluster_state
[2020-04-14T08:55:34,677][INFO ][o.e.c.r.a.AllocationService] [DevOps] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[.apm-agent-configuration][0]]]).
[2020-04-14T16:39:14,642][INFO ][o.e.m.j.JvmGcMonitorService] [DevOps] [gc][23476] overhead, spent [354ms] collecting in the last [1s]```

Sounds like you changed the transport port to 9400.
So you might have to change this

spring.data.elasticsearch.cluster-nodes=${ELASTICSEARCH_HOST}:9300

to

spring.data.elasticsearch.cluster-nodes=${ELASTICSEARCH_HOST}:9400

but still i'm getting error after changing port number

failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{w6EBzOANTCOj7GCaIM6xIw}{localhost}{127.0.0.1:9300}]

and do u have any idea on below issue

Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "spring_session_attributes_pk"

Where did you change the port number. Logs are still saying 127.0.0.1:9300.

It's not related to elasticsearch.

Here is the elasticsearch.yml configuration file

i have set this in network

---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

network.host: 127.0.0.1

Set a custom port for HTTP:

http.port: 9300
transport.port: 9400

For more information, consult the network module documentation.

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with </> icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

So you did not apply my advice? Please read again After changing port number in Elasticsearch.yml file its get Failed to start Elasticsearch

I have applied but its again showing error
failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException:
None of the configured nodes are available: [{#transport#-1}{w6EBzOANTCOj7GCaIM6xIw}{localhost}{127.0.0.1:9400}]

In my application its showing like below
None of the configured nodes are available: [{#transport#-1}{6NuBrVa2STeE0-C20vg23A}{localhost}{127.0.0.1:9400}]

@dadoonet @Yang_Wang

still i am getting below error
failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{w6EBzOANTCOj7GCaIM6xIw}{localhost}{127.0.0.1:9400}]

see below my elasticsearch.yml file
http.port: 9300
transport.port: 9400

Please first make sure elasticsearch by itself starts up fine and works normally. The simplest way to ensure it is to start elasticsearch and then just issue a few curl commands to make sure it respond properly.

If above works, you can then be sure the problem is in your Spring application or network. A simple Tip is to make sure elasticsearch and your application are not running in separate docker containers because localhost means different things in containers.

If you still keep getting errors from your Spring application, you might wanna take the question to Spring Data Elasticsearch since they are the experts on this particular topic.

1 Like