Skip to content

Instantly share code, notes, and snippets.

Avatar

Lukáš Vlček lukas-vlcek

View GitHub Profile
View Increase log levels on ES cluster in OCP
oc exec <es_pod> -c elasticsearch -- es_util --query=_cluster/settings?flat_settings=true -X PUT -d \
'{
"transient": {
"logger": {
"org.elasticsearch.ingest.openshift": "TRACE",
"org.elasticsearch.action": "DEBUG"
}
}
}'
View com.redhat.viaq-openshift-project.template.json
{
"aliases": {
".all": {
}
},
"index_patterns": [
"app*"
],
"mappings": {
@lukas-vlcek
lukas-vlcek / gist:a61aea97ebe4c2bf22651c3694e76c71
Last active Aug 9, 2019
Dots in fields problem when upgrading from ES2 to ES5
View gist:a61aea97ebe4c2bf22651c3694e76c71
# Start fresh ES 2.4.6 with dots in field names enabled
$ ES_JAVA_OPTS="-Dmapper.allow_dots_in_name=true" ./bin/elasticsearch
# Index two documents with conflisting mappings (conflisting from the ES5 perspective)
# See: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/dots-in-names.html#_upgrading_fields_with_dots_to_5_x
$ curl -X POST localhost:9200/test/type -d '{"foo.bar":1}'
{"_index":"test","_type":"type","_id":"AWx2N0zkYS6E_SuIWEKX","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
$ curl -X POST localhost:9200/test/type2 -d '{"foo":1}'
View gist:f659ad6157e185d6d869770fc660bccd
$ oc describe po ruby-ex-1-r72kx
Name: ruby-ex-1-r72kx
Namespace: lvlcek
Priority: 0
PriorityClassName: <none>
Node: ip-10-0-155-48.us-east-2.compute.internal/10.0.155.48
Start Time: Mon, 24 Jun 2019 14:58:56 +0200
Labels: app=ruby-ex
deployment=ruby-ex-1
deploymentconfig=ruby-ex
@lukas-vlcek
lukas-vlcek / gist:7a19dd6e66e3366e869114c58223e771
Last active Jan 22, 2019
5.x release tags of Prometheus ES plugin
View gist:7a19dd6e66e3366e869114c58223e771
Tag Correct hash Wrong hash Should have been Note
master, 5.x master, 5.x 5.x
5.6.14.0 0d0b738 c5794ed
5.6.13.1 1c24705 15d9cb3
5.6.13.0 9367988 2dafc5e
5.6.12.0 f50587e ce171c7
5.6.11.0 a4a149f 112bb35
5.6.10.0 89f9cb2 a08fdbf
5.6.9.1 ab155c7 27b1f30
View Blocked from mvn2 central
$ gradle clean
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'prometheus-exporter'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not download build-tools.jar (org.elasticsearch.gradle:build-tools:6.5.3)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/elasticsearch/gradle/build-tools/6.5.3/build-tools-6.5.3.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/elasticsearch/gradle/build-tools/6.5.3/build-tools-6.5.3.jar'. Received status code 403 from server: Forbidden
View gist:e0d839447f44a5655f9531e34d49abcd
$ uname -a
Darwin Lukass-MacBook-Pro-2.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
$ git remote -v
origin https://github.com/kubernetes-monitoring/kubernetes-mixin.git (fetch)
origin https://github.com/kubernetes-monitoring/kubernetes-mixin.git (push)
$ git status
On branch master
Your branch is up to date with 'origin/master'.
View gist:376be10b65e1491271bafa9c688a2b25
$ uname -a
Linux dhcp-2-178.brq.redhat.com 4.15.17-200.fc26.x86_64 #1 SMP Thu Apr 12 18:28:26 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ git remote -v
origin https://github.com/kubernetes-monitoring/kubernetes-mixin.git (fetch)
origin https://github.com/kubernetes-monitoring/kubernetes-mixin.git (push)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
View gist:c9102428242b107122cfa480bfc18c06
[lvlcek@dhcp-2-178 test-deploy]$ make WHAT=lvlcek sh
cd "gcp-dev"/ && ../../bin/ansible.sh
Activated service account credentials for: [aos-serviceaccount@openshift-gce-devel.iam.gserviceaccount.com]
bash-4.2$ pwd
/usr/share/ansible/openshift-ansible
bash-4.2$ ansible-playbook -i inventory playbooks/openshift-grafana/config.yml
[WARNING]: * Failed to parse /usr/share/ansible/openshift-ansible/inventory/dynamic/gcp/hosts.py with script plugin: Inventory script (/usr/share/ansible/openshift-
ansible/inventory/dynamic/gcp/hosts.py) had an execution error: Traceback (most recent call last): File "/usr/share/ansible/openshift-
@lukas-vlcek
lukas-vlcek / gist:dd126b41ac61d2c36908666ccf369e48
Created May 7, 2018
Prometheus metrics pulled from ES node
View gist:dd126b41ac61d2c36908666ccf369e48
sh-4.2$ es_util --query=_prometheus/metrics
# HELP es_indices_percolate_count Count of percolates
# TYPE es_indices_percolate_count counter
es_indices_percolate_count{cluster="logging-es",node="logging-es-data-master-f5trnjwj",nodeId="q5KN3f6TQnGMlwAhH9wbjQ",} 0.0
# HELP es_transport_rx_bytes_count Bytes received
# TYPE es_transport_rx_bytes_count counter
es_transport_rx_bytes_count{cluster="logging-es",node="logging-es-data-master-f5trnjwj",nodeId="q5KN3f6TQnGMlwAhH9wbjQ",} 19695.0
# HELP es_script_compilations_count Number of scripts compilations
# TYPE es_script_compilations_count counter
es_script_compilations_count{cluster="logging-es",node="logging-es-data-master-f5trnjwj",nodeId="q5KN3f6TQnGMlwAhH9wbjQ",} 0.0