Host system: rhel6.0 (unlimited) system environment: selinuxandiptablesdisabled service node: desktop26.example. com192.168.0.26 computing node: desktop80.example. com192.168.0.80
Host system: rhel6.0 (unlimited)
System Environment: selinux and iptables disabled service node: desktop26.example.com 192.168.0.26 computing node: desktop80.example.com 192.168.0.80 desktop83.example.com 192.168.0.83 1. to use the SSH key for each node to achieve password-free connection, you must first create a common user on each node as a cluster user.
- Useradd yejk
- Passwd yejk (SET Password to westos)
Note that the password and ID of this common user on each node must be the same. Note that no matter how many nodes there are, the data in the home directory of this common user should be identical, to achieve this, some network storage implementations can be implemented. NFS is used here, because the implementation method is simple and stable, and NFS is deployed on any node to release the Home Directory of yejk, other nodes directly mount this directory
- Yum install nfs-utils rpcbind-y
- Vim/etc/exports
- /Home/yejk 192.168.0.0/24 (rw, no_root_squash)
- Exportfs-r # Make the configuration take effect
- Exportfs-v # View
- /Etc/init. d/rpcbind start # requires rpcbind support
- /Etc/init. d/nfs start
Note that no_root_squash should be added, because the nfs server regards the root on the NFS client as the user nfsnobody, and permission issues may occur. After the release, you can directly mount the file on other nodes using commands and write the file to fstab.
- Mount 192.168.0.80:/home/yejk
- Vim/etc/fstab
- 192.168.0.80:/home/yejk nfs defaults 0 0
The operation on any node takes effect on each node.
- Su-yejk
- Ssh-keygen: Press enter.
- Ssh-copy-id-I ~ /. Ssh/id_rsa.pub sharetop80.example.com (connect with your own trust)
- Ssh-copy-id-I ~ /. Ssh/id_rsa.pub route top83.example.com (trusted connection with other nodes)
- Sh-copy-id-I ~ /. Ssh/id_rsa.pub sharetop26.example.com (trusted connection with other nodes)