一 简介:今天来研究Tidb
二 安装测试:
0 下载Tidb
wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
按如下步骤依次启动PD, TiKV, TiDB
1 启动pd
这里如果无法启动,大概率是2379端口被占用,极大可能是redis服务
nohup ./bin/pd-server --data-dir=pd --log-file=pd.log &
2 启动kv
这里如果无法启动 请看文章末尾解决办法
nohup ./bin/tikv-server --pd="127.0.0.1:2379" --store=tikv --log-file=tikv.log &
3 启动tidb
nohup ./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=tidb.log &
4 进行测试
mysql -h 127.0.0.1 -P 4000 -u root -D test
5 创建用户
grant all privileges on *.* to 'test'@'%' identified by 'test' with grant option;
flush privileges;
6 测试
1 远程连接测试
mysql -utest -ptest -hIP --port=4000
2 explain优化器测试
| id | parents | children | task | operator info | count |
+---------------+---------+----------+------+-----------------------------------------------+-------+
| TableScan_4 | | | cop | table:aa, range:[-inf,+inf], keep order:false | 1.00 |
| TableReader_5 | | | root | data:TableScan_4 | 1.00 |
可以发现 与mysql自带的优化器确实不同
三 glibc报错解决
1 查看glibc版本 strings /lib64/libc.so.6 |grep GLIBC_
2 添加glibc-2.17
wget https://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
tar –zxvf glibc-2.17.tar.gz
cd glibc-2.17
mkdir build
cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make && make install
编译需要一点时间,耐心等待即可