-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |