美文网首页
Centos下单机运行Vitess

Centos下单机运行Vitess

作者: zr_hebo | 来源:发表于2017-12-07 20:55 被阅读0次
    1. 安装GO1.9的开发环境,设置GOPATH,下载必须的包;

    2. 安装mysql,目录是/opt/mysql/mysql-5.6.26;

    3. 安装java开发环境JDK;

    4. 安装python开发环境,安装pip,virtualenv;
      下载vitess代码:
      cd $WORKSPACE
      git clone https://github.com/youtube/vitess.git
      src/github.com/youtube/vitess
      cd src/github.com/youtube/vitess

    5. 设置vitess需要的环境表量:
      export MYSQL_FLAVOR=MySQL56
      export VT_MYSQL_ROOT=/opt/mysql/mysql-5.6.26
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$VT_MYSQL_ROOT/lib
      export C_INCLUDE_PATH=$C_INCLUDE_PATH:$VT_MYSQL_ROOT/include
      export VTROOT=$GOPATH/src/github.com/youtube/vitess
      export VTDATAROOT=$VTROOT/vtdataroot
      export ZK_CLIENT_CONFIG=$VTROOT/examples/local/zk-client-conf.json
      PATH=$PATH:$VTROOT/bin

    6. 编译
      ./bootstrap.sh
      source dev.env
      make build

    7. 运行测试脚本
      cd $VTROOT/examples/local && ./zk-up.sh && ./vttablet-up.sh &&./vtctld-up.sh && sleep 2 &&./vtgate-up.sh
      cd $VTROOT/examples/local && ./lvtctl.sh ListAllTablets test
      cd $VTROOT/examples/local && ./lvtctl.sh InitShardMaster -force test_keyspace/0 test-100
      cd $VTROOT/examples/local && ./lvtctl.sh ListAllTablets test
      cd $VTROOT/examples/local && ./lvtctl.sh ApplySchema -sql "$(cat create_test_table.sql)" test_keyspace
      cd $VTROOT/examples/local && ./lvtctl.sh ApplyVSchema -vschema "$(cat vschema.json)" test_keyspace

    相关文章

      网友评论

          本文标题:Centos下单机运行Vitess

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