美文网首页
TIDB测试环境单机部署

TIDB测试环境单机部署

作者: 毛毛v5 | 来源:发表于2018-07-31 16:10 被阅读52次

    官方部署文档:https://pingcap.com/docs-cn/op-guide/binary-deployment/ 官方文档 

    下载mysql工具:wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm 

    安装mysql工具集:yum install -y mysql57-community-release-el7-11.noarch.rpm 

    1.下载二进制分发版得tidb文件:

     wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz

    把下载得文件移动到usr目录:

    mv tidb-latest-linux-amd64.tar.gz  /usr/local/

    进入目录

    cd /usr/local/

    解压二进制文件包:

    tar xf tidb-latest-linux-amd64.tar.gz 

    改名目录

    ln -s tidb-latest-linux-amd64 tidb

    进入tidb目录:

    cd /usr/local/tidb

    启动 pd,tikv,tidb

    ./bin/pd-server --data-dir=pd --log-file=pd.log &

    ./bin/tikv-server --pd="127.0.0.1:2379" --data-dir=tikv --log-file=tikv.log &

    ./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=tidb.log &

    安装mysql.

     yum install -y mysql-community-client.x86_64 

    4.连接mysql使用: mysql -h 127.0.0.1 -P 4000 -u root -D test

    5.功能测试.

    grant all privileges on *.* to 'oracle'@'%' identified by 'oracle' with grant option;

    flush  privileges;

    创建用户

    CREATE USER 'ggs'@'%' IDENTIFIED BY 'oracle';

    set password for ggs=password('oracle');

    GRANT ALL PRIVILEGES ON *.* TO 'ggs'@'%' with grant option;

    flush  privileges;

    grant all privileges on *.* to 'root'@'localhost' identified by 'oracle' with grant option;

    grant all privileges on *.* to 'root'@'%' identified by 'oracle' with grant option;

    grant all privileges on *.* to 'root'@'127.0.0.1' identified by 'oracle' with grant option;

    flush  privileges;

    [root@tidbceshi tidb]# ps -ef | grep tidb

    avahi       719      1  0 20:00 ?        00:00:00 avahi-daemon: running [tidbceshi.local]

    root       2292   1957  0 20:21 pts/1    00:00:18 ./bin/tidb-server --store=tikv --path=127.0.0.1:2379 --log-file=tidb.log

    root      29138   1957  0 22:07 pts/1    00:00:00 grep --color=auto tidb

    [root@tidbceshi tidb]# ps -ef | grep pd

    root         25      2  0 19:59 ?        00:00:00 [kswapd0]

    root        664    662  0 19:59 ?        00:00:00 /sbin/audispd

    root       2033   1957  0 20:07 pts/1    00:00:48 ./bin/pd-server --data-dir=pd --log-file=pd.log

    root       2041   1957  0 20:07 pts/1    00:00:15 ./bin/tikv-server --pd=127.0.0.1:2379 --data-dir=tikv --log-file=tikv.log

    root      29140   1957  0 22:08 pts/1    00:00:00 grep --color=auto pd

    [root@tidbceshi tidb]# ps -ef | grep kv

    root       2041   1957  0 20:07 pts/1    00:00:15 ./bin/tikv-server --pd=127.0.0.1:2379 --data-dir=tikv --log-file=tikv.log

    root       2292   1957  0 20:21 pts/1    00:00:18 ./bin/tidb-server --store=tikv --path=127.0.0.1:2379 --log-file=tidb.log

    root      29150   1957  0 22:08 pts/1    00:00:00 grep --color=auto kv

    相关文章

      网友评论

          本文标题:TIDB测试环境单机部署

          本文链接:https://www.haomeiwen.com/subject/yrehvftx.html