Skip to content

Instantly share code, notes, and snippets.

View Slach's full-sized avatar
💭
deep diving into kuberntes

Eugene Klimov Slach

💭
deep diving into kuberntes
View GitHub Profile
@Slach
Slach / .gitignore
Last active January 1, 2025 17:42
superset + clickhouse docker-compose bootstrap
superset/
superset/clickhouse/
.idea/
@Slach
Slach / docker-compose.yaml
Created April 26, 2021 04:32
create MySQL8 working dictionary sample
version: "3"
services:
mysql8:
image: mysql:${MYSQL_VERSION:-latest}
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=1
volumes:
- ./mysql8_table.sql:/docker-entrypoint-initdb.d/mysql8_table.sql
- ./mysql8_log_queries.conf:/etc/mysql/conf.d/mysql8_log_queries.conf
clickhouse:
@Slach
Slach / docker-compose.yml
Last active July 8, 2021 12:56
system.detached_parts not works after change default storage policy to multi-disk
version: "3"
services:
clickhouse:
image: yandex/clickhouse-server:${CLICKHOUSE_VERSION:-latest}
@Slach
Slach / Dockerfile
Last active November 14, 2024 16:47
clickhouse with odbc, for docker-compose and kubernetes
FROM yandex/clickhouse-server:${CLICKHOUSE_VERSION:-latest}
USER root
ARG UBUNTU_NAME=focal
ARG UBUNTU_VERSION=20.04
RUN echo "Begin ODBC install" && \
#MySQL repo
wget -qO- "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xa4a9406876fcbd3c456770c88c718d3b5072e1f5" | apt-key add - && \
echo "deb http://repo.mysql.com/apt/ubuntu/ ${UBUNTU_NAME} mysql-8.0" >/etc/apt/sources.list.d/mysql-oracle.list && \
@Slach
Slach / README.md
Last active September 14, 2021 12:52
clickhouse-backup diff every hour

howto install this example?

mkdir -p /opt/clikchouse-backup-diff/
git clone https://gist.github.com/d6390005975b9643344e9ee935fa882a /opt/clikchouse-backup-diff/
chmod +x /opt/clikchouse-backup-diff/*.sh
cp -fv /opt/clikchouse-backup-diff/cron_example.txt /etc/cron.d/clickhouse_backup_diff
cp -fv /opt/clikchouse-backup-diff/clickhouse-backup-config-example.yml /etc/clickhouse-backup/config.yml
@Slach
Slach / sample.go
Created October 1, 2021 12:03
Google Cloud Storage (GCS) debug options
import (
"context"
"fmt"
"io"
"net/http"
"path"
"strings"
"time"
"cloud.google.com/go/storage"
@Slach
Slach / create.sh
Created October 7, 2021 12:57
clickhouse-backup selective create_remote \ restore_remote
#!/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 "."
@Slach
Slach / access_management.xml
Created October 25, 2021 07:11
ClickHouse Schema Migration control
<yandex>
<default><access_management>1</access_management></default>
</yandex>
@Slach
Slach / docker-compose.yaml
Created October 24, 2023 18:16
add XML users grants example
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
@Slach
Slach / .gitignore
Last active November 17, 2023 06:41
try to upgrade statefulset image without restart all clusters
*.yaml