Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration take no effect #197

Open
anny0739 opened this issue Feb 24, 2021 · 0 comments
Open

Configuration take no effect #197

anny0739 opened this issue Feb 24, 2021 · 0 comments

Comments

@anny0739
Copy link

anny0739 commented Feb 24, 2021

Configuration takes no effect. es_host config doesn't change.
May I Ask Why?

Error StackTrace

02:04:56.150Z ERROR elastalert-server:
    ProcessController:  Traceback (most recent call last):
      File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
        "__main__", fname, loader, pkg_name)
      File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
        exec code in run_globals
      File "/opt/elastalert/elastalert/create_index.py", line 262, in <module>
        main()
      File "/opt/elastalert/elastalert/create_index.py", line 258, in main
        create_index_mappings(es_client=es, ea_index=index, recreate=args.recreate, old_ea_index=old_index)
      File "/opt/elastalert/elastalert/create_index.py", line 24, in create_index_mappings
        esversion = es_client.info()["version"]["number"]
      File "/usr/lib/python2.7/site-packages/elasticsearch-7.0.2-py2.7.egg/elasticsearch/client/utils.py", line 84, in _wrapped
        return func(*args, params=params, **kwargs)
      File "/usr/lib/python2.7/site-packages/elasticsearch-7.0.2-py2.7.egg/elasticsearch/client/__init__.py", line 259, in info
        return self.transport.perform_request("GET", "/", params=params)
      File "/usr/lib/python2.7/site-packages/elasticsearch-7.0.2-py2.7.egg/elasticsearch/transport.py", line 353, in perform_request
        timeout=timeout,
      File "/usr/lib/python2.7/site-packages/elasticsearch-7.0.2-py2.7.egg/elasticsearch/connection/http_requests.py", line 139, in perform_request
        raise ConnectionError("N/A", str(e), e)
    elasticsearch.exceptions.ConnectionError: ConnectionError(HTTPConnectionPool(host='localhost', port=9200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd6d9e86bd0>: Failed to establish a new connection: [Errno 111] Connection refused',))) caused by: ConnectionError(HTTPConnectionPool(host='localhost', port=9200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd6d9e86bd0>: Failed to establish a new connection: [Errno 111] Connection refused',)))
    

Config.json

{
  "appName": "elastalert-server",
  "port": 3030,
  "wsport": 3333,
  "elastalertPath": "/opt/elastalert",
  "verbose": false,
  "es_debug": false,
  "debug": false,
  "rulesPath": {
    "relative": true,
    "path": "/rules"
  },
  "templatesPath": {
    "relative": true,
    "path": "/rule_templates"
  },
  "es_host": "xxx.xxx.xx.net",
  "es_port": 9200,
  "writeback_index": "elastalert_status"
}

Elastalert.yaml

es_host: xxx.xxx.xx.net
es_port: 9200

Dockerfile

FROM bitsensor/elastalert:3.0.0-beta.1

USER root

RUN apk update && \
    apk add bash curl && \
    rm -rf /var/cache/apk/* && \
    rm -rf /opt/elastalert-server/config/elastalert-test.yaml && \
    rm -rf /opt/elastalert-server/config/elastalert.yaml && \
    rm -rf /opt/elastalert-server/rule_templates/* && \
    rm -rf /opt/elastalert-server/config/*

COPY --chown=node:node config/config.json /opt/elastalert-server/config/config.json
COPY --chown=node:node config/config.yaml /opt/elastalert-server/config/elastalert.yaml
COPY --chown=node:node rules/ /opt/elastalert-server/rules

USER node

ENTRYPOINT ["/bin/sh", "-c", "sed -i 's|10000|60000|' src/common/websocket.js && npm start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant