How to change the installation directory of tiup?

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

Original topic: 如何更换 tiup 的安装目录?

| username: TiDBer_JUi6UvZm

After executing the following command, tiup is installed in the /root/.tiup directory:

root@ubt22-dev1:~# curl --proto '=https' --tlsv1.2 -sSf | sh

Since the root directory is relatively small, to prevent tiup from downloading components and filling up the system disk, I manually moved the /root/.tiup directory to a shared disk and modified the PATH environment variable in /root/.bashrc:

root@ubt22-dev1:~# mkdir /mnt/share/database/tidb -p
root@ubt22-dev1:~# mv /root/.tiup /mnt/share/database/tidb

However, subsequent commands resulted in errors:

root@ubt22-dev1:~# tiup -v
Please check for root manifest file, you may download one from the repository mirror, or try `tiup mirror set` to force reset it.
Error: initial repository from mirror( failed: error loading manifest root.json: open /root/.tiup/bin/root.json: no such file or directory

root@ubt22-dev1:~# whereis tiup
tiup: /mnt/share/database/tidb/.tiup/bin/tiup

How should I change the tiup installation directory to make it work properly?


| username: TiDBer_JUi6UvZm | Original post link

Just like this?

| username: xfworld | Original post link

Yes, refer to here.

| username: zhaokede | Original post link

Modify or add in the environment variables.

| username: 舞动梦灵 | Original post link

You don’t need to worry about this at all. It’s just a command, a .sh file, and it won’t be very large. For subsequent installations, you will need to manually specify other directories, which is what you need to designate. Unless your directory is only 100M, you might consider installing the command in another directory.

| username: TiDBer_QYr0vohO | Original post link

Modify environment variables

| username: TiDBer_JUi6UvZm | Original post link

Indeed, it is possible to specify parameters to install components elsewhere. However, from the first impression, I still prefer to use the default values.

| username: wangkk2024 | Original post link


| username: stephanie | Original post link

You just need to set it in the environment variables.

| username: 友利奈绪 | Original post link

Manually modify environment variable configuration files and such.

| username: dba远航 | Original post link

Adjust the environment variables to change to the new ones.

| username: QH琉璃 | Original post link

Modify environment variables

| username: 哈喽沃德 | Original post link

Just set the environment variable.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.