TiDB单机安装测试


TiDB单机安装测试

CentOS7.3
安装MySQL5.6

1:下载TiDB安装包
# cd /opt/source
# wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
# wget http://download.pingcap.org/tidb-latest-linux-amd64.sha256
2:检查文件完整性
# sha256sum -c tidb-latest-linux-amd64.sha256
tidb-latest-linux-amd64.tar.gz: 确定


3:启动pd-server
# tar -xvf tidb-latest-linux-amd64.tar.gz

# ln -s /opt/source/tidb-latest-linux-amd64 /usr/local/tidb

# mkdir -p /data/pd/{data,logs}
# /usr/local/tidb/bin/pd-server --data-dir=/data/pd/data --log-file=/data/pd/logs/pd.log &


# ps -ef |grep pd-server
root 1358 1189 1 11:22 pts/0 00:00:00 /usr/local/tidb/bin/pd-server --data-dir=/data/pd/data --log-file=/data/pd/logs/pd.log
root 1373 1189 0 11:22 pts/0 00:00:00 grep --color=auto pd-server

启动tikv

# mkdir -p /data/tikv/{data,logs}
# /usr/local/tidb/bin/tikv-server --pd="127.0.0.1:2379" --data-dir=/data/tikv/data --log-file=/data/tikv/logs/tikv.log &

# ps -ef |grep tikv-server
root 1407 1189 9 11:25 pts/0 00:00:00 /usr/local/tidb/bin/tikv-server --pd=127.0.0.1:2379 --data-dir=/data/tikv/data --log-file=/data/tikv/logs/tikv.log
root 1500 1189 0 11:25 pts/0 00:00:00 grep --color=auto tikv-server

启动tidb
#/usr/local/tidb/bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=/data/tidb/logs/tikv.log &
# mkdir -p /data/tidb/logs
#/usr/local/tidb/bin/tidb-server --path="127.0.0.1:2379" --data-dir=/data/tidb/data --log-file=/data/tidb/logs/tikv.log &
# ps -ef |grep tidb
root 1358 1 1 11:22 ? 00:02:32 /usr/local/tidb/bin/pd-server --data-dir=/data/pd/data --log-file=/data/pd/logs/pd.log
root 1407 1 0 11:25 ? 00:00:33 /usr/local/tidb/bin/tikv-server --pd=127.0.0.1:2379 --data-dir=/data/tikv/data --log-file=/data/tikv/logs/tikv.log
root 6890 1846 2 14:13 pts/2 00:00:00 /usr/local/tidb/bin/tidb-server --store=tikv --path=127.0.0.1:2379 --log-file=/data/tidb/logs/tikv.log
root 6915 1846 0 14:13 pts/2 00:00:00 grep --color=auto tidb

使用MySQL客户端连接测试,TCP 4000 端口是 TiDB 服务默认端口

# /usr/local/mysql/bin/mysql -uroot -h127.0.0.1 -P4000
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.10-TiDB-v2.1.0-rc.3-316-g7f7cfbf MySQL Community Server (Apache License 2.0)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@(none) 02:15:27>show databases;
+--------------------+
| Database |
+--------------------+
| INFORMATION_SCHEMA |
| PERFORMANCE_SCHEMA |
| elon |
| mysql |
| test |
+--------------------+
5 rows in set (0.00 sec)

root@(none) 02:15:33>select user,host,password from mysql.user;
+------+------+----------+
| user | host | password |
+------+------+----------+
| root | % | |
+------+------+----------+
1 row in set (0.00 sec)

root@(none) 02:15:40>

posted on 2018-12-14 14:35  HelonTian  阅读(1297)  评论(0编辑  收藏  举报