When executing tiup mirror merge tidb-server directory, an error occurs:
Error: lstat /home/tidb/.tiup/keys: no such file or directory
How should this be resolved?
What do the following points in the official documentation mean?
The administrator ID of all components in the target mirror must exist in the current mirror.
The ${TIUP_HOME}/keys directory of the user executing this command must contain all the private keys corresponding to the administrator IDs in the current mirror (you can use the command tiup mirror set to switch the current mirror to one that you have permission to modify).
I have a question here. Suppose my current tiup mirror is tidb-community-server-v4.0.15-linux-amd64
[tidb@mysql05 tidb-community-server-v4.0.15-linux-amd64]$ tiup mirror show
/home/tidb/tidb-community-server-v4.0.15-linux-amd64
I want to merge tidb-community-server-v5.4.0-linux-amd64 into tidb-community-server-v4.0.15. Why do I need to copy the keys from tidb-community-server-v4.0.15-linux-amd64 to /home/tidb/.tiup instead of copying the keys from tidb-community-server-v5.4.0-linux-amd64 to /home/tidb/.tiup?
Which one is the target mirror? According to my understanding, tidb-community-server-v5.4.0 should be the target mirror, right?
[tidb@mysql05 ~]$ tiup mirror show
/home/tidb/tidb-community-server-v4.0.15-linux-amd64
[tidb@mysql05 ~]$ cp -r tidb-community-server-v5.4.0-linux-amd64/keys/ /home/tidb/.tiup/
[tidb@mysql05 ~]$ tiup merge tidb-community-server-v5.4.0-linux-amd64
The component merge version is not installed; downloading from repository.
The component merge not found (may be deleted from repository); skipped
Failed to start component merge
Error: use tiup install merge to install component merge first: component not installed
Copying /home/tidb/tidb-community-server-v5.4.0-linux-amd64/keys/ to /home/tidb/.tiup also doesn’t work
[tidb@mysql05 ~]$ cp -r tidb-community-server-v4.0.15-linux-amd64/keys/ /home/tidb/.tiup/
[tidb@mysql05 ~]$ tiup mirror merge tidb-community-server-v5.4.0-linux-amd64
Success
Copying the keys from tidb-community-server-v4.0.15-linux-amd64 to /home/tidb/.tiup works.
In the document you posted, it is written that the private keys corresponding to the administrator ID in the current image are copied to the ${TIUP_HOME}/keys directory of the user executing the command. Then, tiup mirror merge the target image directory.
The directory ${TIUP_HOME}/keys of the user executing this command contains all the private keys corresponding to the above administrator ID in the current image ------> What does administrator ID mean?
Also, * The administrator IDs of all components of the target image must exist in the current image. What does this sentence mean? In the example I provided, the target image should be tidb-community-server-v5.4.0-linux-amd64, right?
Okay, I will study it. First, let me ask you, teacher, my current mirror is /home/tidb/tidb-community-server-v4.0.15-linux-amd64, and I want to merge /home/tidb/tidb-community-server-v5.4.0-linux-amd64 into it. Are my steps correct? I see no errors when executing the commands.
Correct, using tiup list followed by the component name allows you to see the available component versions in the mirror. If the merge is successful, you will be able to see the newly merged version.