multi es-instances support#1225
multi es-instances support#1225clarkchen wants to merge 3 commits intoYelpArchive:masterfrom clarkchen:master
Conversation
|
hello? |
| 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.
es_port
Though, this also isn't necessary.
| 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.
This check isn't necessary, it's always there.
| return parsed_conf | ||
|
|
||
|
|
||
| def parse_host(host, port="9200"): |
There was a problem hiding this comment.
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