{"id":43739,"date":"2022-11-16T01:20:20","date_gmt":"2023-04-07T13:03:30","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/"},"modified":"2024-04-29T00:51:30","modified_gmt":"2024-04-28T16:51:30","slug":"tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/","title":{"rendered":"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09"},"content":{"rendered":"<h1>\u9996\u5148<\/h1>\n<p>\u6839\u636e TiDB \u6570\u636e\u5e93\u5e73\u53f0\u7684\u5feb\u901f\u5165\u95e8\u6307\u5357\u4e0b\u8ff0\u6b65\u9aa4\uff0c\u5df2\u6210\u529f\u642d\u5efa TiDB\u3002<\/p>\n<ul class=\"post-ul\">Simulate production deployment on a single machine<\/ul>\n<h1>\u51c6\u5907\u597d<\/h1>\n<p>\u672c\u6587\u6240\u63d0\u5230\u7684\u73af\u5883\u662f\u4f7f\u7528Oracle VM VirtualBox\u7684\u865a\u62df\u673a\u3002<\/p>\n<div>\n<div class=\"post-table\">#\u5024\u4eee\u60f3\u30de\u30b7\u30f3OSCentOS Linux release 7.9.2009 (Core)cpu cores4memory64 GB<\/div>\n<\/div>\n<p>\u7981\u7528\u9632\u706b\u5899\uff08\u6216\u8005\u6253\u5f00TiDB\u7684\u4f7f\u7528\u7aef\u53e3\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# systemctl status firewalld\r\n\u25cf firewalld.service - firewalld - dynamic firewall daemon\r\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/firewalld.service; enabled; vendor preset: enabled)\r\n   Active: active (running) since \u65e5 2023-05-07 07:49:11 JST; 1h 2min ago\r\n     Docs: man:firewalld(1)\r\n Main PID: 717 (firewalld)\r\n   CGroup: \/system.slice\/firewalld.service\r\n           \u2514\u2500717 \/usr\/bin\/python2 -Es \/usr\/sbin\/firewalld --nofork --nopid\r\n\r\n 5\u6708 07 07:49:10 tisim.besite systemd[1]: Starting firewalld - dynamic firewall daemon...\r\n 5\u6708 07 07:49:11 tisim.besite systemd[1]: Started firewalld - dynamic firewall daemon.\r\n 5\u6708 07 07:49:11 tisim.besite firewalld[717]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.\r\n[root@tisim ~]# systemctl stop firewalld\r\n[root@tisim ~]# systemctl disable firewalld\r\nRemoved symlink \/etc\/systemd\/system\/multi-user.target.wants\/firewalld.service.\r\nRemoved symlink \/etc\/systemd\/system\/dbus-org.fedoraproject.FirewallD1.service.\r\n<\/code><\/pre>\n<h1>\u5efa\u7acb<\/h1>\n<p>\u4e0b\u8f7dTiUP\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# curl --proto '=https' --tlsv1.2 -sSf https:\/\/tiup-mirrors.pingcap.com\/install.sh | sh\r\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                 Dload  Upload   Total   Spent    Left  Speed\r\n100 7321k  100 7321k    0     0  2476k      0  0:00:02  0:00:02 --:--:-- 2475k\r\nWARN: adding root certificate via internet: https:\/\/tiup-mirrors.pingcap.com\/root.json\r\nYou can revoke this by remove \/root\/.tiup\/bin\/7b8e153f2e2d0928.root.json\r\nSuccessfully set mirror to https:\/\/tiup-mirrors.pingcap.com\r\nDetected shell: bash\r\nShell profile:  \/root\/.bash_profile\r\n\/root\/.bash_profile has been modified to add tiup to PATH\r\nopen a new terminal or source \/root\/.bash_profile to use it\r\nInstalled path: \/root\/.tiup\/bin\/tiup\r\n===============================================\r\nHave a try:     tiup playground\r\n===============================================\r\n<\/code><\/pre>\n<p>\u8bf7\u786e\u8ba4\u5df2\u5c06\u4e0a\u8ff0 &#8220;Installed path&#8221; \u4e2d\u7684 \/root\/.tiup\/bin \u6dfb\u52a0\u5230PATH\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# cat \/root\/.bash_profile\r\n# .bash_profile\r\n\r\n# Get the aliases and functions\r\nif [ -f ~\/.bashrc ]; then\r\n        . ~\/.bashrc\r\nfi\r\n\r\n# User specific environment and startup programs\r\n\r\nPATH=$PATH:$HOME\/bin\r\n\r\nexport PATH\r\n\r\nexport PATH=\/root\/.tiup\/bin:$PATH\r\n<\/code><\/pre>\n<p>\u91cd\u65b0\u52a0\u8f7d.bash_profile\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# . ~\/.bash_profile\r\n[root@tisim ~]# which tiup\r\n\/root\/.tiup\/bin\/tiup\r\n<\/code><\/pre>\n<p>\u5b89\u88c5TiUP\u7684\u96c6\u7fa4\u7ec4\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# tiup cluster\r\ntiup is checking updates for component cluster ...timeout(2s)!\r\nThe component `cluster` version  is not installed; downloading from repository.\r\ndownload https:\/\/tiup-mirrors.pingcap.com\/cluster-v1.12.1-linux-amd64.tar.gz 8.68 MiB \/ 8.68 MiB 100.00% 14.41 MiB\/s\r\nStarting component `cluster`: \/root\/.tiup\/components\/cluster\/v1.12.1\/tiup-cluster\r\nDeploy a TiDB cluster for production\r\n\r\nUsage:\r\n  tiup cluster [command]\r\n\r\nAvailable Commands:\r\n  check       Perform preflight checks for the cluster.\r\n  deploy      Deploy a cluster for production\r\n  start       Start a TiDB cluster\r\n  stop        Stop a TiDB cluster\r\n  restart     Restart a TiDB cluster\r\n  scale-in    Scale in a TiDB cluster\r\n  scale-out   Scale out a TiDB cluster\r\n  destroy     Destroy a specified cluster\r\n  clean       (EXPERIMENTAL) Cleanup a specified cluster\r\n  upgrade     Upgrade a specified TiDB cluster\r\n  display     Display information of a TiDB cluster\r\n  prune       Destroy and remove instances that is in tombstone state\r\n  list        List all clusters\r\n  audit       Show audit log of cluster operation\r\n  import      Import an exist TiDB cluster from TiDB-Ansible\r\n  edit-config Edit TiDB cluster config\r\n  show-config Show TiDB cluster config\r\n  reload      Reload a TiDB cluster's config and restart if needed\r\n  patch       Replace the remote package with a specified package and restart the service\r\n  rename      Rename the cluster\r\n  enable      Enable a TiDB cluster automatically at boot\r\n  disable     Disable automatic enabling of TiDB clusters at boot\r\n  replay      Replay previous operation and skip successed steps\r\n  template    Print topology template\r\n  tls         Enable\/Disable TLS between TiDB components\r\n  meta        backup\/restore meta information\r\n  rotatessh   rotate ssh keys on all nodes\r\n  help        Help about any command\r\n  completion  Generate the autocompletion script for the specified shell\r\n\r\nFlags:\r\n  -c, --concurrency int     max number of parallel tasks allowed (default 5)\r\n      --format string       (EXPERIMENTAL) The format of output, available values are [default, json] (default \"default\")\r\n  -h, --help                help for tiup\r\n      --ssh string          (EXPERIMENTAL) The executor type: 'builtin', 'system', 'none'.\r\n      --ssh-timeout uint    Timeout in seconds to connect host via SSH, ignored for operations that don't need an SSH connection. (default 5)\r\n  -v, --version             version for tiup\r\n      --wait-timeout uint   Timeout in seconds to wait for an operation to complete, ignored for operations that don't fit. (default 120)\r\n  -y, --yes                 Skip all confirmations and assumes 'yes'\r\n\r\nUse \"tiup cluster help [command]\" for more information about a command.\r\n<\/code><\/pre>\n<p>\u5982\u679c\u5df2\u5b89\u88c5\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u66f4\u65b0\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# tiup update --self &amp;&amp; tiup update cluster\r\ndownload https:\/\/tiup-mirrors.pingcap.com\/tiup-v1.12.1-linux-amd64.tar.gz 7.15 MiB \/ 7.15 MiB 100.00% 15.46 MiB\/s\r\nUpdated successfully!\r\ncomponent cluster version v1.12.1 is already installed\r\nUpdated successfully!\r\n<\/code><\/pre>\n<p>\u5982\u679c\u50cf\u672c\u6587\u6240\u8ff0\u7684\u73af\u5883\u4e00\u6837\u4f7f\u7528\u5355\u4e00\u8282\u70b9\uff0c\u9700\u8981\u589e\u52a0ssh\u7684MaxSessions\u3002\u6309\u7167\u5feb\u901f\u5165\u95e8\u6307\u5357\u7684\u8bf4\u660e\uff0c\u5df2\u5c06\u5176\u66f4\u6539\u4e3a20\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# vi \/etc\/ssh\/sshd_config\r\n[root@tisim ~]# grep MaxSessions \/etc\/ssh\/sshd_config\r\n#MaxSessions 10\r\nMaxSessions 20\r\n<\/code><\/pre>\n<p>\u6211\u8981\u91cd\u65b0\u542f\u52a8sshd\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# systemctl restart sshd\r\n[root@tisim ~]# systemctl status sshd\r\n\u25cf sshd.service - OpenSSH server daemon\r\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/sshd.service; enabled; vendor preset: enabled)\r\n   Active: active (running) since \u65e5 2023-05-07 10:09:03 JST; 13s ago\r\n     Docs: man:sshd(8)\r\n           man:sshd_config(5)\r\n Main PID: 1942 (sshd)\r\n    Tasks: 1\r\n   CGroup: \/system.slice\/sshd.service\r\n           mq1942 \/usr\/sbin\/sshd -D\r\n\r\n 5\u6708 07 10:09:03 tisim.besite systemd[1]: Starting OpenSSH server daemon...\r\n 5\u6708 07 10:09:03 tisim.besite sshd[1942]: Server listening on 0.0.0.0 port 22.\r\n 5\u6708 07 10:09:03 tisim.besite sshd[1942]: Server listening on :: port 22.\r\n 5\u6708 07 10:09:03 tisim.besite systemd[1]: Started OpenSSH server daemon.\r\n<\/code><\/pre>\n<p>\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<div>\u9700\u8981\u4e3a\u540c\u4e00\u4e2a\u8282\u70b9\u5206\u914d\u4e0d\u540c\u7684\u7aef\u53e3\uff0c\u4ee5\u914d\u7f6e3\u4e2a TiKV\u3002<\/div>\n<p>\u53ef\u4ee5\u5229\u7528\u6837\u672ctopo.yaml\u6587\u4ef6\uff0c\u5e76\u4ec5\u66f4\u6539\u5176\u4e2d\u7684IP\u5730\u5740\u90e8\u5206\u3002<br \/>\n\u6216\u8005\uff0c\u6267\u884ctiup cluster template topology\u547d\u4ee4\uff0c\u4f3c\u4e4e\u53ef\u4ee5\u8f93\u51fa\u793a\u4f8b\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# vi topo.yaml\r\n[root@tisim ~]# cat topo.yaml\r\n# # Global variables are applied to all deployments and used as the default value of\r\n# # the deployments if a specific deployment value is missing.\r\nglobal:\r\n user: \"tidb\"\r\n ssh_port: 22\r\n deploy_dir: \"\/tidb-deploy\"\r\n data_dir: \"\/tidb-data\"\r\n\r\n# # Monitored variables are applied to all the machines.\r\nmonitored:\r\n node_exporter_port: 9100\r\n blackbox_exporter_port: 9115\r\n\r\nserver_configs:\r\n tidb:\r\n   log.slow-threshold: 300\r\n tikv:\r\n   readpool.storage.use-unified-pool: false\r\n   readpool.coprocessor.use-unified-pool: true\r\n pd:\r\n   replication.enable-placement-rules: true\r\n   replication.location-labels: [\"host\"]\r\n tiflash:\r\n   logger.level: \"info\"\r\n\r\npd_servers:\r\n - host: 192.168.3.171\r\n\r\ntidb_servers:\r\n - host: 192.168.3.171\r\n\r\ntikv_servers:\r\n - host: 192.168.3.171\r\n   port: 20160\r\n   status_port: 20180\r\n   config:\r\n     server.labels: { host: \"logic-host-1\" }\r\n\r\n - host: 192.168.3.171\r\n   port: 20161\r\n   status_port: 20181\r\n   config:\r\n     server.labels: { host: \"logic-host-2\" }\r\n\r\n - host: 192.168.3.171\r\n   port: 20162\r\n   status_port: 20182\r\n   config:\r\n     server.labels: { host: \"logic-host-3\" }\r\n\r\ntiflash_servers:\r\n - host: 192.168.3.171\r\n\r\nmonitoring_servers:\r\n - host: 192.168.3.171\r\n\r\ngrafana_servers:\r\n - host: 192.168.3.171\r\n<\/code><\/pre>\n<p>\u68c0\u67e5\u53ef\u5b89\u88c5\u7684TiDB\u7248\u672c\u3002\u8fd9\u6b21\u8981\u5b89\u88c5\u7684\u662fv7.0.0\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# tiup list tidb|grep 2023\r\nnightly -&gt; v7.2.0-alpha-nightly-20230507             2023-05-07T00:25:26+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv6.1.4                                               2023-02-08T11:32:28+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv6.1.5                                               2023-02-28T11:21:37+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv6.1.6                                               2023-04-12T11:03:44+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv6.5.1                                               2023-03-10T13:34:51+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv6.5.2                                               2023-04-21T10:50:24+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv6.6.0                                               2023-02-20T16:40:24+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv7.0.0                                               2023-03-30T10:29:21+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\nv7.2.0-alpha-nightly-20230507                        2023-05-07T00:25:26+08:00            darwin\/arm64,linux\/amd64,linux\/arm64,darwin\/amd64\r\n<\/code><\/pre>\n<p>\u4f7f\u7528tiup\u547d\u4ee4\u90e8\u7f72\u96c6\u7fa4\uff0c\u96c6\u7fa4\u540d\u79f0\u4e3a\uff0c\u7248\u672c\u4e3a\uff0c\u62d3\u6251\u6587\u4ef6\u4e3a.\/topo.yaml\uff0c\u7528\u6237\u4e3aroot\uff0c\u5bc6\u7801\u4e3a-p\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">cluster-name\u306b\u3001\u4efb\u610f\u306e\u30af\u30e9\u30b9\u30bf\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">version\u306b\u3001TiDB\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/ul>\n<pre class=\"post-pre\"><code>[root@tisim ~]# tiup cluster deploy demo-cluster v7.0.0 .\/topo.yaml --user root -p\r\ntiup is checking updates for component cluster ...\r\nStarting component `cluster`: \/root\/.tiup\/components\/cluster\/v1.12.1\/tiup-cluster deploy demo-cluster v7.0.0 .\/topo.yaml --user root -p\r\nInput SSH password:\r\n\r\n+ Detect CPU Arch Name\r\n  - Detecting node 192.168.3.171 Arch info ... Done\r\n\r\n+ Detect CPU OS Name\r\n  - Detecting node 192.168.3.171 OS info ... Done\r\nPlease confirm your topology:\r\nCluster type:    tidb\r\nCluster name:    demo-cluster\r\nCluster version: v7.0.0\r\nRole        Host           Ports                            OS\/Arch       Directories\r\n----        ----           -----                            -------       -----------\r\npd          192.168.3.171  2379\/2380                        linux\/x86_64  \/tidb-deploy\/pd-2379,\/tidb-data\/pd-2379\r\ntikv        192.168.3.171  20160\/20180                      linux\/x86_64  \/tidb-deploy\/tikv-20160,\/tidb-data\/tikv-20160\r\ntikv        192.168.3.171  20161\/20181                      linux\/x86_64  \/tidb-deploy\/tikv-20161,\/tidb-data\/tikv-20161\r\ntikv        192.168.3.171  20162\/20182                      linux\/x86_64  \/tidb-deploy\/tikv-20162,\/tidb-data\/tikv-20162\r\ntidb        192.168.3.171  4000\/10080                       linux\/x86_64  \/tidb-deploy\/tidb-4000\r\ntiflash     192.168.3.171  9000\/8123\/3930\/20170\/20292\/8234  linux\/x86_64  \/tidb-deploy\/tiflash-9000,\/tidb-data\/tiflash-9000\r\nprometheus  192.168.3.171  9090\/12020                       linux\/x86_64  \/tidb-deploy\/prometheus-9090,\/tidb-data\/prometheus-9090\r\ngrafana     192.168.3.171  3000                             linux\/x86_64  \/tidb-deploy\/grafana-3000\r\nAttention:\r\n    1. If the topology is not what you expected, check your yaml file.\r\n    2. Please confirm there is no port\/directory conflicts in same host.\r\nDo you want to continue? [y\/N]: (default=N) \r\n<\/code><\/pre>\n<p>\u5982\u679c\u62d3\u6251\u7ed3\u6784\u4e0e\u9884\u671f\u7684\u4e00\u6837\uff0c\u5c31\u8f93\u5165y\u5e76\u7ee7\u7eed\u3002<\/p>\n<pre class=\"post-pre\"><code>Do you want to continue? [y\/N]: (default=N) y\r\n+ Generate SSH keys ... Done\r\n+ Download TiDB components\r\n  - Download pd:v7.0.0 (linux\/amd64) ... Done\r\n  - Download tikv:v7.0.0 (linux\/amd64) ... Done\r\n  - Download tidb:v7.0.0 (linux\/amd64) ... Done\r\n  - Download tiflash:v7.0.0 (linux\/amd64) ... Done\r\n  - Download prometheus:v7.0.0 (linux\/amd64) ... Done\r\n  - Download grafana:v7.0.0 (linux\/amd64) ... Done\r\n  - Download node_exporter: (linux\/amd64) ... Done\r\n  - Download blackbox_exporter: (linux\/amd64) ... Done\r\n+ Initialize target host environments\r\n  - Prepare 192.168.3.171:22 ... Done\r\n+ Deploy TiDB instance\r\n  - Copy pd -&gt; 192.168.3.171 ... Done\r\n  - Copy tikv -&gt; 192.168.3.171 ... Done\r\n  - Copy tikv -&gt; 192.168.3.171 ... Done\r\n  - Copy tikv -&gt; 192.168.3.171 ... Done\r\n  - Copy tidb -&gt; 192.168.3.171 ... Done\r\n  - Copy tiflash -&gt; 192.168.3.171 ... Done\r\n  - Copy prometheus -&gt; 192.168.3.171 ... Done\r\n  - Copy grafana -&gt; 192.168.3.171 ... Done\r\n  - Deploy node_exporter -&gt; 192.168.3.171 ... Done\r\n  - Deploy blackbox_exporter -&gt; 192.168.3.171 ... Done\r\n+ Copy certificate to remote host\r\n+ Init instance configs\r\n  - Generate config pd -&gt; 192.168.3.171:2379 ... Done\r\n  - Generate config tikv -&gt; 192.168.3.171:20160 ... Done\r\n  - Generate config tikv -&gt; 192.168.3.171:20161 ... Done\r\n  - Generate config tikv -&gt; 192.168.3.171:20162 ... Done\r\n  - Generate config tidb -&gt; 192.168.3.171:4000 ... Done\r\n  - Generate config tiflash -&gt; 192.168.3.171:9000 ... Done\r\n  - Generate config prometheus -&gt; 192.168.3.171:9090 ... Done\r\n  - Generate config grafana -&gt; 192.168.3.171:3000 ... Done\r\n+ Init monitor configs\r\n  - Generate config node_exporter -&gt; 192.168.3.171 ... Done\r\n  - Generate config blackbox_exporter -&gt; 192.168.3.171 ... Done\r\nEnabling component pd\r\n        Enabling instance 192.168.3.171:2379\r\n        Enable instance 192.168.3.171:2379 success\r\nEnabling component tikv\r\n        Enabling instance 192.168.3.171:20162\r\n        Enabling instance 192.168.3.171:20161\r\n        Enabling instance 192.168.3.171:20160\r\n        Enable instance 192.168.3.171:20161 success\r\n        Enable instance 192.168.3.171:20160 success\r\n        Enable instance 192.168.3.171:20162 success\r\nEnabling component tidb\r\n        Enabling instance 192.168.3.171:4000\r\n        Enable instance 192.168.3.171:4000 success\r\nEnabling component tiflash\r\n        Enabling instance 192.168.3.171:9000\r\n        Enable instance 192.168.3.171:9000 success\r\nEnabling component prometheus\r\n        Enabling instance 192.168.3.171:9090\r\n        Enable instance 192.168.3.171:9090 success\r\nEnabling component grafana\r\n        Enabling instance 192.168.3.171:3000\r\n        Enable instance 192.168.3.171:3000 success\r\nEnabling component node_exporter\r\n        Enabling instance 192.168.3.171\r\n        Enable 192.168.3.171 success\r\nEnabling component blackbox_exporter\r\n        Enabling instance 192.168.3.171\r\n        Enable 192.168.3.171 success\r\nCluster `demo-cluster` deployed successfully, you can start it with command: `tiup cluster start demo-cluster --init`\r\n<\/code><\/pre>\n<p>\u542f\u52a8\u96c6\u7fa4\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# tiup cluster start demo-cluster\r\ntiup is checking updates for component cluster ...\r\nStarting component `cluster`: \/root\/.tiup\/components\/cluster\/v1.12.1\/tiup-cluster start demo-cluster\r\nStarting cluster demo-cluster...\r\n+ [ Serial ] - SSHKeySet: privateKey=\/root\/.tiup\/storage\/cluster\/clusters\/demo-cluster\/ssh\/id_rsa, publicKey=\/root\/.tiup\/storage\/cluster\/clusters\/demo-cluster\/ssh\/id_rsa.pub\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [Parallel] - UserSSH: user=tidb, host=192.168.3.171\r\n+ [ Serial ] - StartCluster\r\nStarting component pd\r\n        Starting instance 192.168.3.171:2379\r\n        Start instance 192.168.3.171:2379 success\r\nStarting component tikv\r\n        Starting instance 192.168.3.171:20162\r\n        Starting instance 192.168.3.171:20160\r\n        Starting instance 192.168.3.171:20161\r\n        Start instance 192.168.3.171:20161 success\r\n        Start instance 192.168.3.171:20160 success\r\n        Start instance 192.168.3.171:20162 success\r\nStarting component tidb\r\n        Starting instance 192.168.3.171:4000\r\n        Start instance 192.168.3.171:4000 success\r\nStarting component tiflash\r\n        Starting instance 192.168.3.171:9000\r\n        Start instance 192.168.3.171:9000 success\r\nStarting component prometheus\r\n        Starting instance 192.168.3.171:9090\r\n        Start instance 192.168.3.171:9090 success\r\nStarting component grafana\r\n        Starting instance 192.168.3.171:3000\r\n        Start instance 192.168.3.171:3000 success\r\nStarting component node_exporter\r\n        Starting instance 192.168.3.171\r\n        Start 192.168.3.171 success\r\nStarting component blackbox_exporter\r\n        Starting instance 192.168.3.171\r\n        Start 192.168.3.171 success\r\n+ [ Serial ] - UpdateTopology: cluster=demo-cluster\r\nStarted cluster `demo-cluster` successfully\r\n<\/code><\/pre>\n<p>\u67e5\u770b\u7fa4\u96c6\u5217\u8868\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# tiup cluster list\r\ntiup is checking updates for component cluster ...\r\nStarting component `cluster`: \/root\/.tiup\/components\/cluster\/v1.12.1\/tiup-cluster list\r\nName          User  Version  Path                                               PrivateKey\r\n----          ----  -------  ----                                               ----------\r\ndemo-cluster  tidb  v7.0.0   \/root\/.tiup\/storage\/cluster\/clusters\/demo-cluster  \/root\/.tiup\/storage\/cluster\/clusters\/demo-cluster\/ssh\/id_rsa\r\n<\/code><\/pre>\n<p>\u663e\u793a\u96c6\u7fa4\u7684\u62d3\u6251\u7ed3\u6784\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@tisim ~]# tiup cluster display demo-cluster\r\ntiup is checking updates for component cluster ...\r\nStarting component `cluster`: \/root\/.tiup\/components\/cluster\/v1.12.1\/tiup-cluster display demo-cluster\r\nCluster type:       tidb\r\nCluster name:       demo-cluster\r\nCluster version:    v7.0.0\r\nDeploy user:        tidb\r\nSSH type:           builtin\r\nDashboard URL:      http:\/\/192.168.3.171:2379\/dashboard\r\nGrafana URL:        http:\/\/192.168.3.171:3000\r\nID                   Role        Host           Ports                            OS\/Arch       Status   Data Dir                    Deploy Dir\r\n--                   ----        ----           -----                            -------       ------   --------                    ----------\r\n192.168.3.171:3000   grafana     192.168.3.171  3000                             linux\/x86_64  Up       -                           \/tidb-deploy\/grafana-3000\r\n192.168.3.171:2379   pd          192.168.3.171  2379\/2380                        linux\/x86_64  Up|L|UI  \/tidb-data\/pd-2379          \/tidb-deploy\/pd-2379\r\n192.168.3.171:9090   prometheus  192.168.3.171  9090\/12020                       linux\/x86_64  Up       \/tidb-data\/prometheus-9090  \/tidb-deploy\/prometheus-9090\r\n192.168.3.171:4000   tidb        192.168.3.171  4000\/10080                       linux\/x86_64  Up       -                           \/tidb-deploy\/tidb-4000\r\n192.168.3.171:9000   tiflash     192.168.3.171  9000\/8123\/3930\/20170\/20292\/8234  linux\/x86_64  Up       \/tidb-data\/tiflash-9000     \/tidb-deploy\/tiflash-9000\r\n192.168.3.171:20160  tikv        192.168.3.171  20160\/20180                      linux\/x86_64  Up       \/tidb-data\/tikv-20160       \/tidb-deploy\/tikv-20160\r\n192.168.3.171:20161  tikv        192.168.3.171  20161\/20181                      linux\/x86_64  Up       \/tidb-data\/tikv-20161       \/tidb-deploy\/tikv-20161\r\n192.168.3.171:20162  tikv        192.168.3.171  20162\/20182                      linux\/x86_64  Up       \/tidb-data\/tikv-20162       \/tidb-deploy\/tikv-20162\r\nTotal nodes: 8\r\n<\/code><\/pre>\n<p>\u6211\u5c06\u4eceMySQL\u5ba2\u6237\u7aef\u8fdb\u884c\u8fde\u63a5\u786e\u8ba4\u3002<\/p>\n<pre class=\"post-pre\"><code>[root@mysql01 ~]# mysql -h 192.168.3.171 -P 4000 -uroot\r\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\r\nYour MySQL connection id is 437\r\nServer version: 5.7.25-TiDB-v7.0.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible\r\n\r\nCopyright (c) 2000, 2023, Oracle and\/or its affiliates.\r\n\r\nOracle is a registered trademark of Oracle Corporation and\/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nmysql&gt; SHOW DATABASES;\r\n+--------------------+\r\n| Database           |\r\n+--------------------+\r\n| INFORMATION_SCHEMA |\r\n| METRICS_SCHEMA     |\r\n| PERFORMANCE_SCHEMA |\r\n| mysql              |\r\n| test               |\r\n+--------------------+\r\n5 rows in set (0.00 sec)\r\n<\/code><\/pre>\n<h1>\u603b\u7ed3<\/h1>\n<p>\u7531\u4e8e\u516c\u5f0f\u6307\u5357\u7684\u8d28\u91cf\u5f88\u9ad8\uff0c\u6211\u4eec\u6beb\u4e0d\u72b9\u8c6b\u5730\u6784\u5efa\u4e86TiDB\u3002\u672a\u6765\uff0c\u6211\u4eec\u8ba1\u5212\u8fdb\u884c\u6559\u7a0b\u5e76\u8fdb\u4e00\u6b65\u52a0\u6df1\u7406\u89e3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u6839\u636e TiDB \u6570\u636e\u5e93\u5e73\u53f0\u7684\u5feb\u901f\u5165\u95e8\u6307\u5357\u4e0b\u8ff0\u6b65\u9aa4\uff0c\u5df2\u6210\u529f\u642d\u5efa TiDB\u3002 Simulate produc [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-43739","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/tidb\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 \u6839\u636e TiDB \u6570\u636e\u5e93\u5e73\u53f0\u7684\u5feb\u901f\u5165\u95e8\u6307\u5357\u4e0b\u8ff0\u6b65\u9aa4\uff0c\u5df2\u6210\u529f\u642d\u5efa TiDB\u3002 Simulate produc [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/tidb\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-07T13:03:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-28T16:51:30+00:00\" \/>\n<meta name=\"author\" content=\"\u6587, \u7fd4\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6587, \u7fd4\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/\",\"name\":\"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-07T13:03:30+00:00\",\"dateModified\":\"2024-04-28T16:51:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c\",\"name\":\"\u6587, \u7fd4\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g\",\"caption\":\"\u6587, \u7fd4\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/wenxiang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/tidb\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09\/","og_locale":"zh_CN","og_type":"article","og_title":"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09","og_description":"\u9996\u5148 \u6839\u636e TiDB \u6570\u636e\u5e93\u5e73\u53f0\u7684\u5feb\u901f\u5165\u95e8\u6307\u5357\u4e0b\u8ff0\u6b65\u9aa4\uff0c\u5df2\u6210\u529f\u642d\u5efa TiDB\u3002 Simulate produc [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/tidb\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-07T13:03:30+00:00","article_modified_time":"2024-04-28T16:51:30+00:00","author":"\u6587, \u7fd4","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6587, \u7fd4","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/","name":"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-07T13:03:30+00:00","dateModified":"2024-04-28T16:51:30+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"TiDB\u7684\u914d\u7f6e\uff08\u5355\u8282\u70b9\u914d\u7f6e\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c","name":"\u6587, \u7fd4","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g","caption":"\u6587, \u7fd4"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/wenxiang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/tidb%e7%9a%84%e9%85%8d%e7%bd%ae%ef%bc%88%e5%8d%95%e8%8a%82%e7%82%b9%e9%85%8d%e7%bd%ae%ef%bc%89\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/43739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=43739"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/43739\/revisions"}],"predecessor-version":[{"id":69629,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/43739\/revisions\/69629"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=43739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=43739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=43739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}