tidb 启动或者reload user为空

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【 TiDB 使用环境】
【概述】场景+问题概述
【背景】做过哪些操作
【现象】业务和数据库现象
【业务影响】
【TiDB 版本】tidb4.0.7
【附件】

  1. TiUP Cluster Display 信息

  2. TiUP Cluster Edit Config 信息

  3. TiDB- Overview 监控

  • 对应模块日志(包含问题前后1小时日志)
2 个赞


没有获取到用户名称 导致ssh失败

2 个赞

看一下你的 tiup 配置的 yaml 文件。
方便的话贴一下

2 个赞

# 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: “root”
ssh_port: 22
deploy_dir: “/opt/bigdata1/tidb-deploy”
data_dir: “/opt/bigdata1/tidb-data”

server_configs:
tidb:
log.slow-threshold: 300
binlog.enable: false
binlog.ignore-error: false
tikv:
# server.grpc-concurrency: 4
# raftstore.apply-pool-size: 2
# raftstore.store-pool-size: 2
# rocksdb.max-sub-compactions: 1
storage.block-cache.capacity: “4GB”
# readpool.unified.max-thread-count: 12
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
pd:
replication.location-labels: [“host”]
replication.strictly-match-label: true
schedule.leader-schedule-limit: 4
schedule.region-schedule-limit: 2048
schedule.replica-schedule-limit: 64
pd_servers:

  • host: 192.168.116.51
    ssh_port: 22

    name: “pd-1”

    client_port: 2379

    peer_port: 2380

    deploy_dir: “/opt/bigdata1/tidb-deploy/pd-2379”
    data_dir: “/opt/bigdata1/tidb-data/pd-2379”
    log_dir: “/opt/bigdata1/tidb-deploy/pd-2379/log”

    numa_node: “0”

    # The following configs are used to overwrite the server_configs.pd values.

    config:

    schedule.max-merge-region-size: 20

    schedule.max-merge-region-keys: 200000

  • host: 192.168.116.52
  • host: 192.168.116.53
    tidb_servers:
  • host: 192.168.116.51
    ssh_port: 22
    port: 4000
    status_port: 10080
    deploy_dir: “/opt/bigdata1/tidb-deploy/tidb-4000”
    log_dir: “/opt/bigdata1/tidb-deploy/tidb-4000/log”

    numa_node: “1”

    # The following configs are used to overwrite the server_configs.tidb values.

    config:

    log.slow-query-file: tidb-slow-overwrited.log

  • host: 192.168.116.52
  • host: 192.168.116.53
    tikv_servers:
  • host: 192.168.116.51
    ssh_port: 22
    port: 20160
    status_port: 20180
    deploy_dir: “/opt/bigdata7/tidb-deploy/tikv-20160”
    data_dir: “/opt/bigdata7/tidb-data/tikv-20160”
    log_dir: “/opt/bigdata7/tidb-deploy/tikv-20160/log”

    numa_node: “0”

    # The following configs are used to overwrite the server_configs.tikv values.

    config:
    server.grpc-concurrency: 4
    server.labels: { host: “go51” }
  • host: 192.168.116.52
    ssh_port: 22
    port: 20160
    status_port: 20180
    deploy_dir: “/opt/bigdata7/tidb-deploy/tikv-20160”
    data_dir: “/opt/bigdata7/tidb-data/tikv-20160”
    log_dir: “/opt/bigdata7/tidb-deploy/tikv-20160/log”

    numa_node: “0”

    # The following configs are used to overwrite the server_configs.tikv values.

    config:
    server.grpc-concurrency: 4
    server.labels: { host: “go52” }
  • host: 192.168.116.53
    ssh_port: 22
    port: 20160
    status_port: 20180
    deploy_dir: “/opt/bigdata7/tidb-deploy/tikv-20160”
    data_dir: “/opt/bigdata7/tidb-data/tikv-20160”
    log_dir: “/opt/bigdata7/tidb-deploy/tikv-20160/log”

    numa_node: “0”

    # The following configs are used to overwrite the server_configs.tikv values.

    config:
    server.grpc-concurrency: 4
    server.labels: { host: “go53” }
2 个赞

你看下

2 个赞

方便的话上传一个格式化的 yaml 文件或者 txt 文件里面。

1 个赞

tidb.yaml (3.1 KB) tidb.yaml
好的

1 个赞

文件是没有问题的。
我在我自己的环境中修改了 ip,只部署 1 kv & 1 db & 1 pd 的结构。
可以正常运行。

[root@r10 .tiup]# tiup cluster deploy tidb-test v5.1.1 tidb-test.yaml
Starting component `cluster`: /root/.tiup/components/cluster/v1.5.5/tiup-cluster deploy tidb-test v5.1.1 tidb-test.yaml
Please confirm your topology:
Cluster type:    tidb
Cluster name:    tidb-test
Cluster version: v5.1.1
Role  Host           Ports        OS/Arch       Directories
----  ----           -----        -------       -----------
pd    192.168.88.13  2379/2380    linux/x86_64  /opt/bigdata1/tidb-deploy/pd-2379,/opt/bigdata1/tidb-data/pd-2379
tikv  192.168.88.12  20160/20180  linux/x86_64  /opt/bigdata7/tidb-deploy/tikv-20160,/opt/bigdata7/tidb-data/tikv-20160
tidb  192.168.88.12  4000/10080   linux/x86_64  /opt/bigdata1/tidb-deploy/tidb-4000
Attention:
    1. If the topology is not what you expected, check your yaml file.
    2. Please confirm there is no port/directory conflicts in same host.
