Elasticsearch unknown setting [xpack.license.self_generated.type]

7/3/2018

I'm upgrading my elasticsearch on kubernetes cluster from 5.6.10 to elasticsearch 6.1.4. However, I can't even get es 6.1.4 to launch.

I keep getting the error unknown setting [xpack.license.self_generated.type].

Per the docs, I tried setting the value to basic, xpack.license.self_generated.type=basic and I've also omitted the value all together.

I've seen a few others run into this error but none of their fixes have worked for me.

Help is much appreciated!

My stateful set yaml

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: elastic-data
  labels:
    app: elastic-data
    area: devs
    role: nosql
    version: "6.1.4"
    environment: elastic
spec:
  serviceName: elastic-data
  replicas: 1
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: elastic-data
        area: devs
        role: nosql
        version: "6.1.4"
        environment: elastic
      annotations:
        pod.beta.kubernetes.io/init-containers: '[
          {
          "name": "sysctl",
            "image": "busybox",
            "imagePullPolicy": "IfNotPresent",
            "command": ["sysctl", "-w", "vm.max_map_count=262144"],
            "securityContext": {
              "privileged": true
            }
          }
        ]'
    spec:
      terminationGracePeriodSeconds: 10
      securityContext:
        runAsUser: 1000
        fsGroup: 1000
      containers:
      - name: elastic-data
        image: docker.elastic.co/elasticsearch/elasticsearch:6.1.4
        resources:
          requests:
            memory: "512Mi"
          limits:
            memory: "1024Mi"
        env:
        - name: ES_JAVA_OPTS
          value: -Xms512m -Xmx512m
        command: ["/bin/bash", "-c", "~/bin/elasticsearch-plugin remove x-pack; elasticsearch"]
        args:
        - -Ecluster.name=elastic-devs
        - -Enode.name=${HOSTNAME}
        - -Ediscovery.zen.ping.unicast.hosts=elastic-master.default.svc.cluster.local
        - -Enode.master=false
        - -Enode.data=true
        - -Enode.ingest=false
        - -Enetwork.host=0.0.0.0
        - -Expack.license.self_generated.type=basic    
        ports:
        - containerPort: 9300
          name: transport
        - containerPort: 9200
          name: http
        volumeMounts:
        - name: data-volume
          mountPath: /usr/share/elasticsearch/data
        readinessProbe:
          tcpSocket:
            port: 9300
          initialDelaySeconds: 30
          periodSeconds: 30
          timeoutSeconds: 3
        livenessProbe:
          tcpSocket:
            port: 9300
          initialDelaySeconds: 30
          periodSeconds: 30
          timeoutSeconds: 3
  volumeClaimTemplates:
  - metadata:
      name: data-volume
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 2Gi
-- Mike
elasticsearch
google-kubernetes-engine
kubernetes

1 Answer

7/4/2018

As they are trying to communicate, you forgot to remove the configuration property from config/elasticsearch.yml. So, the full revised command: would be

~/bin/elasticsearch-plugin remove x-pack
sed -i.bak -e /xpack.license.self_generated.type/d config/elasticsearch.yml
elasticsearch

Don't get me wrong, it's very silly of them to bomb over a config property for something that doesn't exist, but that's apparently the way it is.


p.s. you may be happier with the --purge option, since when I tried that command locally elasticsearch-plugin cheerfully advised:

-> preserving plugin config files [/usr/share/elasticsearch/config/x-pack] in case of upgrade; use --purge if not needed

thus: ./bin/elasticsearch-plugin remove x-pack --purge

-- mdaniel
Source: StackOverflow