首次启动集群报错:error reading server preface: http2: frame too large

【 TiDB 使用环境】测试

【 TiDB 版本】6.1.0

【复现路径】
环境:
VMware7u3平台虚拟机
Rocky Linux release 9.5 (Blue Onyx)
操作系统已关闭防火墙和selinux;
操作:
通过tiup在线部署tidb cluster,首次安全启动/非安全启动数据库均提示warn;
tiup 用root或tidb用户安装均报此类错误。

【遇到的问题:问题现象及影响】
初始数据库不能正常结束,不能显示临时密码。但tidb cluster查看状态正常,数据库可登录/查询/插入等操作。
在后续通过tiup修改cluster tikv log level等参数报类似错,且参数不能在各节点生效。

【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面


【复制黏贴 ERROR 报错的日志】
报错信息如下:

[root@tidb30 ~]# tiup cluster start tidb-test –init

…………………………

  • [ Serial ] - UpdateTopology: cluster=tidb-test

{“level”:“warn”,“ts”:“2025-02-21T16:20:27.656+0800”,“logger”:“etcd-client”,“caller”:“v3@v3.5.7/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc0002d3880/192.168.169.31:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = "error reading server preface: http2: frame too large"”}

Error: context deadline exceeded

Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2025-02-21-16-20-27.log.

tiup cluster start tidb-test

……………………………………

  • [ Serial ] - UpdateTopology: cluster=tidb-test

{“level”:“warn”,“ts”:“2025-02-21T17:29:05.003+0800”,“logger”:“etcd-client”,“caller”:“v3@v3.5.7/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc0001dc000/192.168.169.31:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = "error reading server preface: http2: frame too large"”}

Error: context deadline exceeded

Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2025-02-21-17-29-05.log.

两个log如下:
tiup-cluster-debug-2025-02-21-17-29-05.log
tiup-cluster-debug-2025-02-21-16-20-27.log
tiup-cluster-debug-2025-02-21-16-20-27.log (138.2 KB)
tiup-cluster-debug-2025-02-21-17-29-05.log (90.5 KB)

查看日志/root/.tiup/logs/tiup-cluster-debug-2025-02-21-16-20-27.log 有PD 节点报错,但查看对应节点服务已启动;:

2025-02-21T16:20:17.271+0800 INFO SSHCommand {“host”: “192.168.169.31”, “port”: “22”, “cmd”: “export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin; /usr/bin/sudo -H bash -c "systemctl daemon-reload && systemctl start blackbox_exporter-9115.service"”, “stdout”: “”, “stderr”: “”}

2025-02-21T16:20:17.271+0800 INFO CheckPoint {“host”: “192.168.169.31”, “port”: 22, “user”: “tidb”, “sudo”: true, “cmd”: “systemctl daemon-reload && systemctl start blackbox_exporter-9115.service”, “stdout”: “”, “stderr”: “”, “hash”: “775384c48a95f7047c016cbf2905eec1e267f629”, “func”: “github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute”, “hit”: false}

查看服务已启动

[root@tidb31 ~]# systemctl status blackbox_exporter-9115.service
● blackbox_exporter-9115.service - blackbox_exporter service
Loaded: loaded (/etc/systemd/system/blackbox_exporter-9115.service; enabled; preset: disabled)
Active: active (running) since Fri 2025-02-21 16:20:17 CST; 19min ago
Main PID: 19439 (blackbox_export)
Tasks: 16 (limit: 203157)
Memory: 12.3M
CPU: 6.819s
CGroup: /system.slice/blackbox_exporter-9115.service
├─19439 bin/blackbox_exporter/blackbox_exporter --web.listen-address=:9115 --log.level=info --config.file=conf/blackbox.yml
├─19440 /bin/bash /tidb-deploy/monitor-9100/scripts/run_blackbox_exporter.sh
└─19441 tee -i -a /tidb-deploy/monitor-9100/log/blackbox_exporter.log

