Altinity / clickhouse-backup

Tool for easy backup and restore for ClickHouse® using object storage for backup files.
https://altinity.com
Other
1.25k stars 225 forks source link

How to use the tool when CH cluster is run in docker #421

Closed nrukavkov closed 2 years ago

nrukavkov commented 2 years ago

Hello. Thank you for your solution. But how to use the tool when CH cluster is run in docker? Do I need to install tool inside every docker instance in cluster? Or I can somehow to use it on the host?

Slach commented 2 years ago

if you run clickhouse inside docker you also should need to run clickhouse-backup in docker clickhouse-backup provide docker images clickhouse-backup require access to the same volumes as clickhouse-server container docker-compose.yaml should look like that:

services:
  clickhouse-server:
    image: clickhouse/clickhouse-server:latest
    volumes:
      - /var/lib/clickhouse
  clickhouse-backup:
    image: altinity/clickhouse-backup:latest
    environment:
      API_CREATE_INTEGRATION_TABLES: "true"
    command: 
      - clickhouse-backup
      - server  
    volumes_from: 
      - clickhouse-backup
Slach commented 2 years ago

after docker-compose up look to https://github.com/Altinity/clickhouse-backup/#api and

and system.backup_actions and system.backup_list tables inside clickhouse-server container