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
// cc -g2 example_journal_reader.c -lsystemd | |
#include <stdio.h> | |
#include <time.h> | |
#include <errno.h> | |
#include <sys/poll.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <systemd/sd-journal.h> |
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
sh-4.2$ cat operations.template.json | |
{ | |
"order" : 20, | |
"template" : ".operations.*", | |
"settings" : { | |
"index" : { | |
"number_of_shards" : "3" | |
} | |
} | |
} |
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
def get_pod_metadata(key, namespace_name, pod_name, record_create_time) | |
metadata = nil | |
ids = @id_cache[key] | |
if !ids.nil? | |
# FAST PATH | |
# Cache hit, fetch metadata from the cache | |
metadata = @cache.fetch(ids[:pod_id]) do | |
@stats.bump(:pod_cache_miss) | |
m = fetch_pod_metadata(namespace_name, pod_name) | |
(m.nil? || m.empty?) ? {'pod_id'=>ids[:pod_id]} : m |
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/env python | |
import sys | |
import os | |
import json | |
if sys.argv[1] == '-': | |
pods = json.load(sys.stdin) | |
else: | |
with open(sys.argv[1], "r") as fp: |
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
#!/bin/bash | |
ES_URL='https://localhost:9200' | |
curl_post='curl -s -X POST --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
date | |
$curl_post $ES_URL/_cluster/reroute?pretty=true -d "{ \"commands\" : [ { \"allocate\" : { \"index\" : \"$2\", \"shard\" : 0, \"node\" : \"$1\", \"allow_primary\": \"true\" } } ] }" |
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
#!/bin/bash | |
ES_URL='https://localhost:9200' | |
curl_put='curl -s -X PUT --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
$curl_put $ES_URL/${1}/_settings?pretty -d '{ "index" : { "auto_expand_replicas" : "false" } }' | |
$curl_put $ES_URL/${1}/_settings?pretty -d '{ "index" : { "number_of_replicas" : 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
#!/bin/bash | |
# The actively running controller returns 200 for /controllers on port 8444. | |
oc get --raw /controllers --server https://localhost:8444 | |
# You'll get 201 accepted if the controller is waiting |
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
#!/bin/bash | |
_BASE=/etc/fluent/keys | |
_CA=$_BASE/ca | |
_CERT=$_BASE/cert | |
_KEY=$_BASE/key | |
ls -l $_CA $_CERT $_KEY | |
ES_URL='https://logging-es:9200' | |
curl_get="curl -X GET --cacert $_CA --cert $_CERT --key $_KEY" |
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
root@ip-172-31-49-18: ~ # export espod=logging-es-data-master-siovwe17-7-hxpp9 | |
root@ip-172-31-49-18: ~ # oc exec $espod -- curl -s -k --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key https://localhost:9200/_cat/thread_pool?v\&h=host,bulk.rejected,bulk.queue,bulk.queueSize,bulk.largest,bulk.completed | |
host bulk.rejected bulk.queue bulk.queueSize bulk.largest bulk.completed | |
172.20.9.25 0 0 404 0 0 | |
172.20.1.25 0 0 404 4 35 | |
172.20.2.30 0 0 404 4 18 |
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
#!/bin/bash | |
ES_URL='https://localhost:9200' | |
curl_get='curl -s -X GET --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
# Full Date Stamp Epoch Timestamp Count | |
# 2017-07-11T02:25:50 1499739950 02:25:50 36208782 | |
for i in {1..30}; do | |
echo "$(date +%Y-%m-%dT%H:%M:%S) $($curl_get $ES_URL/_cat/count)" |