如何将流畅的日志从一个K8s集群推送到另一个K8s集群中的ElasticSearch?
我有一个场景,我们有流畅的守护程序在多个K8s集群(C-1,C-2,C-3)上运行,而ElasticSearch在另一个K8s集群(C-4)上运行。我们希望将C-1,C-2和C-3的所有流利日志进行C-4弹性搜索。
这是我所做的:
在C-4集群中使用ES服务创建了一个入口主机条目,看起来像
es-entrypoint.logging.svc.cluster.local
可以使用C4群集的主IP从所有群集访问上述入口主机。
$curl -H "Host: es-entrypoint.logging.svc.cluster.local" http://10.11.1.44
{
"name" : "elasticsearch-logging-p57wl",
"cluster_name" : "kubernetes-logging",
"cluster_uuid" : "ox8jE56mTg630zdKtThPHQ",
"version" : {
"number" : "6.3.2",
"build_flavor" : "oss",
"build_type" : "tar",
"build_hash" : "053779d",
"build_date" : "2018-07-20T05:20:23.451332Z",
"build_snapshot" : false,
"lucene_version" : "7.3.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
---
apiVersion: v1
kind: Endpoints
metadata:
name: es-entrypoint
namespace: logging
subsets:
- addresses:
- ip: 10.11.1.44
ports:
- name: es-http
port: 80
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: es-entrypoint
namespace: logging
spec:
ports:
- name: es-http
port: 80
protocol: TCP
targetPort: 80
sessionAffinity: None
type: ClusterIP
现在,我可以使用curl http://es-entrypoint.logging.svc.cluster.local:80
从C-1,C-2和C-3集群中的Pod访问入口主机uri。这与kibana和除flunetD以外的所有豆荚均适用。
错误
2019-06-13 06:06:57 +0000 [警告]:[elasticsearch]无法刷新 缓冲。 retry_time = 10 next_retry_seconds = 2019-06-13 06:07:31 +0000 chunk =“ 58b2ddd4f511bc47e5bf7705f177cb2b” error_class = Fluent :: Plugin :: ElasticsearchOutput :: ConnectionFailure error =“无法到达Elasticsearch集群 ({:host => \“ es-entrypoint.logging.svc.cluster.local \”,:port => 80, :scheme => \“ http \”})!“
请找到流利的yml:
任何想法