I followed the “Deploy a Local Test Cluster” section of the TiDB Quick Start Guide and used the command curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh to install it directly online on a CentOS 7.6 virtual machine. Later, I found that it was installed by default in the /root directory. I wanted to install it in my large-capacity hard drive path /tidb, so I downloaded install.sh and modified “TIUP_HOME=$HOME/.tiup” to “TIUP_HOME=/tidb/.tiup”. Then I ran install.sh for installation, and the following information appeared:
total 4
-rwxr-xr-x 1 root root 2096 Sep 23 03:12 install.sh
[root@192 tidb]# ./install.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6971k 100 6971k 0 0 6671k 0 0:00:01 0:00:01 --:--:-- 6677k
Failed to set mirror: open /root/.tiup/bin/root.json: no such file or directory
Error: open /root/.tiup/bin/root.json: no such file or directory
Detected shell: bash
Shell profile: /root/.bash_profile
/root/.bash_profile has been modified to add tiup to PATH
open a new terminal or source /root/.bash_profile to use it
Installed path: /tidb/.tiup/bin/tiup
===============================================
Have a try: tiup playground
===============================================
I did not find the root.json configuration item in the install.sh script. I found that it was reported when executing `tiup mirror set https://tiup-mirrors.pingcap.com`. What is the reason? How to solve it?
If you decide to start the TiDB cluster with a non-root user, then clean up the tiup-related items under the root directory, and then install and configure tiup under the cluster start user.
I have run sh -x install.sh, but I didn’t see anything that could be used to determine the issue.
I can’t think of any reason. A brother in the group said that root.json is an RSA certificate key, and it is possible that the tiup program has set this path.
I have tried everything, even using a new virtual machine to start running install.sh again, and the issue still persists, indicating that it is not caused by the environment after the first installation. I can’t solve it right now, so I can only use a soft link ln -s /tidb/.tiup /root/.tiup, and then let the default installation run first.
I have tried several times, and if installed by default, it can be installed smoothly, so it shouldn’t be the reason! However, as I continue to learn, I found that the local test installation steps are only limited to getting the system up and running to try out TiDB’s features, which is quite different from the production environment. In the production environment, you can specify the installation directory and data directory in the topo.yaml configuration file, so this issue does not exist. Thank you!