elasticsearch_exporter icon indicating copy to clipboard operation
elasticsearch_exporter copied to clipboard

environment not working

Open whithen opened this issue 4 years ago • 2 comments

set environment es.uri but get error level=error ts=2020-12-01T01:35:54.562828428Z caller=clusterinfo.go:253 msg="failed to get cluster info" err="Get http://localhost:9200/: dial tcp 127.0.0.1:9200: connect: connection refused" level=error ts=2020-12-01T01:35:54.562851742Z caller=clusterinfo.go:174 msg="failed to retrieve cluster info from ES" err="Get http://localhost:9200/: dial tcp 127.0.0.1:9200: connect: connection refused" level=warn ts=2020-12-01T01:36:07.113334574Z caller=nodes.go:1851 msg="failed to fetch and decode node stats" err="failed to get cluster health from http://localhost:9200_nodes/_local/stats: Get http://localhost:9200/_nodes/_local/stats: dial tcp 127.0.0.1:9200: connect: connection refused" level=warn ts=2020-12-01T01:36:07.113345216Z caller=cluster_health.go:270 msg="failed to fetch and decode cluster health" err="failed to get cluster health from http://localhost:9200/_cluster/health: Get http://localhost:9200/_cluster/health: dial tcp 127.0.0.1:9200: connect: connection refused" deployment.yaml

apiVersion: apps/v1 kind: Deployment metadata: labels: app: elasticsearch-exporter name: elasticsearch-exporter namespace: monitoring spec: replicas: 1 selector: matchLabels: app: elasticsearch-exporter template: metadata: labels: app: elasticsearch-exporter spec: containers: - env: - name: es.all value: "true" - name: es.cluster_settings value: "true" - name: es.indices value: "true" - name: es.indices_settings value: "true" - name: es.shards value: "true" - name: es.ssl-skip-verify value: "true" - name: es.uri value: https://elastic:[email protected]:9200 image: justwatch/elasticsearch_exporter imagePullPolicy: Always name: elasticsearch-exporter ports: - containerPort: 9114 name: metrics protocol: TCP

whithen avatar Dec 01 '20 01:12 whithen

Hi, according to docs, env varialbes should use UPPERCASE

Also, all commandline parameters can be provided as environment variables. The environment variable name is derived from the parameter name by replacing . and - with _ and upper-casing the parameter name.

example:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: elasticsearch-exporter
  name: elasticsearch-exporter
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: elasticsearch-exporter
  template:
    metadata:
      labels:
        app: elasticsearch-exporter
    spec:
      containers:
      - name: elasticsearch-exporter
        image: justwatch/elasticsearch_exporter
        imagePullPolicy: Always
        ports:
        - containerPort: 9114
          name: metrics
          protocol: TCP
        env:
          - name: ES_ALL
            value: "true"
          - name: ES_CLUSTER_SETTINGS
            value: "true"
          - name: ES_INDICES
            value: "true"
          - name: ES_INDICES_SETTINGS
            value: "true"
          - name: ES_SHARDS
            value: "true"
          - name: ES_SSL_SKIP_VERIFY
            value: "true"
          - name: ES_URI
            value: https://YOUR_URL_HERE

NovikovEvgeny avatar Dec 01 '20 10:12 NovikovEvgeny

i got it ,thx @NovikovEvgeny

whithen avatar Dec 02 '20 07:12 whithen