Failed to connect to backoff(elasticsearch(http://localhost:9200)): Get http://localhost:9200: dial tcp 127.0.0.1:9200: connect: connection refused

Hi All,

I am new ELK user doing POC, and I install Elasticsearch 7.7,Kibana 7.7 in CentOS 7 .
I changed host to [2.0.X.X] in elasticsearch.yml ,kibana. I am trying to configure APM Server which is throwing issues.

Hi @sspr,
the error message indicates that you didn't change the Elasticsearch host in the APM Server configuration to reflect your setup. You can find detailed information about how to configure the Elasticsearch output for APM Server. Also have a look at where to find the configuration files depending on your installation method.

Hi @simitt ,

I have changed the Elasticsearch Host in the APM Server configuration. Here's my APM Yaml File

################################ APM Server ################################

apm-server:

Defines the host and port the server is listening on. Use "unix:/path/to.sock" to listen on a unix domain socket.

host: "2.0.X.X:8200"

Maximum permitted size in bytes of a request's header accepted by the server to be processed.

#max_header_size: 1048576

Maximum amount of time to wait for the next incoming request before underlying connection is closed.

#idle_timeout: 45s

Maximum permitted duration for reading an entire request.

#read_timeout: 30s

#============================= Elastic Cloud =============================

These settings simplify using APM Server with the Elastic Cloud (https://cloud.elastic.co/).

The cloud.id setting overwrites the output.elasticsearch.hosts option.

You can find the cloud.id in the Elastic Cloud web UI.

#cloud.id:

The cloud.auth setting overwrites the output.elasticsearch.username and

output.elasticsearch.password settings. The format is <user>:<pass>.

#cloud.auth:

#================================ Outputs =================================

Configure the output to use when sending the data collected by apm-server.

#-------------------------- Elasticsearch output --------------------------
output.elasticsearch:

Array of hosts to connect to.

Scheme and port can be left out and will be set to the default (http and 9200).

In case you specify and additional path, the scheme is required: http://localhost:9200/path.

IPv6 addresses should always be defined as: https://[2001:db8::1]:9200.

hosts: ["2.0.X.X:9200"]

Boolean flag to enable or disable the output module.

#enabled: true

Set gzip compression level.

#compression_level: 0

Protocol - either http (default) or https.

#protocol: "https"

Configuring output.elasticsearch.hosts generally sounds right. Since the APM Server seems to ignore the configuration, can you provide some details about how you installed the server and how you are starting it?

Thanks its working @simitt i made some space changes in YAML which lead to indentation.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.