github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/pingcap/tidb/docs/HBASE_QUICKSTART.md (about) 1 # TiDB on HBase 2 3 4 **TiDB only supports HBase >= 0.98.5** 5 6 1) Build && Install pingcap/themis coprocessor to HBase: 7 8 1. git clone https://github.com/pingcap/themis.git 9 2. cd themis && mvn clean package -DskipTests 10 4. cp themis-coprocessor/target/themis-coprocessor-1.0-SNAPSHOT-jar-with-dependencies.jar $HBASE_ROOT/lib 11 5. Add configurations for themis coprocessor in hbase-site.xml: 12 13 ``` 14 <property> 15 <name>hbase.coprocessor.user.region.classes</name> 16 <value>org.apache.hadoop.hbase.themis.cp.ThemisEndpoint,org.apache.hadoop.hbase.themis.cp.ThemisScanObserver,org.apache.hadoop.hbase.regionserver.ThemisRegionObserver</value> 17 </property> 18 <property> 19 <name>hbase.coprocessor.master.classes</name> 20 <value>org.apache.hadoop.hbase.master.ThemisMasterObserver</value> 21 </property> 22 ``` 23 24 and then restart HBase. 25 26 27 2) Build TiDB: 28 29 ``` 30 git clone https://github.com/pingcap/tidb.git $GOPATH/src/github.com/pingcap/tidb 31 cd $GOPATH/src/github.com/pingcap/tidb 32 make 33 ``` 34 35 Run command line interpreter: 36 37 ``` 38 make interpreter 39 cd interpreter && ./interpreter -store hbase -dbpath localhost/tidb -dbname test 40 ``` 41 42 Enjoy it. 43 44 ``` 45 Welcome to the TiDB. 46 Version: 47 Git Commit Hash: f37bd11d16c79a3db1cdb068ef7a6c872f682cda 48 UTC Build Time: 2015-12-07 08:10:25 49 50 tidb> create table t1(id int, name text, key id(id)); 51 Query OK, 0 row affected (2.12 sec) 52 tidb> insert into t1 values(1, "hello"); 53 Query OK, 1 row affected (0.01 sec) 54 tidb> insert into t1 values(2, "world"); 55 Query OK, 1 row affected (0.00 sec) 56 tidb> select * from t1; 57 +----+-------+ 58 | id | name | 59 +----+-------+ 60 | 1 | hello | 61 | 2 | world | 62 +----+-------+ 63 2 rows in set (0.00 sec) 64 tidb> 65 ``` 66 67 Run TiDB server: 68 69 ``` 70 make server 71 cd tidb-server 72 ./tidb-server -store=hbase -path="zkaddrs/hbaseTbl?tso=tsoType" -P=4000 73 DSN parameters: 74 zkaddrs is the address of zookeeper. 75 hbaseTbl is the table in hbase to store TiDB data. 76 tsoaddr is the type of tso sever. Its value could be zk or local. 77 Here is an example of dsn: 78 ./tidb-server -store=hbase -path="zk1,zk2/test?tso=zk" -P=5000 79 ```