System Dependency Manual Operation Reference

Description

  • Running user: Refers to the ordinary user running the hengshi system; users can name it themselves. Here we use "hengshi" as an example.

Install sudo (on every machine)

Execute as the root user:

yum install -y sudo

Create a user

Execute as the root user:

useradd -m hengshi
passwd hengshi #Set the login password for hengshi

Configure passwordless sudo (on every machine)

Configure sudo privileges for system users.
Run as the root user:

visudo

Enter the following, save and exit:

hengshi ALL=(ALL)       NOPASSWD: ALL

Configure the running user for passwordless ssh login (on every machine)

Assuming there are three machines in the cluster: Node-A, Node-B, Node-C. As the "running user (example hengshi)", perform the operations on each machine:

  • Enter the hengshi password when prompted.
  • When prompted with "Are you sure you want to continue connecting (yes/no)?", input yes.
  • Note: It is necessary to execute the ssh-copy-id operation with the local machine's IP, e.g., on Node-A, execute 'ssh-copy-id hengshi@Node-A'.
test -e ~/.ssh/id_rsa || { yes "" | ssh-keygen -t rsa -q -P ''; }
ssh-copy-id hengshi@localhost
ssh-copy-id hengshi@127.0.0.1
ssh-copy-id hengshi@Node-A
ssh-copy-id hengshi@Node-B
ssh-copy-id hengshi@Node-C

Set the hostname (on every machine)

If there are machines with the same hostname, such as localhost, then you need to set it.

Assuming $name is the hostname for each machine:

sudo hostname $name
sudo su -c 'echo $name > /etc/hostname'

Enable communication between machines using hostname

Edit the /etc/hosts file:

a.b.c.d1 Node-A
a.b.c.d2 Node-B
a.b.c.d3 Node-C

Install ansible (on the machine that needs to execute deployment commands)

sudo yum install -y epel-release
sudo yum install -y ansible