Tidb单机版安装实战

  1. 云栖社区>
  2. 博客>
  3. 正文

Tidb单机版安装实战

王伏芃 2018-09-04 19:22:46 浏览484 评论0

摘要: cd /usr/local/ wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz tar -xzf tidb-latest-linux-amd64.

安装依赖包
yum -y install libtool zlib-devel autoconf readline-devel readline libuuid-devel zlib-devel automake libuuid readline-devel readline ncurses-devel.x86_64 ncurses.x86_64 gcc-c++ vim wget net-tools svn libstdc++.so.6 glibc.i686 unzip make lrzsz libtool zlib-devel autoconf readline-devel readline libuuid-devel zlib-devel automake libuuid readline-devel readline ncurses-devel.x86_64 ncurses.x86_64 gcc-c++ vim wget net-tools svn libstdc++.so.6 libcurl-dev libcurl-devel expat-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker zip git gcc openssl-devel libnl3-devel net-snmp-devel libnfnetlink-devel zlib zlib-devel openssl openssl-devel tree lrzsz tree net-tools nmap vim bash-completion lsof dos2unix nc telnet ntp wget rng-tools psmisc screen pcre pcre-devel
开始安装
cd /usr/local/
wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
tar -xzf tidb-latest-linux-amd64.tar.gz
cd tidb-latest-linux-amd64
mkdir -p /data/tidb
ln -s /usr/local/tidb-latest-linux-amd64/bin/pd-tso-bench /usr/bin
ln -s /usr/local/tidb-latest-linux-amd64/bin/tikv-server /usr/bin/
ln -s /usr/local/tidb-latest-linux-amd64/bin/tidb-server /usr/bin/
ln -s /usr/local/tidb-latest-linux-amd64/bin/pd-server /usr/bin/
ln -s /usr/local/tidb-latest-linux-amd64/bin/pd-ctl /usr/bin/

启动PD
cd bin
./pd-server -data-dir=/data/tidb/pd -log-file=/data/tidb/log/pd.log -name=pd1 &
启动TiKV
./tikv-server --pd="127.0.0.1:2379" --data-dir=/data/tidb/tikv --log-file=/data/tidb/log/tikv.log &
会发现报错
version `GLIBC_2.17' not found (required by ./bin/tikv-server)
安装GLIBC_2.17
cd /usr/local
wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
tar -xf 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 -j 8
make install
strings /lib64/libc.so.6 | grep GLIBC
启动TiKV
./tikv-server --pd="127.0.0.1:2379" --data-dir=/data/tidb/tikv --log-file=/data/tidb/log/tikv.log &
启动TiDB
./tidb-server -L info -store=tikv --path=/data/tidb/tidb --path=127.0.0.1:2379 -log-file=/data/tidb/log/tidb.log &
其他设置
mysql -h 127.0.0.1 -P 4000 -u root -D test
设置root密码
use mysql;
update user set password=PASSWORD("mynewpassword") where User='root';
flush privileges;
设置远程权限
grant all privileges on . to 'root'@'%' identified by 'password';
flush privileges;
用sqlyog连接上去。能发现和mysql一模一样。
版本号是5.7.10-Tidb-v2.1.0-rc.1-46-gf270b10
image

【云栖快讯】一站式开发者服务,海量学习资源免费学  详情请点击

网友评论