TIKV新增实例报错Could not match supplied host pattern

* 【TiDB 版本】:v3.0.12
* 【问题描述】:tikv 新增实例报错
inventory.ini 
[tikv_servers]
TiKV1-1 ansible_host=10.140.0.16 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb3"
TiKV1-2 ansible_host=10.140.0.16 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb3"
TiKV2-1 ansible_host=10.140.0.17 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb4"
TiKV2-2 ansible_host=10.140.0.17 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb4"
TiKV3-1 ansible_host=10.140.0.18 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb5"
TiKV3-2 ansible_host=10.140.0.18 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb5"

[tidb@tidb1 tidb-ansible]$ ansible-playbook deploy.yml -l tikv1-2,tikv2-2,tikv3-2
 [WARNING]: Could not match supplied host pattern, ignoring: tikv1-2
 [WARNING]: Could not match supplied host pattern, ignoring: tikv2-2
 [WARNING]: Could not match supplied host pattern, ignoring: tikv3-2
ERROR! Specified hosts and/or --limit does not match any hosts

您好: TiKV1-1这里区分大小写,安装你的tikv_servers里配置的名称尝试下

请确认一下 labels 字段的 “host” 的内容是否正确,现在是labels=“host=tidb4”

这个host 确认了没有问题。

帮我看一下我现在一台服务器上的多个实例分配在不同的目录上,这个怎么配置呢?

Global variables

[all:vars] deploy_dir = /data/tidb/deploy

[tikv_servers]
TiKV1-1 ansible_host=10.140.0.16 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb3"
TiKV1-2 ansible_host=10.140.0.16 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb3"
TiKV2-1 ansible_host=10.140.0.17 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb4"
TiKV2-2 ansible_host=10.140.0.17 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb4"
TiKV3-1 ansible_host=10.140.0.18 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb5"
TiKV3-2 ansible_host=10.140.0.18 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb5"

目录相关的问题,参考这里

新实例初始化的时候提示这个问题:
ERROR MESSAGE SUMMARY *****************************************************************************************************************************
[TiKV1-2]: Ansible FAILED! => playbook: bootstrap.yml; TASK: machine_benchmark : Preflight check - Does fio randread iops of tikv_data_dir disk meet requirement; message: {"changed": false, "msg": "fio: randread iops of tikv_data_dir disk is too low: 8370 < 40000, it is strongly recommended to use SSD disks for TiKV and PD, or there might be performance issues."}
Ask for help:
Contact us: support@pingcap.com
It seems that you encounter some problems. You can send an email to the above email address, attached with the tidb-ansible/inventory.ini and tidb-ansible/log/ansible.log files and the error message, or new issue on https://github.com/pingcap/tidb-ansible/issues. We'll try our best to help you deploy a TiDB cluster. Thanks. :-)

此类问题论坛好多。

我的实例磁盘是SSD 2T的,也不够嘛,也会提示这个问题,这个是说不建议在生产环境做禁用这个检查,可是我的就是生产环境

从错误信息来看是磁盘的 IOPS 不达标,TiDB 期望 NVMe SSD, 若是对系统性能要求不高的话,可以先关闭检查,命令:ansible-playbook bootstrap.yml --extra-vars “dev_mode=True”

1赞
哦哦,这样呀,还有一个问题。帮我看一下我的lable 状态是否正确的。
TiKV1-1 ansible_host=10.140.0.16 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb3"
TiKV1-2 ansible_host=10.140.0.16 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb3"
TiKV2-1 ansible_host=10.140.0.17 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb4"
TiKV2-2 ansible_host=10.140.0.17 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb4"
TiKV3-1 ansible_host=10.140.0.18 deploy_dir=/data/tidb/deploy tikv_port=20171 tikv_status_port=20181 labels="host=tidb5"
TiKV3-2 ansible_host=10.140.0.18 deploy_dir=/data1/tidb/deploy tikv_port=20172 tikv_status_port=20182 labels="host=tidb5"

正常情况是3个副本集,tidb3 下面的两个实例为一个副本集,tidb 4 下面的2个实例为一个副本集,tidb 5也是一样的。

[tidb@tidb1 tidb-ansible]$ /home/tidb/tidb-ansible/resources/bin/pd-ctl -i -u http://10.140.0.18:2379
+ label
[
  {
    "key": "host",
    "value": "tidb4"
  },
  {
    "key": "host",
    "value": "tidb5"
  },
  {
    "key": "host",
    "value": "tidb3"
  }
]

