##################################################
I am unable to make connection of elastalert2 with elasticsearch.
Getting below error in elastalert2 logs
NING:elasticsearch:GET http://Elasticsearch:9200/ [status:N/A request:0.021s]
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
elasticsearch.exceptions.ConnectionError: ConnectionError(HTTPConnectionPool(host='elasticsearch', port=9200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd8567d1f70>: Failed to establish a new connection: [Errno 111] Connection refused'))) caused by: ConnectionError(HTTPConnectionPool(host='elasticsearch', port=9200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd8567d1f70>: Failed to establish a new connection: [Errno 111] Connection refused')))
I am trying to connect elastalert2 with elasticsearch but unable to make connection
below is my docker-compose file
version: '3.6' services: Elasticsearch: image: elasticsearch:7.17.0 container_name: elasticsearch restart: always volumes:
'9300:9300' networks:
Logstash: image: logstash:7.17.0 container_name: logstash restart: always volumes:
'9600:9600' environment: LS_JAVA_OPTS: "-Xmx256m -Xms256m" networks:
Kibana: image: kibana:7.17.0 container_name: kibana restart: always ports:
'5601:5601' environment:
elastalert: image: jertel/elastalert2 container_name: elastalert2 volumes:
- ./elastalert/data:/opt/elastalert/data
environment:
volumes: elastic_data: {}
networks: elk
######################## Below is my config.yaml
This is the folder that contains the rule yaml files
rules_folder: /opt/elastalert/rules
run_every: minutes: 5
buffer_time: minutes: 15
Connect with TLS to Elasticsearch
use_ssl: False
Verify TLS certificates
verify_certs: False es_host: Elasticsearch es_port: 9200 es_username: elastic es_password: *** writeback_index: elastalert_status
alert_time_limit: days: 2
################################################## I am unable to make connection of elastalert2 with elasticsearch.
Getting below error in elastalert2 logs NING:elasticsearch:GET http://Elasticsearch:9200/ [status:N/A request:0.021s] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused
elasticsearch.exceptions.ConnectionError: ConnectionError(HTTPConnectionPool(host='elasticsearch', port=9200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd8567d1f70>: Failed to establish a new connection: [Errno 111] Connection refused'))) caused by: ConnectionError(HTTPConnectionPool(host='elasticsearch', port=9200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd8567d1f70>: Failed to establish a new connection: [Errno 111] Connection refused')))