问题描述
我在fluent-bit中得到一个错误,基本上说它不能解析host
getaddrinfo(host='<My Elastic Cloud Instance>.aws.elastic-cloud.com:9243', err=4): Domain name not found
我怀疑它与在dns查找中附加的端口有关,但我似乎看不到在我的配置
中将两者连接在一起的任何设置我已经验证了在同一个名称空间中使用一个dnsutil pod,我能够正确解析主机
可能有帮助的信息
配置映射output-elasticsearch.conf
[OUTPUT]
Name es
Match *
Host ${CLOUD_ELASTICSEARCH_HOST}
Port ${CLOUD_ELASTICSEARCH_PORT}
Cloud_ID ${CLOUD_ELASTICSEARCH_ID}
Cloud_Auth ${CLOUD_ELASTICSEARCH_USER}:${CLOUD_ELASTICSEARCH_PASSWORD}
Logstash_Format On
Logstash_Prefix kube1
Replace_Dots On
Retry_Limit False
tls On
tls.verify Off
elasticsearch-configmap
data:
CLOUD_ELASTICSEARCH_HOST: <MyCloudId>.aws.elastic-cloud.com
CLOUD_ELASTICSEARCH_ID: >-
elastic-security-deployment:<Bunch of Random Bits>
CLOUD_ELASTICSEARCH_PORT: '9243'
我的守护进程的env部分
env:
- name: CLOUD_ELASTICSEARCH_HOST
valueFrom:
configMapKeyRef:
name: elasticsearch-configmap
key: CLOUD_ELASTICSEARCH_HOST
- name: CLOUD_ELASTICSEARCH_PORT
valueFrom:
configMapKeyRef:
name: elasticsearch-configmap
key: CLOUD_ELASTICSEARCH_PORT
- name: CLOUD_ELASTICSEARCH_ID
valueFrom:
configMapKeyRef:
name: elasticsearch-configmap
key: CLOUD_ELASTICSEARCH_ID
- name: CLOUD_ELASTICSEARCH_USER
valueFrom:
secretKeyRef:
name: elasticsearch-secret
key: CLOUD_ELASTICSEARCH_USER
- name: CLOUD_ELASTICSEARCH_PASSWORD
valueFrom:
secretKeyRef:
name: elasticsearch-secret
key: CLOUD_ELASTICSEARCH_PASSWORD
- name: FLUENT_ELASTICSEARCH_HOST
value: elasticsearch
- name: FLUENT_ELASTICSEARCH_PORT
value: '9200'
另外,如果您正在使用弹性云,请尝试解码${CLOUD_ELASTICSEARCH_ID}变量的值,删除:443
并再次编码。
我得到这个错误,它解决后这样做。
对于Elastic Cloud,尝试从输出中省略Host
和Port
:
[OUTPUT]
Name es
Match *
Cloud_ID ${CLOUD_ELASTICSEARCH_ID}
Cloud_Auth ${CLOUD_ELASTICSEARCH_USER}:${CLOUD_ELASTICSEARCH_PASSWORD}
Logstash_Format On
Logstash_Prefix kube1
Replace_Dots On
Retry_Limit False
tls On
tls.verify Off