How to fix a broken ES 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: cert-manager.io/v1 | |
| kind: Issuer | |
| metadata: | |
| name: my-issuer | |
| spec: | |
| selfSigned: {} | |
| --- | |
| apiVersion: cert-manager.io/v1 | |
| kind: Certificate | |
| metadata: |
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
| { | |
| "info": { | |
| "name": "Configure elasticsearch", | |
| "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" | |
| }, | |
| "item": [ | |
| { | |
| "id": "livecycle-delete", | |
| "name": "Remove existing livecycle", | |
| "request": { |
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
| # Our cluster is a 3 master nodes / 3 data nodes cluster, setup via Helm chart and we are running out of disk space | |
| # "conso-es-data" is the "data nodes" Helm release | |
| # Change ES cluster setting, to rebalance shards faster | |
| PUT _cluster/settings | |
| { | |
| "persistent": { | |
| "cluster.routing.allocation.enable": "all", | |
| "cluster.routing.allocation.node_concurrent_recoveries" : 10, |
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
| - name: Bump version - patch | |
| set_fact: | |
| version_major: "{{ cidre.version.current | regex_replace('^v(?P<major>[0-9]+)\\.(?P<minor>[0-9]+)\\.(?P<patch>[0-9]+)$', '\\g<major>') }}" | |
| version_minor: "{{ cidre.version.current | regex_replace('^v(?P<major>[0-9]+)\\.(?P<minor>[0-9]+)\\.(?P<patch>[0-9]+)$', '\\g<minor>') }}" | |
| version_patch: "{{ cidre.version.current | regex_replace('^v(?P<major>[0-9]+)\\.(?P<minor>[0-9]+)\\.(?P<patch>[0-9]+)$', '\\g<patch>') }}" | |
| - name: Bump version - patch | |
| when: "'cidre_bump_patch' in ansible_run_tags" | |
| set_fact: | |
| version_patch: "{{ version_patch | int + 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
| import gitlab | |
| import urllib3 | |
| import humanfriendly | |
| import timeago, datetime | |
| # 2020-04-24T12:04:26.475+00:00 | |
| date_now = datetime.datetime.now() | |
| urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
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
| docker-compose config | docker run -i karlkfi/yq -r ".services.my_service_name" |
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
| --- | |
| - hosts: recette | |
| become: yes | |
| become_user: root | |
| vars: | |
| gitlab_url: https://XXXXXX | |
| gitlab_runner_registration_token: XXXXX | |
| tasks: | |
| - name: setup user | |
| user: |
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
| --- | |
| - hosts: recette | |
| become: yes | |
| become_user: root | |
| tasks: | |
| - name: "Get Linux uname's" | |
| command: "uname -{{ item }}" | |
| register: unames | |
| with_items: ["s", "m"] | |
| - set_fact: |
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
| #!/usr/bin/python3 | |
| import argparse, json, requests | |
| parser = argparse.ArgumentParser(description='Create automatically index patterns, from elasticsearch indices.') | |
| parser.add_argument('elasticsearch_url',type=str, help='elasticsearch full URL') | |
| parser.add_argument('kibana_url', type=str, help='kibana full URL') | |
| args = parser.parse_args() |