Do you want to continue? [y/N]: (default=N) y
+ Generate SSH keys ... Done
+ Download TiDB components
  - Download pd:v5.1.1 (linux/amd64) ... Done
  - Download tikv:v5.1.1 (linux/amd64) ... Done
  - Download tidb:v5.1.1 (linux/amd64) ... Done
  - Download node_exporter: (linux/amd64) ... Done
  - Download blackbox_exporter: (linux/amd64) ... Done
+ Initialize target host environments
  - Prepare 192.168.88.13:22 ... Done
  - Prepare 192.168.88.12:22 ... Done
+ Copy files
  - Copy pd -> 192.168.88.13 ... Done
  - Copy tikv -> 192.168.88.12 ... Done
  - Copy tidb -> 192.168.88.12 ... Done
  - Copy node_exporter -> 192.168.88.13 ... Done
  - Copy node_exporter -> 192.168.88.12 ... Done
  - Copy blackbox_exporter -> 192.168.88.13 ... Done
  - Copy blackbox_exporter -> 192.168.88.12 ... Done
+ Check status
Enabling component pd
        Enabling instance 192.168.88.13:2379
        Enable instance 192.168.88.13:2379 success
Enabling component tikv
        Enabling instance 192.168.88.12:20160
        Enable instance 192.168.88.12:20160 success
Enabling component tidb
        Enabling instance 192.168.88.12:4000
        Enable instance 192.168.88.12:4000 success
Enabling component node_exporter
        Enabling instance 192.168.88.12
        Enabling instance 192.168.88.13
        Enable 192.168.88.13 success
        Enable 192.168.88.12 success
Enabling component blackbox_exporter
        Enabling instance 192.168.88.12
        Enabling instance 192.168.88.13
        Enable 192.168.88.13 success
        Enable 192.168.88.12 success
Cluster `tidb-test` deployed successfully, you can start it with command: `tiup cluster start tidb-test`
[root@r10 .tiup]# tiup cluster start tidb-test
Starting component `cluster`: /root/.tiup/components/cluster/v1.5.5/tiup-cluster start tidb-test
Starting cluster tidb-test...
+ [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=root, host=192.168.88.13
+ [Parallel] - UserSSH: user=root, host=192.168.88.12
+ [Parallel] - UserSSH: user=root, host=192.168.88.12
+ [ Serial ] - StartCluster
Starting component pd
        Starting instance 192.168.88.13:2379
        Start instance 192.168.88.13:2379 success
Starting component tikv
        Starting instance 192.168.88.12:20160
        Start instance 192.168.88.12:20160 success
Starting component tidb
        Starting instance 192.168.88.12:4000
        Start instance 192.168.88.12:4000 success
Starting component node_exporter
        Starting instance 192.168.88.12
        Starting instance 192.168.88.13
        Start 192.168.88.12 success
        Start 192.168.88.13 success
Starting component blackbox_exporter
        Starting instance 192.168.88.12
        Starting instance 192.168.88.13
        Start 192.168.88.13 success
        Start 192.168.88.12 success
+ [ Serial ] - UpdateTopology: cluster=tidb-test
Started cluster `tidb-test` successfully
1 个赞

您这面用的什么用户执行的 deploy 命令

1 个赞

tiup cluster:v1.2.1 deploy tidb v4.0.7 topology.yaml --user root -i /root/.ssh/id_rsa

我是要做ip更换操作,这个集群没有修改ip前是没有问题的
然后修改ip后。在运行上面操作就是这样了

1 个赞

能详细的描述一下您做了那些操作吗?
我这面复现一下。

1 个赞

我的目标是服务器要做迁移 所以ip会有变化 我之前在我本地的环境 ,操作的单机tidb 按照如下操作 可以正常切换ip
然后我现在在测试集群测试更换ip 就出现了启动不了集群的情况
1.按照上面的yaml文件创建集群
2.修改服务器ip 重启服务器
3.vi ~/.tiup/storage/cluster/clusters/tidb/meta.yaml 更换为新的ip
4.tiup cluster:v1.2.1 reload tidb 就出现上面的问题了

1 个赞

您是按照这篇文档进行的端口修改吗?

1 个赞

没有做重做pd操作。因为我之前在本地操作单机tidb的时候。发现没有重做pd 也是正常的,但是在我的测试集群tidb就出现错误了

现阶段 我按照文档操作。重做pd。可以正常了

pd 里面会保留元信息。ip 也在 pd 的元信息中。
如果更改 ip 是一定需要重建 pd 的。

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。