-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
multi es-instances support #1225
Conversation
hello? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation?
if "es_host" in conf: | ||
es_host = os.environ.get('ES_HOST', conf['es_host']) | ||
|
||
if "es_host" in conf: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
es_port
Though, this also isn't necessary.
parsed_conf['es_url_prefix'] = '' | ||
parsed_conf['es_conn_timeout'] = conf.get('es_conn_timeout', 20) | ||
parsed_conf['send_get_body_as'] = conf.get('es_send_get_body_as', 'GET') | ||
|
||
if "es_host" in conf: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check isn't necessary, it's always there.
@@ -344,6 +347,18 @@ def build_es_conn_config(conf): | |||
return parsed_conf | |||
|
|||
|
|||
def parse_host(host, port="9200"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not accept a list instead of a comma separated string?
Nice! I've just started working on a similar feature :) How this one is going to work? |
I guess the motivation here is that you could replace a load balancer by having a pool of servers to roundrobin requests to. |
I see.. My idea was more for multiple environments support |
So you implemented this feature to avoid duplicating YAML files, is that correct? You can import bits and pieces of rules, so you could specify two files with just a es_host, name and import parameter. |
Yes, I wanted to avoid duplicating cause I have one rule with 2/3 ES hosts I want to run it on. |
*Not one rule actually, I need to run all my rules on few es_hosts |
Can we make use of the above modified
|
Can you resolve conflicts please :) |
sorry, I have lost my origin repo, so I start a new pull request, where you can review code there. thx~ |
the I add a test case which connect with a docker-composed elastic cluste you can find the test case here hope it will work |
I take advantages of Elasticsearch, make host param as a list.
Host Config Change to
"host1:port1, host2:port " can handle multi es-instances
while the original port and host can also work well here