Is it possible to specify a locally compiled binary file for TiDB configuration when deploying a TiDB cluster using TiUP?

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

Original topic: 能否用TiUP部署TiDB集群时,指定TiDB配置为本地已经编译好的二进制文件

| username: TiDB学习小白

I compiled TiDB, TiKV, and PD locally. Can I use the TiUP tool to deploy the TiDB cluster by specifying local files? That is, modify the topology file so that other components still use the ones from the cloud, while TiDB, TiKV, etc., use the ones I compiled locally. Is this feasible?

| username: WalterWj | Original post link

Use the tiup patch function to apply a patch. However, it is not recommended.

| username: TiDB学习小白 | Original post link

Is there no other way? Do we have to compile and start each component individually?

| username: shigp_TIDBER | Original post link

Waiting for the best answer.

| username: DBAER | Original post link

I don’t quite understand what you want to do.

| username: TiDB学习小白 | Original post link

Because I want to try learning the TiDB source code and possibly make modifications, I need to compile the TiDB files myself. At this point, I think using TiUP to manage the cluster would be more convenient.

| username: onlyacat | Original post link

This is too troublesome.
Just set up a cluster locally and then overwrite the tidb binary in the deploy directory.

| username: zhanggame1 | Original post link

This is reliable.

| username: TiDB学习小白 | Original post link

Yes, I tried it before and it worked. I’m just worried if there might be any hidden risks if we modify the code later.

| username: TiDBer_QYr0vohO | Original post link

First, deploy a cluster, then try replacing the binary startup files.

| username: 舞动梦灵 | Original post link

I haven’t used binary compilation for installation. The tiup method is very convenient, but I remember reading an article that mentioned it is possible to use the tiup tool for operations. However, you mentioned modifying the topology file with tiup and using the compiled version for other tasks. It feels like having two drivers for one car, which makes it unclear who is actually in control. This approach is not convenient for later maintenance; it’s best to stick to one method.

| username: Daniel-W | Original post link

Try using tiup mirror publish to publish the compiled binary to the mirror.
tiup mirror publish | PingCAP Documentation Center

I have done it before, it works.

| username: TiDB学习小白 | Original post link

Okay, thank you. I will look into this method.

| username: TiDB学习小白 | Original post link

Yes, thank you.

| username: 裤衩儿飞上天 | Original post link

You can customize repositories and components

Set Up a Private Mirror | PingCAP Documentation Center

| username: TiDB学习小白 | Original post link

Okay, thank you. I’ll take a look at how to do it.