Tidb集群加mysql_TiDB - 快速入门,集群搭建
TiDB 是開源分布式關(guān)系型數(shù)據(jù)庫,是一款同時(shí)支持在線事務(wù)處理與在線分析處理 (Hybrid Transactional and Analytical Processing, HTAP)的融合型分布式數(shù)據(jù)庫產(chǎn)品,具備水平擴(kuò)容或者縮容、金融級(jí)高可用、實(shí)時(shí) HTAP、云原生的分布式數(shù)據(jù)庫、兼容 MySQL 5.7 協(xié)議和 MySQL 生態(tài)等重要特性。目標(biāo)是為用戶提供一站式 OLTP (Online Transactional Processing)、OLAP (Online Analytical Processing)、HTAP 解決方案。TiDB 適合高可用、強(qiáng)一致要求較高、數(shù)據(jù)規(guī)模較大等各種應(yīng)用場景。
本文目標(biāo)初步了解TiDB
使用TiUP在單機(jī)上模擬生產(chǎn)環(huán)境搭建TiDB集群步驟
基本使用
初步了解TiDBTiDB是 開源的 分布式的 關(guān)系型的 數(shù)據(jù)庫
TiDB兼容 MySQL 5.7 協(xié)議
TiDB具備水平擴(kuò)容和縮容
使用TiUP在單機(jī)上模擬生產(chǎn)環(huán)境搭建TiDB集群步驟
1. TiUP是一個(gè)集群管理工具,推薦部署在中控機(jī)
2. 準(zhǔn)備一臺(tái)部署主機(jī),推薦安裝 CentOS 7.3 及以上版本。(可以和中控機(jī)在一起)
3. 下載并安裝 TiUPcurl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
## 重新聲明全局環(huán)境變量
source .bash_profile
## 確認(rèn) TiUP 工具是否安裝
which tiup
## 安裝 TiUP cluster 組件
tiup cluster
## 更新 TiUP cluster 組件至最新版本
tiup update --self && tiup update cluster
4. 新建一個(gè)配置文件 topology.yaml。ip改成需要部署的機(jī)器的ip,注意ssh端口提供一份topology.yaml模板:topology.yaml## Global variables are applied to all deployments and used as the default value of
## the deployments if a specific deployment value is missing.
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/data/tidb-deploy"
data_dir: "/data/tidb-data"
## Monitored variables are applied to all the machines.
monitored:
node_exporter_port: 9100
blackbox_exporter_port: 9115
server_configs:
tidb:
log.slow-threshold: 300
tikv:
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
pd:
replication.enable-placement-rules: true
tiflash:
logger.level: "info"
pd_servers:
- host: 192.168.137.13
tidb_servers:
- host: 192.168.137.13
tikv_servers:
- host: 192.168.137.13
port: 20160
status_port: 20180
monitoring_servers:
- host: 192.168.137.13
5. 執(zhí)行集群部署命令### 查看tidb版本列表
tiup list tidb
### tidb-test 為集群名稱,v4.0.4 當(dāng)前安裝的版本
tiup cluster deploy tidb-test v4.0.4 ./topology.yaml --user root -p
### 按照引導(dǎo),輸入”y”及 root 密碼,來完成部署
6. 啟動(dòng)集群### tidb-test 為集群名稱
tiup cluster start tidb-test
7. 查看集群的拓?fù)浣Y(jié)構(gòu)和狀態(tài)tiup cluster display tidb-test
8. 訪問web監(jiān)控后臺(tái),默認(rèn)賬號(hào)root,密碼空
http://192.168.137.13:2379/dashboard/#/signin
基本使用
1. 使用 Navicat Premium 15注冊(cè)版 連接數(shù)據(jù)庫,默認(rèn)端口4000,賬號(hào)root,密碼空
2. 修改或設(shè)置密碼## set password for 賬號(hào)=password('新密碼');
set password for root=password('root');
總結(jié)
以上是生活随笔為你收集整理的Tidb集群加mysql_TiDB - 快速入门,集群搭建的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于git分支
- 下一篇: 开源数据库中间件-MyCa初探与分片实践