How to fix a broken ES cluster
Last active
January 4, 2021 11:28
-
-
Save ebuildy/fe54d92fe0df44863595a464a7f3476a to your computer and use it in GitHub Desktop.
Fix broken elasticsearch cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: batch/v1 | |
| kind: Job | |
| metadata: | |
| name: test-fix-cluster-m0 | |
| spec: | |
| template: | |
| spec: | |
| containers: | |
| - args: | |
| - -c | |
| - yes | elasticsearch-node detach-cluster; yes | elasticsearch-node remove-customs '*' | |
| command: | |
| - /bin/sh | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1 | |
| name: elasticsearch | |
| volumeMounts: | |
| - mountPath: /usr/share/elasticsearch/data | |
| name: es-data | |
| restartPolicy: Never | |
| volumes: | |
| - name: es-data | |
| persistentVolumeClaim: | |
| claimName: es-test-master-es-test-master-0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: batch/v1 | |
| kind: Job | |
| metadata: | |
| name: test-fix-cluster-m1 | |
| spec: | |
| template: | |
| spec: | |
| containers: | |
| - args: | |
| - -c | |
| - yes | elasticsearch-node detach-cluster; yes | elasticsearch-node remove-customs '*' | |
| command: | |
| - /bin/sh | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1 | |
| name: elasticsearch | |
| volumeMounts: | |
| - mountPath: /usr/share/elasticsearch/data | |
| name: es-data | |
| restartPolicy: Never | |
| volumes: | |
| - name: es-data | |
| persistentVolumeClaim: | |
| claimName: es-test-master-es-test-master-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: batch/v1 | |
| kind: Job | |
| metadata: | |
| name: test-fix-cluster-m2 | |
| spec: | |
| template: | |
| spec: | |
| containers: | |
| - args: | |
| - -c | |
| - yes | elasticsearch-node remove-customs '*' | |
| - yes | elasticsearch-node unsafe-bootstrap -v | |
| command: | |
| - /bin/sh | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1 | |
| name: elasticsearch | |
| volumeMounts: | |
| - mountPath: /usr/share/elasticsearch/data | |
| name: es-data | |
| restartPolicy: Never | |
| volumes: | |
| - name: es-data | |
| persistentVolumeClaim: | |
| claimName: es-test-master-es-test-master-2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| helm upgrade --version=7.10.1 --values=values.yaml --install test-es elastic/elasticsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clusterName: test | |
| fullnameOverride: es-test-master | |
| esConfig: | |
| elasticsearch.yml: | | |
| xpack.ml.enabled: false | |
| logger.org.elasticsearch.discovery: INFO | |
| masterService: "es-test-master" | |
| minimumMasterNodes: 1 | |
| maxUnavailable: false | |
| esJavaOpts: -Xmx500m -Xms500m | |
| nodeGroup: master | |
| replicas: 3 | |
| resources: | |
| limits: | |
| cpu: '1' | |
| memory: 2Gi | |
| requests: | |
| cpu: '0.5' | |
| memory: 0.5Gi | |
| roles: | |
| data: 'false' | |
| ingest: 'false' | |
| master: 'true' | |
| ml: 'false' | |
| remote_cluster_client: 'false' | |
| volumeClaimTemplate: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: 1Gi | |
| storageClassName: csi-ceph-block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment