Failed to obtain a connection with the database Metricbeat

Hi,

I have below issue on metricbeat logs. I have using all applications are in docker containers (metricbeat, postgresql, elasticsearch, kibana). Any help on this?

Error from metricbeat:
(1) Error
INFO module/wrapper.go:252 Error fetching data for metricset postgresql.activity: error in QueryStats: failed to obtain a connection with the database: dial tcp 127.0.0.1:6430: connect: connection refused.

(2) Error
ERROR pipeline/output.go:100 Failed to connect to backoff(elasticsearch(http://elasticsearch:9200)): Connection marked as failed because the onConnect callback failed: resource 'metricbeat-7.6.2' exists, but it is not an alias.

metricbeat.yml configurations:

metricbeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false

processors:
#- add_cloud_metadata: ~

  • add_docker_metadata: ~

setup.kibana:
host: "kibana:5601"
#username: "my_kibana_user"
#password: "YOUR_PASSWORD"

output.elasticsearch:
hosts: ["elasticsearch:9200"]

postgresql.yml (modules.d directory in metricbeat)

  • module: postgresql
    metricsets:
    • database
    • bgwriter
    • activity
      period: 10s
      hosts: ["postgres://localhost:6430?sslmode=disable"]
      username: data (database logging user)
      #password: ""

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