Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 安装部署报错,提示切换用户错误
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 6.4.0
[Reproduction Path]
[Encountered Problem: Problem Phenomenon and Impact]
Error occurred during deployment as shown in the image. Preliminary judgment is that the error occurs when executing su - tidb
, but there was no such issue before installation, and switching to other users is possible. Detailed information can be seen in the image.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
Check the permissions of /home/tidb.
Can you switch to mppadmin1 using su?
/home/tidb has tidb:tidb permissions.
Check the error content by running cat /var/log/secure | grep tidb
.
Uh, you gave 700 permissions. I see you are using the root user with tiup. Add the -u tidb option to the deployment command and use the tidb user for deployment.
Otherwise, tiup will remotely log in using your current login user (which is the root user) and execute the initialization command.
If using root, how should it be modified? Deploying with the tidb user would also require setting up passwordless access for tidb, right?
Now, there is an error when using “su - tidb”. What is the issue, and is there a solution?
Is the /home/tidb directory permission correct?
The image you provided is not accessible. Please provide the text content you need translated.
Try running chmod -R 755 /home/tidb
, or more simply, install tiup under the tidb user. However, you need to set up passwordless access based on tidb.
I also used the root user to deploy tiup and added -u tidb to use the tidb user during deployment. However, I had set up passwordless login for the tidb user in advance, and I didn’t encounter any errors during deployment.
Here’s how I deployed it: I first created a tidb user on the control machine, and there’s no need to create it on other nodes. The configuration file specifies the tidb user, and operations are performed under the tidb user during deployment. Specify --user to use the root user or another user who can sudo to root to execute commands, and the tidb user on other nodes will be created automatically.
The configuration for tidb nofile in /etc/security/limits.conf is probably set too high, causing the inability to switch users.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.