TiUP v7.5.0 Single Machine Deployment Failed: SCP Failure

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

Original topic: tiup v7.5.0 单机部署失败 scp失败

| username: 程序员小王

[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
| username: Jellybean | Original post link

It is strongly recommended to use the tiup playground method to deploy the cluster for single-machine deployment.

| username: zhanggame1 | Original post link

Deploying a single-machine test with the root user is much simpler, and there’s no need to create a tidb user; it will automatically add it for you.

tiup cluster deploy tidb-test 7.5.0 ./topo.yaml --user root -p
| username: hey-hoho | Original post link

Follow the documentation:

| username: 有猫万事足 | Original post link

Try adding passwordless sudo?

| username: ShawnYan | Original post link

What operating system? Have you configured sudo according to the documentation?

| username: 小龙虾爱大龙虾 | Original post link

Is there still 127.0.0.1 in the error message? Did you write this in your deployment file?

| username: Kongdom | Original post link

When establishing mutual trust, it is important to pay attention to the operating user.

| username: Jolyne | Original post link

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.

| username: ShawnYan | Original post link

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.

| username: zhanggame1 | Original post link

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.

| username: ShawnYan | Original post link

Okay, different needs, different requirements. In our environment, root is disabled.

| username: oceanzhang | Original post link

Add a password option, you haven’t configured SSH mutual trust.

| username: dba远航 | Original post link

Even for single-machine deployment, SSH mutual trust is required.

| username: 程序员小王 | Original post link

I wrote it.

| username: 程序员小王 | Original post link

The official recommended configuration is too high; three nodes with three TiKVs won’t work.

| username: 程序员小王 | Original post link

The root user on the Ubuntu system encounters the same error.

| username: 普罗米修斯 | Original post link

Mutual trust for 127.0.0.1 (localhost) also needs to be added.

| username: zhanggame1 | Original post link

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.

| username: 程序员小王 | Original post link

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.