Installation and Deployment Error: User Switch Error Prompt

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

Original topic: 安装部署报错,提示切换用户错误

| username: TiDBer_ZfFjmcZo

[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]



| username: dba-kit | Original post link

Check the permissions of /home/tidb.

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

Can you switch to mppadmin1 using su?

| username: TiDBer_ZfFjmcZo | Original post link

/home/tidb has tidb:tidb permissions.

| username: TiDBer_ZfFjmcZo | Original post link

| username: TiDBer_ZfFjmcZo | Original post link

Sure.

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

Check the error content by running cat /var/log/secure | grep tidb.

| username: dba-kit | Original post link

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.

| username: dba-kit | Original post link

Otherwise, tiup will remotely log in using your current login user (which is the root user) and execute the initialization command.

| username: TiDBer_ZfFjmcZo | Original post link

If using root, how should it be modified? Deploying with the tidb user would also require setting up passwordless access for tidb, right?

| username: TiDBer_ZfFjmcZo | Original post link

Now, there is an error when using “su - tidb”. What is the issue, and is there a solution?

| username: 我是咖啡哥 | Original post link

Is the /home/tidb directory permission correct?

| username: TiDBer_ZfFjmcZo | Original post link

The image you provided is not accessible. Please provide the text content you need translated.

| username: dba-kit | Original post link

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.

| username: dba-kit | Original post link

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.

| username: 我是咖啡哥 | Original post link

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.

| username: TiDBer_ZfFjmcZo | Original post link

The configuration for tidb nofile in /etc/security/limits.conf is probably set too high, causing the inability to switch users.

| username: system | Original post link

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