成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

從0到1部署一套TiDB本地集群

運維 數據庫運維
TiDB 是 PingCAP 公司自主設計、研發的開源分布式關系型數據庫,是一款同時支持在線事務處理與在線分析處理 (Hybrid Transactional and Analytical Processing, HTAP)的融合型分布式數據庫產品,具備水平擴容或者縮容、金融級高可用、實時 HTAP、云原生的分布式數據庫、兼容 MySQL 5.7 協議和 MySQL 生態等重要特性。

 [[374542]]

本文轉載自微信公眾號「 jinjunzhu」,作者 jinjunzhu 。轉載本文請聯系 jinjunzhu公眾號。

TiDB是一款開源的NewSQL數據庫,我們看一下官方的描述:

TiDB 是 PingCAP 公司自主設計、研發的開源分布式關系型數據庫,是一款同時支持在線事務處理與在線分析處理 (Hybrid Transactional and Analytical Processing, HTAP)的融合型分布式數據庫產品,具備水平擴容或者縮容、金融級高可用、實時 HTAP、云原生的分布式數據庫、兼容 MySQL 5.7 協議和 MySQL 生態等重要特性。目標是為用戶提供一站式 OLTP (Online Transactional Processing)、OLAP (Online Analytical Processing)、HTAP 解決方案。TiDB 適合高可用、強一致要求較高、數據規模較大等各種應用場景。

這里面有幾個關鍵點:

  • 分布式關系型數據庫
  • 兼容MySQL5.7
  • 支持HTAP(在線事務處理和在線分析處理)
  • 對金融行業支持很好,支持高可用、強一致和大數據場景

基本概念

這里介紹一下TiDB中的幾個重要概念:

  • PD:Placement Driver,是TiDB的一個總控節點,負責集群的整體調度外,全局ID生成,以及全局時間戳TSO(中心化授時)的生成。也就是說全局時鐘在這個節點實現。
  • TiKV:TiDB 的存儲層,是一個分布式事務型的鍵值數據庫,滿足ACID事務,使用Raft協議保證多副本一致性,還存儲統計數據,
  • TiFlash:HTAP形態的關鍵組件,它是TiKV的列存擴展,在提供了良好的隔離性的同時,也兼顧了強一致性。
  • Monitor:TiDB監控組件

實驗環境

由于我本地資源的限制,我們使用快速部署的方式。

TiDB快速部署的方式有2種:

第一種:使用 TiUP Playground 快速部署本地測試環境

適用場景:利用本地 Mac 或者單機 Linux 環境快速部署 TiDB 集群。可以體驗 TiDB 集群的基本架構,以及 TiDB、TiKV、PD、監控等基礎組件的運行。

第二種:使用TiUP cluster在單機上模擬生產環境部署步驟

希望用單臺Linux服務器,體驗TiDB最小的完整拓撲的集群,并模擬生產的部署步驟。

這里我采用第二種方式。

據官方描述,TiDB在CentOS 7.3做過大量的測試,建議在CentOS 7.3以上部署。

本地環境:VMware虛擬機,操作系統CentOS7.6

開始部署

我們按照官方的步驟來安裝

1.關閉防火墻

  1. systemctl stop firewalld 
  2. service  iptables stop 

2.下載并安裝 TiUP,命令和結果如下

  1. [root@master ~]# curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh 
  2.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 
  3.                                  Dload  Upload   Total   Spent    Left  Speed 
  4. 100 8697k  100 8697k    0     0  4316k      0  0:00:02  0:00:02 --:--:-- 4318k 
  5. WARN: adding root certificate via internet: https://tiup-mirrors.pingcap.com/root.json 
  6. You can revoke this by remove /root/.tiup/bin/7b8e153f2e2d0928.root.json 
  7. Set mirror to https://tiup-mirrors.pingcap.com success 
  8. Detected shell: bash 
  9. Shell profile:  /root/.bash_profile 
  10. /root/.bash_profile has been modified to add tiup to PATH 
  11. open a new terminal or source /root/.bash_profile to use it 
  12. Installed path: /root/.tiup/bin/tiup 
  13. =============================================== 
  14. Have a try:     tiup playground 
  15. =============================================== 

