[shawnyan@centos7 ~]$ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [shawnyan@centos7 ~]$ uname -a Linux centos7.shawnyan.com 3.10.0-1160.92.1.el7.x86_64 #1 SMP Tue Jun 20 11:48:01 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux [shawnyan@centos7 ~]$ go version go version go1.20.6 linux/amd64
PD 编译依赖 go 1.20,所以需要先安装 golang。但是,CentOS 7 默认提供的是 golang 1.19。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[shawnyan@centos7 ~]$ yum info golang Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager Loading mirror speeds from cached hostfile Installed Packages Name : golang Arch : x86_64 Version : 1.19.10 Release : 1.el7 Size : 7.4 M Repo : installed From repo : epel-7-aliyun Summary : The Go Programming Language URL : http://golang.org/ License : BSD and Public Domain Description : The Go Programming Language.
[shawnyan@centos7 pd]$ go version go version go1.19.10 linux/amd64
所以,需要手动下载二进制包并更新环境变量。
1 2 3 4 5 6 7 8 9
wget https://go.dev/dl/go1.20.6.linux-amd64.tar.gz tar zxvf go1.20.6.linux-amd64.tar.gz sudo mv go /opt
vi ~/.bashrc export GOl11MODULE=on export GOROOT=/opt/go export GOPATH=/home/shawnyan export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
The integrity of 1189 files was checked. This might have caused installation to take longer. Done in 6m 53.8s cd ui &&\ pnpm build > tidb-dashboard-ui@1.0.0 build /home/shawnyan/tidb-dashboard-master/ui > pnpm -r build
packages/tidb-dashboard-lib | WARN The field "resolutions" was found in /home/shawnyan/tidb-dashboard-master/ui/packages/tidb-dashboard-lib/package.json. This will not take effect. You should configure "resolutions" at the root of the workspace instead. Scope: 7 of 8 workspace projects packages/clinic-client build$ gulp build [28 lines collapsed] │ [main] INFO o.o.codegen.TemplateManager - writing file /home/shawnyan/tidb-dashboard-master/ui/packages/clinic-client/src/client/api/.openapi-generator/FILES │ ################################################################################ │ # Thanks for using OpenAPI Generator. # │ # Please consider donation to help us maintain this project 🙏 ## │ # https://opencollective.com/openapi_generator/donate # │ ################################################################################ │ [17:37:00] Finished 'swagger:gen' after 45 min │ [17:37:00] Starting 'tsc:build'... │ [17:37:14] Finished 'tsc:build' after 14 s │ [17:37:14] Finished 'build' after 45 min └─ Done in 45m 36.6s ...
[shawnyan@centos7 bin]$ ./tidb-dashboard --help Usage of ./tidb-dashboard: --cluster-allowed-names string comma-delimited list of acceptable peer certificate SAN identities --cluster-ca string (TLS between components of the TiDB cluster) path of file that contains list of trusted SSL CAs --cluster-cert string (TLS between components of the TiDB cluster) path of file that contains X509 certificate in PEM format --cluster-key string (TLS between components of the TiDB cluster) path of file that contains X509 key in PEM format --data-dir string path to the Dashboard Server data directory (default "/tmp/dashboard-data") -d, --debug enable debug logs --experimental allow experimental features --feature-version string target TiDB version for standalone mode (default "N/A") -h, --host string listen host of the Dashboard Server (default "127.0.0.1") --path-prefix string public URL path prefix for reverse proxies (default "/dashboard") --pd string PD endpoint address that Dashboard Server connects to (default "http://127.0.0.1:2379") -p, --port int listen port of the Dashboard Server (default 12333) --telemetry allow telemetry --temp-dir string path to the Dashboard Server temporary directory, used to store the searched logs --tidb-allowed-names string comma-delimited list of acceptable peer certificate SAN identities --tidb-ca string (TLS for MySQL client) path of file that contains list of trusted SSL CAs --tidb-cert string (TLS for MySQL client) path of file that contains X509 certificate in PEM format --tidb-key string (TLS for MySQL client) path of file that contains X509 key in PEM format -v, --version print version information and exit pflag: help requested