tidb mysql5 7 TiDB安裝部署

2021-10-18 17:38:48 字數 2172 閱讀 4692

1.環境介紹

os系統版本:centos 7

tidb單機偽集群規劃:

1個tidb server

1個pd server

3個tikv server

2. 步驟

wget

# 解壓tidb二進位製包:

tar -xzf tidb-latest-linux-amd64.tar.gz

cd tidb-latest-linux-amd64

2.2 啟動pd server

# 開啟1個新的終端,執行:

./bin/pd-server --name=pd1 --data-dir=pd1 --client-urls= --peer-urls= --initial-cluster= --log-file=pd1.log

2.3 啟動tikv server

# 開啟3個新的終端,分別執行:

./bin/tikv-server --pd-endpoints="127.0.0.1:2379" --addr="127.0.0.1:20160" --data-dir=tikv1 --log-file=tikv1.log

./bin/tikv-server --pd-endpoints="127.0.0.1:2379" --addr="127.0.0.1:20161" --data-dir=tikv2 --log-file=tikv2.log

./bin/tikv-server --pd-endpoints="127.0.0.1:2379" --addr="127.0.0.1:20162" --data-dir=tikv3 --log-file=tikv3.log

# 檢查tikv部署是否成功,檢視所有tikv狀態是否為up:

./bin/pd-ctl store -d -u

2.4 啟動tidb server

# 開啟1個新的終端,執行:

./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=tidb.log

2.5 連線tidb

[root@localhost tidb-latest-linux-amd64]# mysql -h 127.0.0.1 -p 4000 -u root

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-248-g2f6639d mysql community server (apache license 2.0)

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.

mysql> status

mysql ver 14.14 distrib 5.7.22-22, for linux (x86_64) using 6.2

connection id: 2

current database:

current user: [email protected]

ssl: not in use

current pager: stdout

using outfile: ''

using delimiter: ;

server version: 5.7.10-tidb-v2.1.0-rc.3-248-g2f6639d mysql community server (apache license 2.0)

protocol version: 10

connection: 127.0.0.1 via tcp/ip

server characterset: utf8mb4

db characterset: utf8mb4

client characterset: utf8

conn. characterset: utf8

tcp port: 4000

mysql5 7安裝部落格園 mysql5 7安裝

root localhost cd usr softwares root localhost softwares rz 2 解壓檔案 解壓檔案 root localhost softwares tar xzvf mysql 5.7.23 linux glibc2.12 x86 64.tar.gz 將...

rabbitmq在centos5 7上的安裝步驟

一 伺服器端 1 安裝epel extra packages for enterprise linux 1 x86 64位cpu su c rpm uvh 2 i386cpu su c rpm uvh 2 安裝 json pip install json 3 安裝erlang語言環境 yum ins...

Ubuntu18 04下MySQL5 7的安裝

進行命令列安裝 1.安裝mysql服務端和客戶端 sudo apt get install mysql server 5.72.安裝依賴 sudo apt install libmysqlclient dev3.檢查狀態 4.進入root使用者 sudo su設定mysql的密碼 1.進入mysql...