3.安裝 TiUP 的 cluster 組件

首先聲明全局的環境變量,不然找不到tiup命令:

  1. source .bash_profile 

執行安裝cluster命令:

  1. tiup cluster 

輸出如下:

 

  1. [root@master ~]# tiup cluster 
  2. The component `cluster` is not installed; downloading from repository. 
  3. download https://tiup-mirrors.pingcap.com/cluster-v1.3.1-linux-amd64.tar.gz 10.05 MiB / 10.05 MiB 100.00% 13.05 MiB p/s                                                
  4. Starting component `cluster`: /root/.tiup/components/cluster/v1.3.1/tiup-cluster 
  5. Deploy a TiDB cluster for production 
  6.  
  7. Usage: 
  8.   tiup cluster [command] 
  9.  
  10. Available Commands: 
  11.   check       Perform preflight checks for the cluster. 
  12.   deploy      Deploy a cluster for production 
  13.   start       Start a TiDB cluster 
  14.   stop        Stop a TiDB cluster 
  15.   restart     Restart a TiDB cluster 
  16.   scale-in    Scale in a TiDB cluster 
  17.   scale-out   Scale out a TiDB cluster 
  18.   destroy     Destroy a specified cluster 
  19.   clean       (EXPERIMENTAL) Cleanup a specified cluster 
  20.   upgrade     Upgrade a specified TiDB cluster 
  21.   exec        Run shell command on host in the tidb cluster 
  22.   display     Display information of a TiDB cluster 
  23.   prune       Destroy and remove instances that is in tombstone state 
  24.   list        List all clusters 
  25.   audit       Show audit log of cluster operation 
  26.   import      Import an exist TiDB cluster from TiDB-Ansible 
  27.   edit-config Edit TiDB cluster config. 
  28. Will use editor from environment variable `EDITOR`, default use vi 
  29.   reload      Reload a TiDB cluster's config and restart if needed 
  30.   patch       Replace the remote package with a specified package and restart the service 
  31.   rename      Rename the cluster 
  32.   enable      Enable a TiDB cluster automatically at boot 
  33.   disable     Disable starting a TiDB cluster automatically at boot 
  34.   help        Help about any command 
  35.  
  36. Flags: 
  37.   -h, --help                help for tiup 
  38.       --ssh string          (EXPERIMENTAL) The executor type: 'builtin', 'system', 'none'. 
  39.       --ssh-timeout uint    Timeout in seconds to connect host via SSH, ignored for operations that don't need an SSH connection. (default 5) 
  40.   -v, --version             version for tiup 
  41.       --wait-timeout uint   Timeout in seconds to wait for an operation to complete, ignored for operations that don't fit. (default 120) 
  42.   -y, --yes                 Skip all confirmations and assumes 'yes' 
  43.  
  44. Use "tiup cluster help [command]" for more information about a command. 

4.調大sshd服務的連接數限制

這里需要使用root權限,具體修改/etc/ssh/sshd_config文件下面的參數配置:

  1. MaxSessions 20 

改完后重啟sshd:

  1. [root@master ~]# service sshd restart 
  2. Redirecting to /bin/systemctl restart sshd.service 

5.編輯集群配置模板文件

