[TiDB Usage Environment] /Test/
[TiDB Version] v7.5.0
[Reproduction Path] Operations performed that led to the issue
[Encountered Issue: Phenomenon and Impact]
root@wangchuanyi-virtual-machine:~# cat /proc/version
Linux version 6.2.0-36-generic (buildd@lcy02-amd64-050) (x86_64-linux-gnu-gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2
ssh-keygen -t rsa
ssh-copy-id wangchuanyi@127.0.0.1
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
Template:
https://github.com/pingcap/tiup/blob/master/embed/examples/cluster/minimal.yaml
tiup install cluster
Which version to install
tiup list tidb --v7.5.0
//tiup cluster deploy <cluster-name> <version> <topology.yaml> [flags]
tiup cluster deploy watchpoints v7.5.0 ./minimal.yaml
Error
Error: failed to fetch cpu-arch or kernel-name: executor.ssh.execute_failed: Failed to execute command over SSH for 'wangchuanyi@127.0.0.1:22' {ssh_stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c "uname -m"}, cause: Process exited with status 1
I just tried single-machine deployment yesterday. You can directly follow the quick start guide in the documentation, using the root user without needing to create a tidb user.
You can also use it, depending on the actual needs. If it’s just for learning or simple testing, that’s fine. If it’s for formal deployment, it’s better to follow the documentation.
Root is also a normal and proper deployment. Using root does not mean installing TiDB under the root user, but rather using the root user of each node to automatically add the user specified in your configuration file, such as the tidb user, to each node. With root installation, there is no need to create the tidb user or assign permissions manually; everything is automatically handled by the installation script. After the installation is complete, cluster management and database operations do not require the root user anymore.
First, delete the tidb user, then use the root user to execute tiup cluster deploy tidb-test 7.5.0 ./topo.yaml --user root -p for deployment. There shouldn’t be any issues.
The reason has been found. When creating Ubuntu, a regular user is specified, and the root user does not have a password. Using sudo su for installation does not work, so I reset the root password using passwd. Then, I deployed using tiup cluster deploy tidb-test 7.5.0 ./topo.yaml --user root -p.