[root@shawnyan tiup]# make gofmt (simplify) goimports (if installed) linting ⚠ https://revive.run/r#cognitive-complexity function newImportCmd has cognitive complexity 51 (> max enabled 48) ./components/cluster/command/import.go:31:1
⚠ https://revive.run/r#cognitive-complexity function (*Manager).Deploy has cognitive complexity 66 (> max enabled 48) ./pkg/cluster/manager/deploy.go:57:1
...
⚠ 25 problems (0 errors, 25 warnings)
Warnings: 25 cognitive-complexity
go mod tidy ./tools/check/check-tidy.sh GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go vet ./... make -C components/client make[1]: Entering directory `/root/tiup/components/client' gofmt (simplify) goimports (if installed) linting go mod tidy ../../tools/check/check-tidy.sh go: downloading github.com/spf13/cobra v1.3.0 go: downloading github.com/xo/usql v0.9.5 ... go: downloading github.com/go-sql-driver/mysql v1.6.0 ... GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go vet ./... GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s -X "github.com/pingcap/tiup/pkg/version.GitHash=041760d-dirty" -X "github.com/pingcap/tiup/pkg/version.GitRef=pr-shawnyan-0806" ' -o ../../bin/tiup-client . make[1]: Leaving directory `/root/tiup/components/client' GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s -X "github.com/pingcap/tiup/pkg/version.GitHash=041760d-dirty" -X "github.com/pingcap/tiup/pkg/version.GitRef=pr-shawnyan-0806" ' -o bin/tiup-cluster ./components/cluster GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s -X "github.com/pingcap/tiup/pkg/version.GitHash=041760d-dirty" -X "github.com/pingcap/tiup/pkg/version.GitRef=pr-shawnyan-0806" ' -o bin/tiup-dm ./components/dm GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s -X "github.com/pingcap/tiup/pkg/version.GitHash=041760d-dirty" -X "github.com/pingcap/tiup/pkg/version.GitRef=pr-shawnyan-0806" ' -o bin/tiup-server ./server
编译完成后,查看版本信息,为了便于识别演示,这里修改了 branch 和版本号。
投入使用
编译好的二进制文件在 bin 目录下,可以推送到私有 mirror 库,也可以替换本地的二进制文件进行验证测试。起一个 playground 进行测试可以正常使用。
从 TiUP v1.10.0 开始,新增支持新命令 tiup history 可以查看之前的调用记录。(#1808)
支持 csv, json 两种输出格式。
1 2 3 4 5 6 7 8 9 10 11
[shawnyan@centos7 7.2.0]$ tiup history --format=default | grep history 2023-08-07T10:22:33 tiup history 0 2023-08-07T12:15:17 tiup history --format json 0 2023-08-07T12:16:34 tiup history --format=json 0 2023-08-07T12:16:51 tiup history --format=csv 0 historylog save path: /home/shawnyan/.tiup/history [shawnyan@centos7 7.2.0]$ [shawnyan@centos7 7.2.0]$ tiup history --format=json | grep history {"time":"2023-08-07T10:22:33.18062534+09:00","command":"tiup history","exit_code":0} {"time":"2023-08-07T12:15:04.845158283+09:00","command":"tiup history --format json","exit_code":0} {"time":"2023-08-07T12:15:08.7993845+09:00","command":"tiup history --format json","exit_code":0}
Kylin Linux 10+, RHEL 8
tiup-cluster 支持在麒麟 (Kylin Linux 10+) 和红帽 (RHEL 8) 上部署。(#1886, #1896)
[shawnyan@centos7 7.2.0]$ tiup tikv-cdc version tiup is checking updates for component tikv-cdc ... Starting component `tikv-cdc`: /home/shawnyan/.tiup/components/tikv-cdc/v1.1.1/tikv-cdc version Release Version: cdc-v1.1.1 Git Commit Hash: 35d2af65811864e548dcd44aed69dd442f703344 Git Branch: HEAD UTC Build Time: 2023-02-28 08:13:06 Go Version: go version go1.18.1 linux/amd64 Failpoint Build: false
[shawnyan@centos7 7.2.0]$ tiup tikv-cdc --help tiup is checking updates for component tikv-cdc ... Starting component `tikv-cdc`: /home/shawnyan/.tiup/components/tikv-cdc/v1.1.1/tikv-cdc --help TiKV Change Data Capture
Usage: tikv-cdc [command]
Available Commands: cli Manage replication task and TiKV-CDC cluster help Help about any command server Start a TiKV-CDC capture server version Output version information
Flags: -h, --helphelpfor tikv-cdc
Use "tikv-cdc [command] --help"for more information about a command.
# # Server configs are used to specify the configuration of TiKV-CDC Servers. kvcdc_servers: -host:10.0.1.20 # # SSH port of the server. # ssh_port: 22 # # TiKV-CDC Server communication port. port:8600 # # TiKV-CDC Server data storage directory. data_dir:"/data1/tidb-data/tikv-cdc-8600" # # TiKV-CDC Server log file storage directory. log_dir:"/data1/tidb-deploy/tikv-cdc-8600/log" -host:10.0.1.21 data_dir:"/data1/tidb-data/tikv-cdc-8600" log_dir:"/data1/tidb-deploy/tikv-cdc-8600/log"
# # Server configs are used to specify the configuration of TiDB Dashboard Servers. Available from v6.5.0 # tidb_dashboard_servers: # # The ip address of the PD Server. # - host: 10.0.1.11 # # SSH port of the server. # ssh_port: 22 # # port of TiDB Dashboard # port: 12333 # # TiDB Dashboard deployment file, startup script, configuration file storage directory. # deploy_dir: "/tidb-deploy/tidb-dashboard-12333" # # PD Server data storage directory. # data_dir: "/tidb-data/tidb-dashboard-12333" # # PD Server log file storage directory. # log_dir: "/tidb-deploy/tidb-dashboard-12333/log" # # numa node bindings. # numa_node: "0,1"