我们来在ARM系统架构平台上K8s跑TIDB

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:目标版本是3.0 / 3.0.1
  • 【问题描述】: 目前准备了一台ARM架构的服务器来进行编译构建工作,arm的k8s环境也已有。 目标是要构建tidb-docker镜像,替换helm的tidb-operator 和tidb-cluster这两个char的镜像 最终要顺利通过 k8s部署起来。 接下来的步骤大概应该是如何呢:

1、需要gitclone的项目列表:

git clone -b $tidb_version https://github.com/pingcap/tidb

git clone -b release-3.0 https://github.com/pingcap/pd

git clone -b release-3.0 https://github.com/tikv/tikv.git

git clone -b release-1.0 https://github.com/pingcap/tidb-operator.git

—还有那些呢-

2、编译顺序如何

3:dockerFile似乎github上有

4、能直接替换镜像 就运行起来吗?

可以参考一下这篇文章:

编译tidb-operator的时候错误

make GO15VENDOREXPERIMENT=“1” GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags ‘-s -w -X ‘github.com/pingcap/tidb-operator/version.buildDate=2019-11-29T08:55:04Z’ -X ‘github.com/pingcap/tidb-operator/version.gitCommit=0bea6da32cc54dcd8c3e753430293c1c2e7fa879’ -X ‘github.com/pingcap/tidb-operator/version.gitTreeState=clean’ -X ‘github.com/pingcap/tidb-operator/version.gitVersion=v1.0.4-2+0bea6da32cc54d’’ -o images/tidb-operator/bin/tidb-controller-manager cmd/controller-manager/main.go go: github.com/russross/blackfriday@v1.5.2+incompatible: reading https://goproxy.io/github.com/russross/blackfriday/@v/v1.5.2+incompatible.mod: 410 Gone Makefile:43: recipe for target ‘controller-manager’ failed make: *** [controller-manager] Error 1

tidb-monitor-reloader tidb-monitor-reloader-v1.0.0 在dockerfile有没 找了没有找到呀·

TIKV编译的时候报错

tidb/tikv# ROCKSDB_SYS_SSE=0 make release make dist_release make[1]: Entering directory ‘/usr/local/denali-tidb/tikv’ make build_release make[2]: Entering directory ‘/usr/local/denali-tidb/tikv’ cargo build --no-default-features --release --features " jemalloc portable no-fail" /bin/bash: cargo: 未找到命令 Makefile:131: recipe for target ‘build_release’ failed make[2]: *** [build_release] Error 127 make[2]: Leaving directory ‘/usr/local/denali-tidb/tikv’ Makefile:111: recipe for target ‘dist_release’ failed make[1]: *** [dist_release] Error 2 make[1]: Leaving directory ‘/usr/local/denali-tidb/tikv’ Makefile:91: recipe for target ‘release’ failed make: *** [release] Error 2

请问使用的 Tidb-Operator 是哪个版本?能提供一下 git commit id 吗?

tidb-monitor-reloader 的相关仓库与Dockerfile 在 https://github.com/pingcap/monitoring reloader 文件夹下

你好。·我用的operator是这样拉下来的分支 git clone -b release-1.0 https://github.com/pingcap/tidb-operator.git 是1.0的版吧

我现在正在编译tikv 装了rust cargo的环境 但是可能装的组件还没有好。。编译时依然还报错。。 错误信息如下:

make dist_release
make[1]: Entering directory '/usr/local/denali-tidb/tikv'
make build_release
make[2]: Entering directory '/usr/local/denali-tidb/tikv'
cargo build --no-default-features --release --features " jemalloc portable sse no-fail"
info: syncing channel updates for 'nightly-2019-06-14-aarch64-unknown-linux-gnu'
info: latest update on 2019-06-14, rust version 1.37.0-nightly (0e4a56b4b 2019-06-13)
error: component 'clippy' for target 'aarch64-unknown-linux-gnu' is unavailable for download for channel nightly-2019-06-14
Makefile:131: recipe for target 'build_release' failed
make[2]: *** [build_release] Error 1
make[2]: Leaving directory '/usr/local/denali-tidb/tikv'
Makefile:111: recipe for target 'dist_release' failed
make[1]: *** [dist_release] Error 2
make[1]: Leaving directory '/usr/local/denali-tidb/tikv'
Makefile:91: recipe for target 'release' failed
make: *** [release] Error 2

你好,请提供一下 operator 编译环境的 go version 信息。

go version go1.13.4 linux/arm64

原因什么问题啊 你还有什么需要我提供的 一次性提来~

你好,根据你的报错信息与相关的 issue 信息。

建议你使用 tidb-operator 1.0.3 及以上的 release 版本进行本地编译,你可以在 这里 找到 tidb-operator 的所有 release 资源。

Operator 在 1.0.3 及以上版本,将 golang 1.13 升级为了默认编译版本,相关 request

哦 这样 那我稍后试一下 。。那tikv编译那个问题呢 ? 麻烦帮忙看应该如何编

Hi,

关于 tikv 编译问题,请尝试以下操作:

  1. 执行 rustup set profile minimal
  2. 使用 cargo build 编译

cargo build
^C Fetch [=========> ] 19.38%
cargo build
Fetch [======> ] 13.60%
^C

跑到百分之十几就跑不下去了 试了一天了 是那里的问题 有解决办法吗?

建议检查一下环境的网络

网络没有问题啊 其他网络软件都是一直在线·· 你说的要如何检查呢?

从你给的日志来看,是从 github 上拉数据没有进行下去,所以要检一下你跟 github 之间的网络

error: failed to run custom build command for `snappy-sys v0.1.0 (https://github.com/busyjay/rust-snappy.git?branch=static-link#8c12738b)`

Caused by:
  process didn't exit successfully: `/usr/local/denali-tidb/tikv/target/debug/build/snappy-sys-767f8d823b86bde4/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/root/.cargo/git/checkouts/rust-snappy-0ed33e4b7b96fc57/8c12738/snappy-sys/snappy" "-DCMAKE_INSTALL_PREFIX=/usr/local/denali-tidb/tikv/target/debug/build/snappy-sys-4e3bffdbe48b66eb/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Debug"

--- stderr
thread 'main' panicked at '
failed to execute command: No such file or directory (os error 2)
is `cmake` not installed?

build script failed, must exit now', /root/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/cmake-0.1.35/src/lib.rs:778:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

最终能下载了 但还是编译失败了