Skip to content

Instantly share code, notes, and snippets.

View kstdennis's full-sized avatar

Kim St. Dennis kstdennis

View GitHub Profile
@kstdennis
kstdennis / vaultsealmanager.sh
Created May 1, 2017 22:49 — forked from ccampanale/vaultsealmanager.sh
Bash shell script to check seal status for local vault server and attempt to unseal using keys secured in vault secret store. Supports HA Vault clusters with TLS with unseal keys stored as secrets in vault (see code). Relies on registered service vault.service.consul, in place DNS configuration, and a single unsealed vault instance in your clust…
#!/bin/bash
export vault=/usr/local/bin/vault
export VAULT_TOKEN=$(cat /root/.vault-token)
vault_cacert='-ca-cert=/path/to/your/ca.pem'
local_vault="-address=https://$(hostname -f):8200"
unsealed_vault="-address=https://$(getent hosts $(dig +short vault.service.consul | tail -n 1) | awk '{ print $2 }'):8200"
leader_vault="-address=https://$($vault status $vault_cacert $unsealed_vault 2> /dev/null | grep Leader | awk '{ print $2 }' | sed 's/^http\(\|s\):\/\///g'):8200"
vault_read="$vault read $vault_cacert $leader_vault"
vault_unseal="$vault unseal $vault_cacert $local_vault"
eda-kafka-central-prod-uswest2-01.otsql.opentable.com
/opt/kafka/logs/server.log.2019-09-09-01:[2019-09-09 01:02:22,490] ERROR Error while creating ephemeral at /brokers/ids/1, node already exists and owner '246874773735211023' does not match current session '246874773735211024' (kafka.zk.KafkaZkClient$CheckedEphemeral)
/opt/kafka/logs/server.log.2019-09-09-01:[2019-09-09 01:02:35,571] ERROR Error while creating ephemeral at /brokers/ids/1, node already exists and owner '246874773735211023' does not match current session '102759586400960526' (kafka.zk.KafkaZkClient$CheckedEphemeral)
/opt/kafka/logs/server.log.2019-09-09-01:[2019-09-09 01:03:05,413] ERROR Error while creating ephemeral at /brokers/ids/1, node already exists and owner '246874773735211025' does not match current session '174817179694661655' (kafka.zk.KafkaZkClient$CheckedEphemeral)
/opt/kafka/logs/server.log.2019-09-09-01:[2019-09-09 01:03:20,131] ERROR Error while creating ephemeral at /brokers/ids/1, node already exists and owner '246874773735