How to Access the Dashboard Locally After Starting the Service with the Debug Button in Goland?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 在通过Goland中debug按钮启动服务后,如何在本地访问Dashboard?

| username: TiDBer_888

[TiDB Usage Environment] MAC machine
[TiDB Version] 6.2
[Reproduction Path] What operations were performed when the problem occurred
[Encountered Problem: Problem Phenomenon and Impact]
I am debugging the source code. After starting the service with the debug button in Goland on a MAC machine, how can I access the Dashboard locally? I checked the startup log and did not see the http service related to the Dashboard being started.

[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

Below is the startup log:
[2023/01/15 00:37:13.446 +08:00] [INFO] [main.go:352] [“disable Prometheus push client”]
[2023/01/15 00:37:13.446 +08:00] [INFO] [store.go:74] [“new store”] [path=unistore:///tmp/tidb]
[2023/01/15 00:37:13.446 +08:00] [INFO] [systime_mon.go:26] [“start system time monitor”]
[2023/01/15 00:37:13.481 +08:00] [INFO] [db.go:143] [“replay wal”] [“first key”=ff726567696f6e32(438744708887609345)]
[2023/01/15 00:37:13.938 +08:00] [INFO] [store.go:80] [“new store with retry success”]
[2023/01/15 00:37:13.939 +08:00] [INFO] [tidb.go:74] [“new domain”] [store=ea700a7a-e49a-4405-ac75-9c4c5152a4b0] [“ddl lease”=45s] [“stats lease”=3s] [“index usage sync lease”=0s]
[2023/01/15 00:37:13.956 +08:00] [INFO] [domain.go:180] [“full load InfoSchema success”] [currentSchemaVersion=0] [neededSchemaVersion=46] [“start time”=11.318376ms]
[2023/01/15 00:37:13.956 +08:00] [INFO] [domain.go:452] [“full load and reset schema validator”]
[2023/01/15 00:37:13.956 +08:00] [INFO] [ddl.go:645] [“[ddl] start DDL”] [ID=d821d63e-9b32-4aa9-a2d6-cffa9950b54e] [runWorker=true]
[2023/01/15 00:37:13.957 +08:00] [INFO] [ddl.go:591] [“[ddl] start delRangeManager OK”] [“is a emulator”=true]
[2023/01/15 00:37:13.957 +08:00] [WARN] [domain.go:908] [“pd / etcd client not provided, won’t begin Advancer.”]
[2023/01/15 00:37:13.957 +08:00] [INFO] [delete_range.go:158] [“[ddl] start delRange emulator”]
[2023/01/15 00:37:13.957 +08:00] [INFO] [ddl_worker.go:171] [“[ddl] start DDL worker”] [worker=“worker 1, tp general”]
[2023/01/15 00:37:13.957 +08:00] [INFO] [ddl_worker.go:171] [“[ddl] start DDL worker”] [worker=“worker 2, tp add index”]
[2023/01/15 00:37:13.962 +08:00] [WARN] [sysvar_cache.go:53] [“sysvar cache is empty, triggering rebuild”]
[2023/01/15 00:37:13.978 +08:00] [WARN] [misc.go:450] [“Automatic TLS Certificate creation is disabled”]
[2023/01/15 00:37:13.979 +08:00] [INFO] [server.go:252] [“server is running MySQL protocol”] [addr=0.0.0.0:4000]
[2023/01/15 00:37:13.980 +08:00] [INFO] [server.go:266] [“server is running MySQL protocol”] [socket=/tmp/tidb-4000.sock]
[2023/01/15 00:37:13.980 +08:00] [INFO] [http_status.go:87] [“for status and metrics report”] [“listening on addr”=0.0.0.0:10080]
[2023/01/15 00:37:13.980 +08:00] [INFO] [cpu.go:84] [“sql cpu collector started”]

| username: hey-hoho | Original post link

The dashboard is integrated into PD, so you need to debug the PD source code.

| username: TiDBer_888 | Original post link

Thank you for the reply. However, after downloading the source code of TiDB, when debugging, I start with the main() function in tidb-server/main.go. How do I debug PD? Which function should I set as the startup function?

| username: hey-hoho | Original post link

PD is a separate repository, the source code is here:

| username: TiDBer_888 | Original post link

Thank you for the reply. So, TiDB and PD each have their own separate repositories. If I want to debug the PD source code, how do I combine their source codes for debugging? For example, if I want to debug both TiDB and PD source codes, do I need to start TiDB first through the IDE, then download the PD source code, and then start PD through the debug button in the IDE to debug the PD source code? This way, both TiDB and PD source codes can be debugged?

| username: hey-hoho | Original post link

Yes, you can think of them as two separate projects.

| username: TiDBer_888 | Original post link

How are TiDB and PD associated? I don’t seem to see a configuration file that links the two. I only saw the configuration linking TiKV and PD.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.