+ store
{
  "count": 6,
  "stores": [
    {
      "store": {
        "id": 4,
        "address": "10.140.0.17:20171",
        "labels": [
          {
            "key": "host",
            "value": "tidb4"
          }
        ],
        "version": "3.0.12",
        "state_name": "Up"
      },
      "status": {
        "capacity": "1.952TiB",
        "available": "1.947TiB",
        "leader_count": 11,
        "leader_weight": 1,
        "leader_score": 11,
        "leader_size": 11,
        "region_count": 13,
        "region_weight": 1,
        "region_score": 38,
        "region_size": 38,
        "start_ts": "2020-03-19T08:20:33Z",
        "last_heartbeat_ts": "2020-03-23T03:36:47.422491068Z",
        "uptime": "91h16m14.422491068s"
      }
    },
    {
      "store": {
        "id": 5,
        "address": "10.140.0.18:20171",
        "labels": [
          {
            "key": "host",
            "value": "tidb5"
          }
        ],
        "version": "3.0.12",
        "state_name": "Up"
      },
      "status": {
        "capacity": "1.952TiB",
        "available": "1.946TiB",
        "leader_count": 1,
        "leader_weight": 1,
        "leader_score": 15,
        "leader_size": 15,
        "region_count": 12,
        "region_weight": 1,
        "region_score": 37,
        "region_size": 37,
        "start_ts": "2020-03-19T08:20:33Z",
        "last_heartbeat_ts": "2020-03-23T03:36:46.439155379Z",
        "uptime": "91h16m13.439155379s"
      }
    },
    {
      "store": {
        "id": 60880,
        "address": "10.140.0.18:20172",
        "labels": [
          {
            "key": "host",
            "value": "tidb5"
          }
        ],
        "version": "3.0.12",
        "state_name": "Up"
      },
      "status": {
        "capacity": "1.952TiB",
        "available": "1.952TiB",
        "leader_count": 6,
        "leader_weight": 1,
        "leader_score": 6,
        "leader_size": 6,
        "region_count": 29,
        "region_weight": 1,
        "region_score": 29,
        "region_size": 29,
        "start_ts": "2020-03-23T03:28:59Z",
        "last_heartbeat_ts": "2020-03-23T03:36:49.656054272Z",
        "uptime": "7m50.656054272s"
      }
    },
    {
      "store": {
        "id": 60881,
        "address": "10.140.0.16:20172",
        "labels": [
          {
            "key": "host",
            "value": "tidb3"
          }
        ],
        "version": "3.0.12",
        "state_name": "Up"
      },
      "status": {
        "capacity": "1.952TiB",
        "available": "1.952TiB",
        "leader_count": 12,
        "leader_weight": 1,
        "leader_score": 12,
        "leader_size": 12,
        "region_count": 29,
        "region_weight": 1,
        "region_score": 29,
        "region_size": 29,
        "start_ts": "2020-03-23T03:28:25Z",
        "last_heartbeat_ts": "2020-03-23T03:36:46.065325702Z",
        "uptime": "8m21.065325702s"
      }
    },
    {
      "store": {
        "id": 60882,
        "address": "10.140.0.17:20172",
        "labels": [
          {
            "key": "host",
            "value": "tidb4"
          }
        ],
        "version": "3.0.12",
        "state_name": "Up"
      },
      "status": {
        "capacity": "1.952TiB",
        "available": "1.952TiB",
        "leader_count": 8,
        "leader_weight": 1,
        "leader_score": 8,
        "leader_size": 8,
        "region_count": 28,
        "region_weight": 1,
        "region_score": 28,
        "region_size": 28,
        "start_ts": "2020-03-23T03:28:40Z",
        "last_heartbeat_ts": "2020-03-23T03:36:50.965489158Z",
        "uptime": "8m10.965489158s"
      }
    },
    {
      "store": {
        "id": 1,
        "address": "10.140.0.16:20171",
        "labels": [
          {
            "key": "host",
            "value": "tidb3"
          }
        ],
        "version": "3.0.12",
        "state_name": "Up"
      },
      "status": {
        "capacity": "1.952TiB",
        "available": "1.946TiB",
        "leader_count": 3,
        "leader_weight": 1,
        "leader_score": 14,
        "leader_size": 14,
        "region_count": 12,
        "region_weight": 1,
        "region_score": 37,
        "region_size": 37,
        "start_ts": "2020-03-19T08:20:33Z",
        "last_heartbeat_ts": "2020-03-23T03:36:43.93042207Z",
        "uptime": "91h16m10.93042207s"
      }
    }
  ]
}

label 打标签我看的有点儿乱,你们可以帮我弄一下不?

从描述来看可能副本集、lables 相关的概念理解有点出入,请参考这里