十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
部署TiDB就是摆在我们面前的第一节课,其实有很多的部署方式,限于环境,我先开始琢磨单机版如何部署。
让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:域名申请、虚拟主机、营销软件、网站建设、六合网站维护、网站推广。
在Centos 6的版本中如果要部署,这个难度还是比较大的,而且会有很多未知的坑,根据官方的建议,是需要在Centos 7以上的版本中,否则glibc的版本问题会很快碰到。
我们安装一套Centos7,采用快速的单机部署的方式来尝鲜。
得到二进制的包,大概是100多M.
[root@localhost ~]# wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz [root@localhost tidb]# wget http://download.pingcap.org/tidb-latest-linux-amd64.sha256 做信息匹配,查看文件的校验是否正确。 sha256sum -c tidb-latest-linux-amd64.sha256 解压文件。 tar -xzf tidb-latest-linux-amd64.tar.gz [root@localhost tidb]# cd tidb-latest-linux-amd64 启动PD [root@localhost tidb-latest-linux-amd64]# ./bin/pd-server --data-dir=pd --log-file=pd.log & 关键的步骤来了,启动tikv,绝大多数的部署都是在这个步骤失败。 [root@localhost tidb-latest-linux-amd64]# ./bin/tikv-server --pd="127.0.0.1:2379" --data-dir=tikv --log-file=tikv.log & 启动tidb-server [root@localhost tidb-latest-linux-amd64]# ./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=tidb.log & 使用MySQL的方式来登录: [root@localhost tidb-latest-linux-amd64]# mysql -h 127.0.0.1 -P 4000 -u root -D test Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.7.1-TiDB-v2.0.0-rc.1-6-ge38f406 MySQL Community Server (Apache License 2.0) Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 开始体验一把 MySQL [test]> \s -------------- mysql Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1 Connection id: 2 Current database: test Current user: root@127.0.0.1 SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server: MySQL Server version: 5.7.1-TiDB-v2.0.0-rc.1-6-ge38f406 MySQL Community Server (Apache License 2.0) Protocol version: 10 Connection: 127.0.0.1 via TCP/IP Server characterset: latin1 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 TCP port: 4000 -------------- 查看对应的数据库列表。 MySQL [test]> show databases; +--------------------+ | Database | +--------------------+ | INFORMATION_SCHEMA | | PERFORMANCE_SCHEMA | | mysql | | test | +--------------------+ 4 rows in set (0.00 sec) MySQL [test]> select tidb_version(); +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tidb_version() | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Release Version: v2.0.0-rc.1-6-ge38f406 Git Commit Hash: e38f4067569152dd0acb233b4a8e0cc05644dee1 Git Branch: master UTC Build Time: 2018-03-11 08:28:59 GoVersion: go version go1.10 linux/amd64 TiKV Min Version: 1.1.0-dev.2 | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.04 sec) MySQL [test]> select version(); +-----------------------------------+ | version() | +-----------------------------------+ | 5.7.1-TiDB-v2.0.0-rc.1-6-ge38f406 | +-----------------------------------+ 1 row in set (0.00 sec) MySQL [test]> select user,host from mysql.user; +------+------+ | user | host | +------+------+ | root | % | +------+------+ 1 row in set (0.00 sec) MySQL [test]> show master status\G ERROR 1105 (HY000): line 1 column 11 near " status" (total length 18) MySQL [test]> show slave status\G ERROR 1105 (HY000): line 1 column 10 near " status" (total length 17) MySQL [test]> MySQL [test]> show binary logs; ERROR 1105 (HY000): line 1 column 11 near " logs" (total length 16) MySQL [test]> show variables like '%innodb%'; +------------------------------------------+------------------------+ | Variable_name | Value | +------------------------------------------+------------------------+ | innodb_locks_unsafe_for_binlog | OFF | | innodb_api_enable_mdl | OFF | | innodb_use_native_aio | OFF |