根据medcl大大的说明文档手动配置一个yml文件,如下所示:
所以是否是我的配置仍有问题,有没有兄弟们知道的,诚心求助。
path.data: data
path.logs: log
entry:
- name: test_entry
enabled: true
router: default
max_concurrency: 20000
network:
binding: 0.0.0.0:8000
router:
- name: default
tracing_flow: request_logging
default_flow: rate_limit_flow
flow:
- name: request_logging
filter:
- request_path_filter:
must_not: # any match will be filtered
prefix:
- /favicon.ico
- request_header_filter:
exclude:
- app: kibana
- logging:
queue_name: request_logging
- name: cache_first
filter:
- get_cache:
- elasticsearch:
elasticsearch: test_cluster
- set_cache:
- name: rate_limit_flow
filter:
- echo:
message: "hello gateway\n"
repeat: 3
- request_path_limiter:
message: "Hey, You just reached our request limit!"
rules:
- pattern: "/(?P<index_name>test202110)/_search"
max_qps: 1
group: index_name
- pattern: "/(?P<index_name>.*?)/_search"
max_qps: 100
group: index_name
- elasticsearch:
elasticsearch: test_cluster
pipeline:
- name: request_logging_index
processor:
- json_indexing:
index_name: "gateway_requests"
elasticsearch: "test_cluster"
input_queue: "request_logging"
idle_timeout_in_seconds: 1
worker_size: 1
bulk_size_in_mb: 10 #in MB
elasticsearch:
- name: test_cluster
enabled: true
endpoints: localhost:9200
discovery:
enabled: true
refresh:
enabled: true
之后启动gateway,这时候一切正常,但是一旦执行命令访问8000端口就什么都不会返回:curl: (52) Empty reply from server
之后尝试更换default_flow为cache_first,一切正常。所以是否是我的配置仍有问题,有没有兄弟们知道的,诚心求助。
1 个回复
medcl - 今晚打老虎。
赞同来自:
http://release.elasticsearch.cn/gateway/snapshot/
另外你上面的配置也有点小问题,endpoint 需要填完整的地址,host 则不需要,完整的配置如下: