Git Product home page Git Product logo

tidb-exporter's Introduction

tidb-exporter

简体中文

TiDB uses RocksDB as default storage engine(in fact, TiKV uses it). tidb-exporter can export data from pure RocksDB data files even when TiDB server is not running. This is very useful for exporting data in cases where TiDB is shut down for some reason and recovery is difficult.

Make sure TiDB or TiKV server is not running before using this tool. Only compatible with version v5.x and above.

tidb-exporter

List Databases

Specifing only the '-p' parameter will list all the databases on one of the TiKV nodes.

./tidb-exporter -p /data/tikv/db
1, test
10216, user
11455, xxl_job
11506, product
11558, task

The first column represents the inner sequence number of the databases, which is generated within TiDB. The second column contains the database name.

List Tables

In addition to the '-p' parameter, you have also set '-d', which will list all database tables of the specified database.

./tidb-exporter -p /data/tikv/db -d user
8980, user_avatar
11906, user_detail

Export Data

When Specifying the '-t' parameter to export data from a specified table, you should also specify the '-e' parameter to indicate which Exporter you want to use, although currently, only csv is available. Finally, use the '-w' to indicate the location to which the Exporter will write.

./tidb-exporter -p /data/tikv/db -d user -t user_avatar -e csv -w ~/user.csv

tidb-exporter exports all the data that has been stored in RocksDB, which means it will export regions even if they are not leaders in this TiKV node. If you have a cluster with three nodes, it will theoretically export all the data in the database.

tidb-exporter's People

Contributors

goalzz85 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zhanglei

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.