Issues with Managing Clusters Using TiUP

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

Original topic: tiup管理集群问题

| username: 月明星稀

[TiDB Usage Environment] Production Environment
[TiDB Version] 6.5.0
[Reproduction Path] Create a cluster using tiup, initially successful, but after a while, it prompts a sudo error.
[Encountered Problem: Phenomenon and Impact]
Create a cluster using tiup, deploying with a specified key file, and ssh is set to passwordless. Initially, it can be created successfully. However, after a while, it prompts a sudo error. The error is as follows, please check what the reason is!! Thanks.
[Attachment: Screenshot/Log/Monitoring]
Stopping component tikv
Stopping instance 1.1.1.1
Stopping instance 2.2.2.2
Stopping instance 3.3.3.3
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
sudo: no tty present and no askpass program specified

I have checked the configuration added to /etc/sudoers when setting up the cluster, tikv ALL=(ALL) NOPASSWD: ALL is still there, why is it reporting an error, quite puzzling.

Manually executing on the machine: /usr/bin/sudo -H bash -c “systemctl daemon-reload && systemctl stop tikv-20160.service” has no errors, probably an issue with remote execution.

| username: 昵称想不起来了 | Original post link

Why does it feel strange? What is your user, is it TiKV?

| username: zhanggame1 | Original post link

What is TiKV?

| username: Soysauce520 | Original post link

Try adding a line: tidb ALL=(ALL) NOPASSWD: ALL

| username: ShawnYan | Original post link

Are all nodes using the tikv user? Check if the permissions in the sudoers file are correct.

| username: tidb菜鸟一只 | Original post link

Can you directly execute sudo commands without entering a password by SSHing into tikv@1.1.1.1 from the control machine? By the way, did you use the tikv user to install TiDB?

| username: Fly-bird | Original post link

Did you use the root user when installing tiup on your machine?

| username: 月明星稀 | Original post link

Yes, the user is tikv.

| username: 月明星稀 | Original post link

It is the root user, it is possible during deployment.

| username: 月明星稀 | Original post link

Yes, the cluster was successfully created, but after a while, it became unmanageable.

| username: 月明星稀 | Original post link

When creating a cluster with tiup, is there an expiration time for the SSH login key or something like that? I don’t quite understand.

| username: tidb菜鸟一只 | Original post link

No, use tiup cluster edit-config tidb-xxx to check which user it is here.

| username: 月明星稀 | Original post link

I have found that the /etc/sudoers.d/ file was removed by the installation policy.

| username: zhanggame1 | Original post link

What is the installation strategy?

| username: ajin0514 | Original post link

Try adding a line: tidb ALL=(ALL) NOPASSWD: ALL

| username: system | Original post link

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