clickhouse-mysql-data-reader icon indicating copy to clipboard operation
clickhouse-mysql-data-reader copied to clipboard

Does not rotate logs?

Open sv3t0sl4v opened this issue 4 years ago • 0 comments

Using logrotate on Ubuntu this could be achieved. I noticed clickhouse-mysql does not do it by itself.

Create file /etc/logrotate.d/clickhouse-mysql and add

/path/to//your/log/from/config { 
    daily
    create 0644 root root
    rotate 7
    compress
    postrotate
        service clickhouse-mysql restart
    endscript
}

Make sure to record MySQL binlog position in a file on disk, so it can resume from where it was. By default Ubuntu runs logrotate every day at 6:25 AM. Cheers!

sv3t0sl4v avatar Feb 13 '21 07:02 sv3t0sl4v