mydumper 导出全库时报错,[err=“query metric error: [domain:9009]Prometheus address is not set in PD and etcd

在v4.0.4 执行mydumper 导出全库时 ,报以下错, 请问如何处理,


prometheus 是有部署并运行的

PS:数据库是从 2.0 升级到3.0 再升级到4.0.4的 ,

hi,
辛苦贴下,mydumper 的版本以及 mydumper 的执行语句和 log,对应 tidb 版本。感谢配合

mydumper版本:


导出命令:
mydumper -c -h xx -P xx -t 2 --skip-tz-utc all-databases -u xx -p xx -o xx -L back.log
日志:
back.log.tar.gz (4.7 KB)

你的问题已收到,暂时先通过 -x, --regex 对需要同步的数据库表进行过滤下吧,从而忽略掉 metric_schema 的备份。

select * from METRICS_SCHEMA.etcd_disk_wal_fsync_rate limit 10; 结果看下,是否会报错。

有报错的:


貌似4.0.2没有问题 ,这是4.0.4版本的问题吗?

执行上面 select 对应时间的 tidb log 看下输出什么报错,输出下 tiup cluster display cluster-name 结果

[2020/08/10 14:25:37.321 +08:00] [ERROR] [conn.go:730] [“command dispatched failed”] [conn=888] [connInfo=“id:888, addr:xxx:17088 status:10, collation:utf8_general_ci, user:root”] [command=Query] [status=“inTxn:0, autocommit:1”] [sql=“select * from METRICS_SCHEMA.etcd_disk_wal_fsync_rate limit 10”] [txn_mode=OPTIMISTIC] [err=“query metric error: [domain:9009]Prometheus address is not set in PD and etcd
github.com/pingcap/tidb/executor.(*MetricRetriever).retrieve
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/executor/metrics_reader.go:83
github.com/pingcap/tidb/executor.(*MemTableReaderExec).Next
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/executor/memtable_reader.go:108
github.com/pingcap/tidb/executor.Next
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/executor/executor.go:249
github.com/pingcap/tidb/executor.(*LimitExec).Next
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/executor/executor.go:1012
github.com/pingcap/tidb/executor.Next
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/executor/executor.go:249
github.com/pingcap/tidb/executor.(*recordSet).Next
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/executor/adapter.go:126
github.com/pingcap/tidb/server.(*tidbResultSet).Next
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/server/driver_tidb.go:386
github.com/pingcap/tidb/server.(*clientConn).writeChunks
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/server/conn.go:1412
github.com/pingcap/tidb/server.(*clientConn).writeResultset
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/server/conn.go:1378
github.com/pingcap/tidb/server.(*clientConn).handleQuery
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/server/conn.go:1286
github.com/pingcap/tidb/server.(*clientConn).dispatch
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/server/conn.go:906
github.com/pingcap/tidb/server.(*clientConn).Run
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/server/conn.go:715
github.com/pingcap/tidb/server.(*Server).onConn
\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/server/server.go:415
runtime.goexit
\t/usr/local/go/src/runtime/asm_amd64.s:1357”]

先验证看下当前 metric-storage 的状态:curl http://pdhost:pdport/pd/api/v1/config

修复:
tiup ctl pd --pd=“http://{pd-ip}:{pd-port}” config set metric-storage http://{prometheus-ip}:{prometheus-port}
验证:
curl http://pdhost:pdport/pd/api/v1/config

已经修复了 ,谢谢, 请问这是什么原因导致, 是我升级操作不当导致吗?我升级都是按照文档来处理的

我们正在评估这个问题,有进展我会及时更新这个帖子,感谢反馈,
再确认下集群是否由 3.x 升级到 4.x 并不是直接 deploy 。

集群是从 v2.0.8 升级到3.0.17 , 再升级到 v4.0.4

ok,有进展我们会随时回复,可能需要提供一些信息,可以把 log 备份一份,

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