這個文件我們命名為topo.yaml,內容如下:

  1. # # Global variables are applied to all deployments and used as the default value of 
  2. # # the deployments if a specific deployment value is missing. 
  3. global
  4.  user"tidb" 
  5.  ssh_port: 22 
  6.  deploy_dir: "/tidb-deploy" 
  7.  data_dir: "/tidb-data" 
  8.  
  9. # # Monitored variables are applied to all the machines. 
  10. monitored: 
  11.  node_exporter_port: 9100 
  12.  blackbox_exporter_port: 9115 
  13.  
  14. server_configs: 
  15.  tidb: 
  16.    log.slow-threshold: 300 
  17.  tikv: 
  18.    readpool.storage.use-unified-pool: false 
  19.    readpool.coprocessor.use-unified-pool: true 
  20.  pd: 
  21.    replication.enable-placement-rules: true 
  22.    replication.location-labels: ["host"
  23.  tiflash: 
  24.    logger.level"info" 
  25.  
  26. pd_servers: 
  27.  - host: 192.168.59.146 
  28.  
  29. tidb_servers: 
  30.  - host: 192.168.59.146 
  31.  
  32. tikv_servers: 
  33.  - host: 192.168.59.146 
  34.    port: 20160 
  35.    status_port: 20180 
  36.    config: 
  37.      server.labels: { host: "logic-host-1" } 
  38.  
  39. # - host: 192.168.59.146 
  40. #   port: 20161 
  41. #   status_port: 20181 
  42. #   config: 
  43. #     server.labels: { host: "logic-host-2" } 
  44.  
  45. # - host: 192.168.59.146 
  46. #   port: 20162 
  47. #   status_port: 20182 
  48. #   config: 
  49. #     server.labels: { host: "logic-host-3" } 
  50.  
  51. tiflash_servers: 
  52.  - host: 192.168.59.146 

這里有2點需要注意:

  • 文件中的host是部署TiDB的服務器ip
  • ssh_port默認是22

官方文件的tikv_servers是3個節點,我這里設置成了只有1個節點,原因是本地配置多個節點時只有1個節點能啟動成功

6.部署集群

部署集群的命令如下:

  1. tiup cluster deploy <cluster-name> <tidb-version> ./topo.yaml --user root -p 

上面的cluster-name是集群名稱,tidb-version是指TiDB版本號,可以通過tiup list tidb這個命令來查看,這里使用v3.1.2,集群名稱叫mytidb-cluster,命令如下:

  1. tiup cluster deploy mytidb-cluster v3.1.2 ./topo.yaml --user root -p 

下面是部署時輸出的日志:

  1. [root@master ~]# tiup cluster deploy mytidb-cluster v3.1.2 ./topo.yaml --user root -p 
  2. Starting component `cluster`: /root/.tiup/components/cluster/v1.3.1/tiup-cluster deploy mytidb-cluster v3.1.2 ./topo.yaml --user root -p 
  3. Please confirm your topology: 
  4. Cluster type:    tidb 
  5. Cluster name:    mytidb-cluster 
  6. Cluster version: v3.1.2 
  7. Type        Host            Ports                            OS/Arch       Directories 
  8. ----        ----            -----                            -------       ----------- 
  9. pd          192.168.59.146  2379/2380                        linux/x86_64  /tidb-deploy/pd-2379,/tidb-data/pd-2379 
  10. tikv        192.168.59.146  20160/20180                      linux/x86_64  /tidb-deploy/tikv-20160,/tidb-data/tikv-20160 
  11. tidb        192.168.59.146  4000/10080                       linux/x86_64  /tidb-deploy/tidb-4000 
  12. tiflash     192.168.59.146  9000/8123/3930/20170/20292/8234  linux/x86_64  /tidb-deploy/tiflash-9000,/tidb-data/tiflash-9000 
  13. prometheus  192.168.59.146  9090                             linux/x86_64  /tidb-deploy/prometheus-9090,/tidb-data/prometheus-9090 
  14. grafana     192.168.59.146  3000                             linux/x86_64  /tidb-deploy/grafana-3000 
  15. Attention: 
  16.     1. If the topology is not what you expected, check your yaml file. 
  17.     2. Please confirm there is no port/directory conflicts in same host. 
  18. Do you want to continue? [y/N]:  y 
  19. Input SSH password:  
  20. + Generate SSH keys ... Done 
  21. + Download TiDB components 
  22.   - Download pd:v3.1.2 (linux/amd64) ... Done 
  23.   - Download tikv:v3.1.2 (linux/amd64) ... Done 
  24.   - Download tidb:v3.1.2 (linux/amd64) ... Done 
  25.   - Download tiflash:v3.1.2 (linux/amd64) ... Done 
  26.   - Download prometheus:v3.1.2 (linux/amd64) ... Done 
  27.   - Download grafana:v3.1.2 (linux/amd64) ... Done 
  28.   - Download node_exporter:v0.17.0 (linux/amd64) ... Done 
  29.   - Download blackbox_exporter:v0.12.0 (linux/amd64) ... Done 
  30. + Initialize target host environments 
  31.   - Prepare 192.168.59.146:22 ... Done 
  32. + Copy files 
  33.   - Copy pd -> 192.168.59.146 ... Done 
  34.   - Copy tikv -> 192.168.59.146 ... Done 
  35.   - Copy tidb -> 192.168.59.146 ... Done 
  36.   - Copy tiflash -> 192.168.59.146 ... Done 
  37.   - Copy prometheus -> 192.168.59.146 ... Done 
  38.   - Copy grafana -> 192.168.59.146 ... Done 
  39.   - Copy node_exporter -> 192.168.59.146 ... Done 
  40.   - Copy blackbox_exporter -> 192.168.59.146 ... Done 
  41. Check status 
  42. Enabling component pd 
  43.         Enabling instance pd 192.168.59.146:2379 
  44.         Enable pd 192.168.59.146:2379 success 
  45. Enabling component node_exporter 
  46. Enabling component blackbox_exporter 
  47. Enabling component tikv 
  48.         Enabling instance tikv 192.168.59.146:20160 
  49.         Enable tikv 192.168.59.146:20160 success 
  50. Enabling component tidb 
  51.         Enabling instance tidb 192.168.59.146:4000 
  52.         Enable tidb 192.168.59.146:4000 success 
  53. Enabling component tiflash 
  54.         Enabling instance tiflash 192.168.59.146:9000 
  55.         Enable tiflash 192.168.59.146:9000 success 
  56. Enabling component prometheus 
  57.         Enabling instance prometheus 192.168.59.146:9090 
  58.         Enable prometheus 192.168.59.146:9090 success 
  59. Enabling component grafana 
  60.         Enabling instance grafana 192.168.59.146:3000 
  61.         Enable grafana 192.168.59.146:3000 success 
  62. Cluster `mytidb-cluster` deployed successfully, you can start it with command: `tiup cluster start mytidb-cluster` 

7.啟動集群

命令如下:

  1. tiup cluster start mytidb-cluster 

啟動成功日志如下:

  1. [root@master ~]# tiup cluster start mytidb-cluster 
  2. Starting component `cluster`: /root/.tiup/components/cluster/v1.3.1/tiup-cluster start mytidb-cluster 
  3. Starting cluster mytidb-cluster... 
  4. + [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/mytidb-cluster/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/mytidb-cluster/ssh/id_rsa.pub 
  5. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  6. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  7. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  8. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  9. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  10. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  11. + [ Serial ] - StartCluster 
  12. Starting component pd 
  13.         Starting instance pd 192.168.59.146:2379 
  14.         Start pd 192.168.59.146:2379 success 
  15. Starting component node_exporter 
  16.         Starting instance 192.168.59.146 
  17.         Start 192.168.59.146 success 
  18. Starting component blackbox_exporter 
  19.         Starting instance 192.168.59.146 
  20.         Start 192.168.59.146 success 
  21. Starting component tikv 
  22.         Starting instance tikv 192.168.59.146:20160 
  23.         Start tikv 192.168.59.146:20160 success 
  24. Starting component tidb 
  25.         Starting instance tidb 192.168.59.146:4000 
  26.         Start tidb 192.168.59.146:4000 success 
  27. Starting component tiflash 
  28.         Starting instance tiflash 192.168.59.146:9000 
  29.         Start tiflash 192.168.59.146:9000 success 
  30. Starting component prometheus 
  31.         Starting instance prometheus 192.168.59.146:9090 
  32.         Start prometheus 192.168.59.146:9090 success 
  33. Starting component grafana 
  34.         Starting instance grafana 192.168.59.146:3000 
  35.         Start grafana 192.168.59.146:3000 success 
  36. + [ Serial ] - UpdateTopology: cluster=mytidb-cluster 
  37. Started cluster `mytidb-cluster` successfully 

8.訪問數據庫

因為TiDB支持mysql客戶端訪問,我們使用sqlyog登錄TiDB,用戶名root,密碼空,地址192.168.59.149,端口4000,如下圖:

登錄成功如下圖,左側我們可以看到TiDB自帶的一些表:

9.訪問TiDB的Grafana監控

訪問地址如下:

  1. http://192.168.59.146:3000/login 

初始用戶名/密碼:admin/admin,登錄進去后修改密碼,成功后頁面如下:

10.dashboard

TiDB v3.x版本沒有dashboard,v4.0開始加入,訪問地址如下:

  1. http://192.168.59.146:2379/dashboard 

11.查看集群列表

命令:tiup cluster list,結果如下:

  1. [root@master /]# tiup cluster list 
  2. Starting component `cluster`: /root/.tiup/components/cluster/v1.3.1/tiup-cluster list 
  3. Name            User  Version  Path                                                 PrivateKey 
  4. ----            ----  -------  ----                                                 ---------- 
  5. mytidb-cluster  tidb  v3.1.2   /root/.tiup/storage/cluster/clusters/mytidb-cluster  /root/.tiup/storage/cluster/clusters/mytidb-cluster/ssh/id_rsa 

12.查看集群拓撲結構

命令如下:

  1. tiup cluster list 

輸入命令后,我本地集群的輸出如下:

  1. [root@master /]# tiup cluster list 
  2. Starting component `cluster`: /root/.tiup/components/cluster/v1.3.1/tiup-cluster list 
  3. Name            User  Version  Path                                                 PrivateKey 
  4. ----            ----  -------  ----                                                 ---------- 
  5. mytidb-cluster  tidb  v3.1.2   /root/.tiup/storage/cluster/clusters/mytidb-cluster  /root/.tiup/storage/cluster/clusters/mytidb-cluster/ssh/id_rsa 
  6. You have new mail in /var/spool/mail/root 
  7. [root@master /]# tiup cluster display mytidb-cluster 
  8. Starting component `cluster`: /root/.tiup/components/cluster/v1.3.1/tiup-cluster display mytidb-cluster 
  9. Cluster type:       tidb 
  10. Cluster name:       mytidb-cluster 
  11. Cluster version:    v3.1.2 
  12. SSH type:           builtin 
  13. ID                    Role        Host            Ports                            OS/Arch       Status  Data Dir                    Deploy Dir 
  14. --                    ----        ----            -----                            -------       ------  --------                    ---------- 
  15. 192.168.59.146:3000   grafana     192.168.59.146  3000                             linux/x86_64  Up      -                           /tidb-deploy/grafana-3000 
  16. 192.168.59.146:2379   pd          192.168.59.146  2379/2380                        linux/x86_64  Up|L    /tidb-data/pd-2379          /tidb-deploy/pd-2379 
  17. 192.168.59.146:9090   prometheus  192.168.59.146  9090                             linux/x86_64  Up      /tidb-data/prometheus-9090  /tidb-deploy/prometheus-9090 
  18. 192.168.59.146:4000   tidb        192.168.59.146  4000/10080                       linux/x86_64  Up      -                           /tidb-deploy/tidb-4000 
  19. 192.168.59.146:9000   tiflash     192.168.59.146  9000/8123/3930/20170/20292/8234  linux/x86_64  Up      /tidb-data/tiflash-9000     /tidb-deploy/tiflash-9000 
  20. 192.168.59.146:20160  tikv        192.168.59.146  20160/20180                      linux/x86_64  Up      /tidb-data/tikv-20160       /tidb-deploy/tikv-20160 
  21. Total nodes: 6 

遇到的問題

安裝TiDB v4.0.9版本,可以部署成功,但是啟動報錯,如果topo.yaml中配置了3個節點,啟動報錯,tikv只能啟動成功一個,日志如下:

  1. [root@master ~]# tiup cluster start mytidb-cluster 
  2. Starting component `cluster`: /root/.tiup/components/cluster/v1.3.1/tiup-cluster start mytidb-cluster 
  3. Starting cluster mytidb-cluster... 
  4. + [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/mytidb-cluster/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/mytidb-cluster/ssh/id_rsa.pub 
  5. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  6. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  7. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  8. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  9. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  10. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  11. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  12. + [Parallel] - UserSSH: user=tidb, host=192.168.59.146 
  13. + [ Serial ] - StartCluster 
  14. Starting component pd 
  15.         Starting instance pd 192.168.59.146:2379 
  16.         Start pd 192.168.59.146:2379 success 
  17. Starting component node_exporter 
  18.         Starting instance 192.168.59.146 
  19.         Start 192.168.59.146 success 
  20. Starting component blackbox_exporter 
  21.         Starting instance 192.168.59.146 
  22.         Start 192.168.59.146 success 
  23. Starting component tikv 
  24.         Starting instance tikv 192.168.59.146:20162 
  25.         Starting instance tikv 192.168.59.146:20160 
  26.         Starting instance tikv 192.168.59.146:20161 
  27.         Start tikv 192.168.59.146:20162 success 
  28.  
  29. Error: failed to start tikv: failed to start: tikv 192.168.59.146:20161, please check the instance's log(/tidb-deploy/tikv-20161/log) for more detail.: timed out waiting for port 20161 to be started after 2m0s 
  30.  
  31. Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2021-01-05-19-58-46.log. 
  32. Error: run `/root/.tiup/components/cluster/v1.3.1/tiup-cluster` (wd:/root/.tiup/data/SLGrLJI) failed: exit status 1 

查看日志文件/tidb-deploy/tikv-20161/log/tikv.log,提示下面2個目錄下找不到文件:

  1. [2021/01/06 05:48:44.231 -05:00] [FATAL] [lib.rs:482] ["called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }"] [backtrace="stack backtrace:\n   0: tikv_util::set_panic_hook::{{closure}}\n             at components/tikv_util/src/lib.rs:481\n   1: std::panicking::rust_panic_with_hook\n             at src/libstd/panicking.rs:475\n   2: rust_begin_unwind\n             at src/libstd/panicking.rs:375\n   3: core::panicking::panic_fmt\n             at src/libcore/panicking.rs:84\n   4: core::result::unwrap_failed\n             at src/libcore/result.rs:1188\n   5: core::result::Result<T,E>::unwrap\n             at /rustc/0de96d37fbcc54978458c18f5067cd9817669bc8/src/libcore/result.rs:956\n      cmd::server::TiKVServer::init_fs\n             at cmd/src/server.rs:310\n      cmd::server::run_tikv\n             at cmd/src/server.rs:95\n   6: tikv_server::main\n             at cmd/src/bin/tikv-server.rs:166\n   7: std::rt::lang_start::{{closure}}\n             at /rustc/0de96d37fbcc54978458c18f5067cd9817669bc8/src/libstd/rt.rs:67\n   8: main\n   9: __libc_start_main\n  10: <unknown>\n"] [location=src/libcore/result.rs:1188] [thread_name=main] 

如果配置一個節點,啟動還是失敗,啟動日志我們截取后半段:

  1. Starting component pd 
  2.         Starting instance pd 192.168.59.146:2379 
  3.         Start pd 192.168.59.146:2379 success 
  4. Starting component node_exporter 
  5.         Starting instance 192.168.59.146 
  6.         Start 192.168.59.146 success 
  7. Starting component blackbox_exporter 
  8.         Starting instance 192.168.59.146 
  9.         Start 192.168.59.146 success 
  10. Starting component tikv 
  11.         Starting instance tikv 192.168.59.146:20160 
  12.         Start tikv 192.168.59.146:20160 success 
  13. Starting component tidb 
  14.         Starting instance tidb 192.168.59.146:4000 
  15.         Start tidb 192.168.59.146:4000 success 
  16. Starting component tiflash 
  17.         Starting instance tiflash 192.168.59.146:9000 
  18.  
  19. Error: failed to start tiflash: failed to start: tiflash 192.168.59.146:9000, please check the instance's log(/tidb-deploy/tiflash-9000/log) for more detail.: timed out waiting for port 9000 to be started after 2m0s 
  20.  
  21. Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2021-01-06-20-02-13.log. 

在/tidb-deploy/tiflash-9000/log中文件如下:

  1. [2021/01/06 20:06:26.207 -05:00] [INFO] [mod.rs:335] ["starting working thread"] [worker=region-collector-worker] 
  2. [2021/01/06 20:06:27.130 -05:00] [FATAL] [lib.rs:482] ["called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }"] [backtrace="stack backtrace:\n   0: tikv_util::set_panic_hook::{{closure}}\n   1: std::panicking::rust_panic_with_hook\n             at src/libstd/panicking.rs:475\n   2: rust_begin_unwind\n             at src/libstd/panicking.rs:375\n   3: core::panicking::panic_fmt\n             at src/libcore/panicking.rs:84\n   4: core::result::unwrap_failed\n             at src/libcore/result.rs:1188\n   5: cmd::server::run_tikv\n   6: run_proxy\n   7: operator()\n             at /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/tics/dbms/src/Server/Server.cpp:415\n   8: execute_native_thread_routine\n             at ../../../../../libstdc++-v3/src/c++11/thread.cc:83\n   9: start_thread\n  10: __clone\n"] [location=src/libcore/result.rs:1188] [thread_name=<unnamed>] 

試了v4.0.1版本,也是一樣的問題,都是報找不到文件的錯誤。

總結

TiDB部署相對容易,但是如果部署失敗,比如本文的V4.0.x版本,不太好解決,因為網上相關的經驗很少,官網也找不到,只能翻源代碼來解決了。

 

責任編輯:武曉燕 來源: jinjunzhu
相關推薦

2022-08-25 14:41:51

集群搭建

2024-12-02 11:24:30

Docker編排技術

2023-03-03 17:00:00

部署Linux內核

2016-11-28 16:23:23

戴爾

2022-05-09 08:35:43

面試產品互聯網

2022-07-06 07:27:52

32Core樹莓派集群

2014-07-17 14:09:31

Spark

2009-09-11 08:12:36

Windows 7企業部署網絡部署

2021-03-10 09:52:38

開發技能架構

2009-09-18 08:40:56

Windows 7企業部署VHD

2021-11-07 20:43:14

React

2019-10-22 08:12:49

消息隊列分布式系統

2021-03-10 09:21:00

Spring開源框架Spring基礎知識

2023-03-06 11:35:55

經營分析體系

2021-07-01 07:03:32

開發Webpack代碼

2022-07-13 11:17:00

大數據規劃

2022-07-10 20:45:47

React加載動畫庫

2023-03-22 23:23:25

React加載動畫庫

2012-05-11 11:57:01

2010-05-28 12:33:11

IPv6部署
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产伦一区二区三区 | 99色综合| 超碰一区二区 | 男人天堂色 | 嫩草视频入口 | 亚洲精品视频在线看 | 风间由美一区二区三区在线观看 | 91看片视频 | 视频一区二区国产 | 日日摸日日添日日躁av | 国产九一精品 | 欧美mv日韩mv国产网站91进入 | 成人精品一区 | av性色全交蜜桃成熟时 | 91影视| 精品国产精品一区二区夜夜嗨 | 91在线观看免费视频 | 久久不卡 | 午夜精品久久久久久久久久久久 | 国产成人综合久久 | 日本超碰| 国产精品亚洲一区 | 国产91中文 | 91久久爽久久爽爽久久片 | 黄色在线免费观看视频网站 | 天天插天天操 | 久久国产精品亚洲 | 亚洲婷婷一区 | 久久久久久久一区二区 | 亚洲精品一区二区另类图片 | 午夜精品久久久久久久星辰影院 | 99久久久国产精品免费消防器 | 天天干天天想 | 狠狠的干狠狠的操 | 韩国久久精品 | 日韩av资源站 | 久久伊人青青草 | 午夜婷婷激情 | 亚洲第一在线 | 一区二区在线看 | 亚洲欧美视频一区 |