Skip to content

Instantly share code, notes, and snippets.

@vanch
vanch / failing node log
Last active March 15, 2021 19:33
es cluster bug
[pod/elasticsearch-master-1/elasticsearch] {"type": "server", "timestamp": "2021-03-15T19:32:02,579Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "elasticsearch", "nod
e.name": "elasticsearch-master-1", "message": "master not discovered or elected yet, an election requires 2 nodes with ids [5m__iT3jSQW1vwEV_xFwMQ, BkCL1vzsR7mUQRzWdrBLXg], have discovered [{elasticsearch-master
-1}{BkCL1vzsR7mUQRzWdrBLXg}{hd8g7UblT_CjTUTkEfIPsg}{10.233.84.50}{10.233.84.50:9300}{cdhilmrstw}{ml.machine_memory=2147483648, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=1073
741824}, {elasticsearch-master-2}{m9dArdVXSq-6GBEDR2wRIA}{TRIr99EFSjyYlvQVJXGasA}{10.233.118.54}{10.233.118.54:9300}{cdhilmrstw}{ml.machine_memory=2147483648, ml.max_open_jobs=20, xpack.installed=true, ml.max_jv
m_size=1073741824, transform.node=true}, {elasticsearch-master-0}{5m__iT3jSQW1vwEV_xFwMQ}{z2kJjCDeSBSuUVX6vB34cQ}{10.233.88.52}{10.233.88.52:9300}{cdhilmrstw}{ml.machine_memory
@vanch
vanch / nginx.conf
Last active May 16, 2023 13:11
Nginx perl JWT claim logging
load_module "modules/ngx_http_perl_module.so";
http {
perl_modules perl/lib;
perl_set $jwt_value "sub {
use strict;
use warnings;
my $r = shift;
my $jwt = $r->header_in('Authorization');
@vanch
vanch / hot_threads?threads=100
Last active April 20, 2019 08:02
ES cluster
::: {es2}{w1GuR3wsR-Sxw7hNg07Gjw}{-I2vfNjGTD2xSBx5A0pTQQ}{172.27.57.197}{172.27.57.197:9300}
Hot threads at 2017-12-04T15:23:17.346Z, interval=500ms, busiestThreads=100, ignoreIdleThreads=true:
11.0% (55.1ms out of 500ms) cpu usage by thread 'elasticsearch[es2][refresh][T#2]'
6/10 snapshots sharing following 26 elements
org.apache.lucene.codecs.perfield.PerFieldPostingsFormat$FieldsWriter.write(PerFieldPostingsFormat.java:140)
org.apache.lucene.index.FreqProxTermsWriter.flush(FreqProxTermsWriter.java:107)
org.apache.lucene.index.DefaultIndexingChain.flush(DefaultIndexingChain.java:134)
org.apache.lucene.index.DocumentsWriterPerThread.flush(DocumentsWriterPerThread.java:443)
org.apache.lucene.index.DocumentsWriter.doFlush(DocumentsWriter.java:539)
vanch@vanch-pad /tmp $ git init test
Инициализирован пустой репозиторий Git в /tmp/test/.git/
vanch@vanch-pad /tmp $ cd test
vanch@vanch-pad /tmp/test master $ mkdir etc
vanch@vanch-pad /tmp/test master $ git add etc
vanch@vanch-pad /tmp/test master $ git status
На ветке master
Начальный коммит
@vanch
vanch / get-pool
Last active March 28, 2016 15:56
qminer
#!/usr/bin/env ruby
# Copyright 2015 Ivan Bondarev
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@vanch
vanch / tg-send2chat
Last active October 29, 2017 04:52
zabbix telegram alertscript
#!/bin/bash
to=$1
subject=$2
body=$3
/usr/bin/telegram-cli --bot \
--profile bot \
--disable-names \
--disable-output \