                (stop-tidb-server! node)
                (when (= node :n1)
                  (stop-tso-server! node)
-                 ; (stop-hbase! node)
+                 (stop-hbase! node)
                  )
                (info node "tore down"))))
 

            :--
            (str "-L=error")
            (str "-P=3306")
            (str "-lease=1")
            (str "-store=hbase")
            (c/lit (str "-path=\"" store-path "\""))
            :> tidb-log

  (c/su 
    (info node "stopping hbase")
    ; call stop-hbase.sh is very slow, so here we kill java forcely.
    (cu/grepkill "java")
    (Thread/sleep 2000)
    ; (meh (c/exec "/root/hbase/bin/stop-hbase.sh"))
    ;(meh (c/exec :rm :-rf "/var/lib/hbase/"))
    ;(meh (c/exec :rm :-rf "/root/hbase/logs/"))
    (meh (c/exec :rm :-rf "/tmp/hbase/"))
    )
  (info node "hbase stopped"))

(defn eval!
  "Evals a sql string from the command line."
  [s]
  (c/exec :echo s | "/root/interpreter" 
          :-lease 0 
          :-store "hbase" 
          (c/lit (str "-dbpath=\"" store-path "\""))
          :> "/var/log/interpreter.log"))

(defn setup-db!
  "Initialize TiDB database."
  [node]
  (info node "begin to setup tidb database.")
  (eval! (str "create table if not exists dirty
              (id     int not null primary key,
              x       bigint not null);")))


(defn db
  "Sets up and tears down TiDB"
