您好,登錄后才能下訂單哦!
部署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 |
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。