Feb 21 16:20:17 tidb31 systemd[1]: Started blackbox_exporter service.
Feb 21 16:20:17 tidb31 bash[19441]: ts=2025-02-21T08:20:17.285Z caller=main.go:78 level=info msg=“Starting blackbox_exporter” version=“(version=0.23.0, branch=HEAD, revisio>
Feb 21 16:20:17 tidb31 bash[19441]: ts=2025-02-21T08:20:17.285Z caller=main.go:79 level=info build_context=”(go=go1.19.3, user=root@f360719453e3, date=20221202-12:26:32)"
Feb 21 16:20:17 tidb31 bash[19441]: ts=2025-02-21T08:20:17.286Z caller=main.go:91 level=info msg=“Loaded config file”
Feb 21 16:20:17 tidb31 bash[19441]: ts=2025-02-21T08:20:17.287Z caller=tls_config.go:232 level=info msg=“Listening on” address=[::]:9115
Feb 21 16:20:17 tidb31 bash[19441]: ts=2025-02-21T08:20:17.287Z caller=tls_config.go:235 level=info msg=“TLS is disabled.” http2=false address=[::]:9115

【其他附件:截图/日志/监控】

tiup 修改集群参数失败,提示超时;报错类似

$ tiup cluster reload tidb-test
………………………………

  • [ Serial ] - UpdateTopology: cluster=tidb-test

{“level”:“warn”,“ts”:“2025-02-18T16:00:55.818+0800”,“logger”:“etcd-client”,“caller”:“v3@v3.5.7/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc000410540/192.168.169.31:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = "error reading server preface: http2: frame too large"”}

Error: context deadline exceeded

Verbose debug logs has been written to /home/tidb/.tiup/logs/tiup-cluster-debug-2025-02-18-16-00-55.log.

dumpling 导出报错

[tidb@tidb30 tidb-community-toolkit-v6.1.5-linux-amd64]$ dumpling -h192.168.169.31 -P4000 -uroot -ptidb --filetype sql -t 8 -o /tmp/dept -r 2000 -F 256MiB -T emp.dep

Release version: v6.1.5

Git commit hash: 73d82e330b02a39f74073d98daefbadd7deab9b9

Git branch: heads/refs/tags/v6.1.5

Build timestamp: 2023-02-22 06:14:32Z

Go version: go version go1.19.5 linux/amd64

[2025/02/21 10:52:39.032 +08:00] [INFO] [versions.go:55] [“Welcome to dumpling”] [“Release Version”=v6.1.5] [“Git Commit Hash”=73d82e330b02a39f74073d98daefbadd7deab9b9] [“Git Branch”=heads/refs/tags/v6.1.5] [“Build timestamp”=“2023-02-22 06:14:32”] [“Go Version”=“go version go1.19.5 linux/amd64”]

[2025/02/21 10:52:39.037 +08:00] [INFO] [version.go:362] [“detect server version”] [type=TiDB] [version=6.1.5]

{“level”:“warn”,“ts”:“2025-02-21T10:52:49.053+0800”,“logger”:“etcd-client”,“caller”:“v3@v3.5.2/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc0009661c0/192.168.169.33:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection closed before server preface received”}

[2025/02/21 10:52:49.053 +08:00] [INFO] [dump.go:1370] [“meet error while check whether fetched pd addr and TiDB belong to one cluster. This won’t affect dump process”] [error=“context deadline exceeded”] [pdAddrs=“[192.168.169.33:2379,192.168.169.32:2379,192.168.169.31:2379]”]

[2025/02/21 10:52:49.055 +08:00] [WARN] [dump.go:1424] [“If the amount of data to dump is large, criteria: (data more than 60GB or dumped time more than 10 minutes)\nyou’d better adjust the tikv_gc_life_time to avoid export failure due to TiDB GC during the dump process.\nBefore dumping: run sql update mysql.tidb set VARIABLE_VALUE = '720h' where VARIABLE_NAME = 'tikv_gc_life_time'; in tidb.\nAfter dumping: run sql update mysql.tidb set VARIABLE_VALUE = '10m' where VARIABLE_NAME = 'tikv_gc_life_time'; in tidb.\n”]

[2025/02/21 10:52:49.073 +08:00] [INFO] [dump.go:117] [“begin to run Dump”] [conf=“{"s3":{"endpoint":"","region":"","storage-class":"","sse":"","sse-kms-key-id":"","acl":"","access-key":"","secret-access-key":"","provider":"","force-path-style":true,"use-accelerate-endpoint":false},"gcs":{"endpoint":"","storage-class":"","predefined-acl":"","credentials-file":""},"azblob":{"endpoint":"","account-name":"","account-key":"","access-tier":""},"AllowCleartextPasswords":false,"SortByPk":true,"NoViews":true,"NoSequences":true,"NoHeader":false,"NoSchemas":false,"NoData":false,"CompleteInsert":false,"TransactionalConsistency":true,"EscapeBackslash":true,"DumpEmptyDatabase":true,"PosAfterConnect":false,"CompressType":0,"Host":"192.168.169.31","Port":4000,"Threads":8,"User":"root","Security":{"CAPath":"","CertPath":"","KeyPath":""},"LogLevel":"info","LogFile":"","LogFormat":"text","OutputDirPath":"/tmp/dept","StatusAddr":":8281","Snapshot":"456158444007718913","Consistency":"snapshot","CsvNullValue":"\\N","SQL":"","CsvSeparator":",","CsvDelimiter":"\"","Databases":,"Where":"","FileType":"sql","ServerInfo":{"ServerType":3,"ServerVersion":"6.1.5","HasTiKV":true},"Rows":2000,"ReadTimeout":900000000000,"TiDBMemQuotaQuery":0,"FileSize":268435456,"StatementSize":1000000,"SessionParams":{"tidb_snapshot":"456158444007718913"},"Tables":{"emp":[{"Name":"dep","AvgRowLength":0,"Type":0}]},"CollationCompatible":"loose"}”]

[2025/02/21 10:52:49.166 +08:00] [INFO] [writer.go:255] [“no data written in table chunk”] [database=emp] [table=dep] [chunkIdx=0]

[2025/02/21 10:52:49.167 +08:00] [INFO] [collector.go:239] [“backup success summary”] [total-ranges=4] [ranges-succeed=4] [ranges-failed=0] [total-take=22.106216ms] [total-kv-size=270B] [average-speed=12.21kB/s] [total-rows=9]

[2025/02/21 10:52:49.168 +08:00] [INFO] [main.go:80] [“dump data successfully, dumpling will exit now”]

1 个赞

看着日志级别都是warn,应该是不影响使用的,导出也成功了,你检查下生成的文件,如果只是"error reading server preface: http2: frame too large"”这个报错的话,尝试调整tikv的如下参数

max-grpc-recv-msg-size
2 个赞

查到 max-grpc-send-msg-len参数,无‘max-grpc-recv-msg-size’参数;
另修改参数 max-grpc-send-msg-len后重新加载报错,报错同上,查tikv配置未生效。

[root@tidb30 ~]# tiup cluster reload tidb-test
Will reload the cluster tidb-test with restart policy is true, nodes: , roles: .
Do you want to continue? [y/N]:(default=N) y

  • [ 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=tidb, host=192.168.169.35
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.33
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.36
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.32
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.32
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.31
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.37
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.31
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.39
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.39
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.39
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.38
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.33
  • [Parallel] - UserSSH: user=tidb, host=192.168.169.34
  • [ Serial ] - UpdateTopology: cluster=tidb-test
    {“level”:“warn”,“ts”:“2025-02-24T14:18:34.467+0800”,“logger”:“etcd-client”,“caller”:“v3@v3.5.7/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc0002d28c0/192.168.169.31:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = "error reading server preface: http2: frame too large"”}

Error: context deadline exceeded

Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2025-02-24-14-18-34.log.

该log中有价值信息:

2025-02-24T14:18:34.468+0800 INFO Execute command finished {“code”: 1, “error”: “context deadline exceeded”, “errorVerbose”: “context deadline exceeded\ngithub.com/pingcap/errors.AddStack\n\tgithub.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/errors.go:174\ngithub.com/pingcap/errors.Trace\n\tgithub.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/juju_adaptor.go:15\ngithub.com/pingcap/tiup/pkg/cluster/manager.(*Manager).Reload\n\tgithub.com/pingcap/tiup/pkg/cluster/manager/reload.go:143\ngithub.com/pingcap/tiup/components/cluster/command.newReloadCmd.func1\n\tgithub.com/pingcap/tiup/components/cluster/command/reload.go:40\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v1.6.1/command.go:916\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v1.6.1/command.go:1044\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v1.6.1/command.go:968\ngithub.com/pingcap/tiup/components/cluster/command.Execute\n\tgithub.com/pingcap/tiup/components/cluster/command/root.go:297\nmain.main\n\tgithub.com/pingcap/tiup/components/cluster/main.go:23\nruntime.main\n\truntime/proc.go:267\nruntime.goexit\n\truntime/asm_amd64.s:1650”}

参考官方文档《快速上手TiDB-在单机上模拟部署生产环境集群》
OS:Centos7.9
部署 TiDB 6.1.0依然报错;

# tiup cluster start tidb-test –init

…………………………

  • [ Serial ] - UpdateTopology: cluster=tidb-test
    {“level”:“warn”,“ts”:“2025-02-24T17:02:50.517+0800”,“logger”:“etcd-client”,“caller”:“v3@v3.5.7/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc00011c1c0/192.168.169.41:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = "error reading server preface: http2: frame too large"”}
    Error: context deadline exceeded
    Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2025-02-24-17-02-50.log.
    删除集群,重新部署tidb 8.5.1 版本;启动无报错;
    # tiup cluster start tidb-test –init
    …………………………………………………………
  • [ Serial ] - UpdateTopology: cluster=tidb-test
    Started cluster tidb-test successfully
    The root password of TiDB database has been changed.
    The new password is: ‘N_X@k^8972az-T5L3g’.
    Copy and record it to somewhere safe, it is only displayed once, and will not be stored.
    The generated password can NOT be get and shown again.

但是,v8.5.1版本测试修改tikv参数,重新加载操作依然报错:

tiup cluster reload tidb-test


  • [ Serial ] - UpdateTopology: cluster=tidb-test

{“level”:“warn”,“ts”:“2025-02-26T10:14:05.749+0800”,“logger”:“etcd-client”,“caller”:“v3@v3.5.7/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc000568000/192.168.169.41:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = "error reading server preface: http2: frame too large"”}

Error: context deadline exceeded

Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2025-02-26-10-14-05.log.

该日志内容如下:

[root@tidbcluster tikv-20160]# cat /root/.tiup/logs/tiup-cluster-debug-2025-02-26-10-14-05.log
2025-02-26T10:13:48.848+0800 INFO Execute command {“command”: “tiup cluster reload tidb-test”}
2025-02-26T10:13:48.848+0800 DEBUG Environment variables {“env”: [“TIUP_HOME=/root/.tiup”, “TIUP_USER_INPUT_VERSION=”, “TIUP_VERSION=1.16.1”, “TIUP_COMPONENT_DATA_DIR=/root/.tiup/storage/cluster”, “TIUP_COMPONENT_INSTALL_DIR=/root/.tiup/components/cluster/v1.16.1”, “TIUP_TELEMETRY_STATUS=”, “TIUP_TELEMETRY_UUID=”, “TIUP_TELEMETRY_SECRET=”, “TIUP_WORK_DIR=/tidb-deploy”, “TIUP_TAG=Uds7nX3”, “TIUP_INSTANCE_DATA_DIR=/root/.tiup/data/Uds7nX3”, “XDG_SESSION_ID=946”, “HOSTNAME=tidbcluster”, “TERM=xterm”, “SHELL=/bin/bash”, “HISTSIZE=1000”, “SSH_CLIENT=192.168.110.7 54324 22”, “OLDPWD=/root”, “SSH_TTY=/dev/pts/0”, “http_proxy=192.168.118.199:808”, “USER=root”, “LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=01;36:.au=01;36:.flac=01;36:.mid=01;36:.midi=01;36:.mka=01;36:.mp3=01;36:.mpc=01;36:.ogg=01;36:.ra=01;36:.wav=01;36:.axa=01;36:.oga=01;36:.spx=01;36:*.xspf=01;36:”, “MAIL=/var/spool/mail/root”, “PATH=/root/.tiup/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin”, “PWD=/tidb-deploy”, “LANG=en_US.UTF-8”, “https_proxy=192.168.118.199:808”, “HISTCONTROL=ignoredups”, “SHLVL=1”, “HOME=/root”, “LOGNAME=root”, “XDG_DATA_DIRS=/root/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share”, “SSH_CONNECTION=192.168.110.7 54324 192.168.169.41 22”, “LESSOPEN=||/usr/bin/lesspipe.sh %s”, “XDG_RUNTIME_DIR=/run/user/0”, “DISPLAY=localhost:10.0”, “_=/root/.tiup/bin/tiup”, “TIUP_TELEMETRY_EVENT_UUID=7f9c9071-4737-4ef1-8df9-4c2bf9b77769”, “TIUP_MIRRORS=https://tiup-mirrors.pingcap.com”]}
2025-02-26T10:13:48.856+0800 DEBUG Initialize repository finished {“duration”: “7.248103ms”}
2025-02-26T10:13:55.745+0800 INFO + [ 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
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa.pub”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa.pub”}
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 INFO + [Parallel] - UserSSH: user=tidb, host=192.168.169.41
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskBegin {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.745+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.746+0800 DEBUG TaskFinish {“task”: “UserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41\nUserSSH: user=tidb, host=192.168.169.41”}
2025-02-26T10:13:55.746+0800 INFO + [ Serial ] - UpdateTopology: cluster=tidb-test
2025-02-26T10:13:55.746+0800 DEBUG TaskBegin {“task”: “UpdateTopology: cluster=tidb-test”}
2025-02-26T10:14:05.749+0800 DEBUG TaskFinish {“task”: “UpdateTopology: cluster=tidb-test”, “error”: “context deadline exceeded”}
2025-02-26T10:14:05.749+0800 INFO Execute command finished {“code”: 1, “error”: “context deadline exceeded”, “errorVerbose”: “context deadline exceeded\ngithub.com/pingcap/errors.AddStack\n\tgithub.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/errors.go:174\ngithub.com/pingcap/errors.Trace\n\tgithub.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/juju_adaptor.go:15\ngithub.com/pingcap/tiup/pkg/cluster/manager.(*Manager).Reload\n\tgithub.com/pingcap/tiup/pkg/cluster/manager/reload.go:143\ngithub.com/pingcap/tiup/components/cluster/command.newReloadCmd.func1\n\tgithub.com/pingcap/tiup/components/cluster/command/reload.go:40\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v1.6.1/command.go:916\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v1.6.1/command.go:1044\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v1.6.1/command.go:968\ngithub.com/pingcap/tiup/components/cluster/command.Execute\n\tgithub.com/pingcap/tiup/components/cluster/command/root.go:297\nmain.main\n\tgithub.com/pingcap/tiup/components/cluster/main.go:23\nruntime.main\n\truntime/proc.go:267\nruntime.goexit\n\truntime/asm_amd64.s:1650”}
[root@tidbcluster tikv-20160]#

问题到底在哪儿呢?

你 tiup 服务器上是不是有设置某些代理?

1 个赞

你把 “https_proxy=192.168.118.199:808” 这个取消试试

1 个赞

取消https_proxy等上网代理,执行报错,需要获取官网timestamp.json;
问题:本地部署,为啥需要联网获取timestamp.json文件?
报错内容为:

[root@tidbcluster ~]# tiup cluster reload tidb-test
Will reload the cluster tidb-test with restart policy is true, nodes: , roles: .
Do you want to continue? [y/N]:(default=N) y
+ [ 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=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [ Serial ] - UpdateTopology: cluster=tidb-test
+ Refresh instance configs
  - Generate config pd -> 192.168.169.41:2379 ... Error
  - Generate config tikv -> 192.168.169.41:20160 ... Error
  - Generate config tikv -> 192.168.169.41:20161 ... Error
  - Generate config tikv -> 192.168.169.41:20162 ... Error
  - Generate config tidb -> 192.168.169.41:4000 ... Error
  - Generate config tiflash -> 192.168.169.41:9000 ... Done
  - Generate config prometheus -> 192.168.169.41:9090 ... Done
  - Generate config grafana -> 192.168.169.41:3000 ... Done

Error: init config failed: 192.168.169.41:20160: fetch /timestamp.json from mirror(https://tiup-mirrors.pingcap.com) failed: download from https://tiup-mirrors.pingcap.com/timestamp.json failed: Get "https://tiup-mirrors.pingcap.com/timestamp.json": dial tcp: lookup tiup-mirrors.pingcap.com on 192.168.1.27:53: read udp 192.168.169.41:41274->192.168.1.27:53: i/o timeout: check config failed

Verbose debug logs has been written to /root/.tiup/logs/tiup-cluster-debug-2025-02-26-11-58-13.log.

1 个赞

考虑过设置本地mirror。
问题是:

  1. 与外网相通时,提示“error reading server preface: http2: frame too large”,这个是根本问题;
  2. 与外网不通时,提示从官网获取timestamp.json失败;本地化部署后修改配置为啥还需要连外网?投入生产后大概率不让连外网的。

这个目前感觉是代理对frame重新封装过。

TiUP在本地部署时需要互联网连接来获取timestamp.json文件的原因主要与安全性和版本控制有关。timestamp.json文件记录了当前快照的校验和信息,这对于确保从镜像下载的文件是最新的和未被篡改的至关重要。

在TiUP的工作流程中,客户端会从镜像请求timestamp.json文件,并使用本地的root.json文件中的公钥来验证其有效性。这一步骤确保了客户端获取的快照信息是最新的,并且没有被恶意修改。通过这种方式,TiUP可以保证下载的组件和元数据文件的完整性和安全性。

因此,即使在本地部署TiUP,仍然需要互联网连接来访问镜像服务器,以获取最新的timestamp.json文件,从而确保系统的安全性和可靠性。

https://docs.pingcap.com/zh/tidb/stable/tiup-mirror-reference#客户端工作流程

投入生产前能把离线镜像设置好,之后没有外网也不会有这两个问题了。

1 个赞

感谢各位相助的大佬!
反馈一下:设置本地镜像,且关闭外网连接后,修改tikv参数重新加载无报错。
经测试:多机标准部署V6.1.0 和单机部署V8.5.1 均以解决。
日志如下:

[root@tidbcluster ~]# tiup cluster reload tidb-test
Will reload the cluster tidb-test with restart policy is true, nodes: , roles: .
Do you want to continue? [y/N]:(default=N) y
+ [ 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=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [Parallel] - UserSSH: user=tidb, host=192.168.169.41
+ [ Serial ] - UpdateTopology: cluster=tidb-test
+ Refresh instance configs
  - Generate config pd -> 192.168.169.41:2379 ... Done
  - Generate config tikv -> 192.168.169.41:20160 ... Done
  - Generate config tikv -> 192.168.169.41:20161 ... Done
  - Generate config tikv -> 192.168.169.41:20162 ... Done
  - Generate config tidb -> 192.168.169.41:4000 ... Done
  - Generate config tiflash -> 192.168.169.41:9000 ... Done
  - Generate config prometheus -> 192.168.169.41:9090 ... Done
  - Generate config grafana -> 192.168.169.41:3000 ... Done
+ Refresh monitor configs
  - Generate config node_exporter -> 192.168.169.41 ... Done
  - Generate config blackbox_exporter -> 192.168.169.41 ... Done
+ [ Serial ] - Upgrade Cluster
Upgrading component tiflash
        Restarting instance 192.168.169.41:9000
        Restart instance 192.168.169.41:9000 success
Upgrading component pd
        Restarting instance 192.168.169.41:2379
        Restart instance 192.168.169.41:2379 success
Upgrading component tikv
        Evicting 2 leaders from store 192.168.169.41:20160...
          Still waiting for 2 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
          Still waiting for 1 store leaders to transfer...
        Restarting instance 192.168.169.41:20160
        Restart instance 192.168.169.41:20160 success
        Evicting 4 leaders from store 192.168.169.41:20161...
          Still waiting for 4 store leaders to transfer...
        Restarting instance 192.168.169.41:20161
        Restart instance 192.168.169.41:20161 success
        Evicting 5 leaders from store 192.168.169.41:20162...
          Still waiting for 5 store leaders to transfer...
          Still waiting for 5 store leaders to transfer...
        Restarting instance 192.168.169.41:20162
        Restart instance 192.168.169.41:20162 success
Upgrading component tidb
        Restarting instance 192.168.169.41:4000
        Restart instance 192.168.169.41:4000 success
Upgrading component prometheus
        Restarting instance 192.168.169.41:9090
        Restart instance 192.168.169.41:9090 success
Upgrading component grafana
        Restarting instance 192.168.169.41:3000
        Restart instance 192.168.169.41:3000 success
Stopping component node_exporter
        Stopping instance 192.168.169.41
        Stop 192.168.169.41 success
Stopping component blackbox_exporter
        Stopping instance 192.168.169.41
        Stop 192.168.169.41 success
Starting component node_exporter
        Starting instance 192.168.169.41
        Start 192.168.169.41 success
Starting component blackbox_exporter
        Starting instance 192.168.169.41
        Start 192.168.169.41 success
Reloaded cluster `tidb-test` successfully

1 个赞

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