cllickhouse-keeper
have configuration in XML format,NuRaft
(quorum library) have internal state which stored/var/lib/clickhouse/coordination/state
24.8 clickhouse-keeper version allow rescale with declarative change the configs
cllickhouse-keeper
have configuration in XML format,NuRaft
(quorum library) have internal state which stored /var/lib/clickhouse/coordination/state
24.8 clickhouse-keeper version allow rescale with declarative change the configs
apiVersion: batch/v1 | |
kind: CronJob | |
metadata: | |
name: clickhouse-backup-cron | |
spec: | |
# every day at 00:00 | |
# schedule: "0 0 * * *" | |
schedule: "* * * * *" | |
concurrencyPolicy: "Forbid" | |
jobTemplate: |
<clickhouse> | |
<listen_host replace="replace">0.0.0.0</listen_host> | |
<logger> | |
<console>1</console> | |
</logger> | |
<keeper_server> | |
<tcp_port>2181</tcp_port> | |
</keeper_server> | |
</clickhouse> |
CHECKSUM_FILE=$1 | |
if [[ "ENC" == $(dd if="${CHECKSUM_FILE}" bs=1 skip="0" count="3" 2>/dev/null) ]]; then | |
echo "ENCRYPTED FILES don't supported" | |
exit 0 | |
fi | |
FORMAT_VERSION=$(head -n +1 "${CHECKSUM_FILE}" | sed 's/checksums format version: //g') | |
log() { printf '%s\n' "$*"; } | |
error() { log "ERROR: $*" >&2; } | |
fatal() { error "$@"; exit 1; } |
*.yaml |
services: | |
clickhouse: | |
image: ${CLICKHOUSE_IMAGE:-clickhouse/clickhouse-server}:${CLICKHOUSE_VERSION:-latest} | |
volumes: | |
- ./xml_user_grants.xml:/etc/clickhouse-server/users.d/xml_user_grants.xml |
<yandex> | |
<default><access_management>1</access_management></default> | |
</yandex> |
#!/bin/bash | |
backup_date=$(date +%Y-%m-%d-%H-%M-%S) | |
table_patterns=$1 # for example table_patterns="ns_v2.t_agg_page_h0?_local" | |
backup_name="full-$backup_date" | |
backup_command="create_remote --tables=$table_patterns $backup_name" | |
echo "RUN ${backup_command}" | |
echo "{\"command\":\"${backup_command}\"}" | curl -XPOST "http://localhost:7171/backup/actions" --data-binary=@- | |
while [[ "0" == $(curl -s "http://localhost:7171/backup/status" | grep -F "${backup_command}" | grep -c "success|error") ]]; do | |
printf "." |
import ( | |
"context" | |
"fmt" | |
"io" | |
"net/http" | |
"path" | |
"strings" | |
"time" | |
"cloud.google.com/go/storage" |