Skip to content

Commit

Permalink
adding doc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhexuany committed Jan 4, 2019
1 parent cb9dcc6 commit 6ddacd9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/how_to_use_tidb_as_metastore_db.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Setting TiDB as metastore db

Generally sparking, you need setup tidb first and then copy `hive-site.xml` into Spark's `conf`
directory.

## Setup TiDB

First you need have a TiDB cluster present, and then use a mysql client log into TiDB cluster.

You will need execute the following command:

```$xslt
CREATE USER 'hive'@'%' IDENTIFIED BY 'mine';
GRANT ALL PRIVILEGES ON metastore.* TO 'hive'@'%';
FLUSH PRIVILEGES;
```

It helps you create a user and grant access privileges to all databases and tables.

## Adding hive-site.xml configuration to Spark

Then you can find a sample conf file at config directory at [tispark](https://github.com/pingcap/tispark)
project. What you need to do is copy and paste such file into `SPARK_HOME/conf`.

After you finish these two steps, you are able to use tidb to store meta info of Spark.

0 comments on commit 6ddacd9

Please sign in to comment.