In the second part, it is particularly important to configure ssh password-less authentication login and java environment configuration.
L SSH password-less authentication Configuration
1. Confirm that SSH and rsync are installed.
2. Generate a key file on the Master node
After the first command is run, the system prompts you to store the key according to the default directory. After you click Enter, the result is shown in.
Check whether the key file has been generated:
3. append id_rsa.pub to the authorization key. At this time, a new file authorized_keys is generated:
4. Modify authZ watermark? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> keys + 8bk1rTQ0LXEyKjP3qOsoaM8L3A + CjxwPjxpbWcgc3JjPQ =" http://www.bkjia.com/uploadfile/Collfiles/20131231/2013123109071428.png "alt =" \ ">
5. Configure SSH (root permission required)
Modify the content of the SSH configuration file "/etc/ssh/sshd_config.
Modify the three options and remove the comment symbol "#", as shown in the following figure:
Restart the SSH service, log out of the root account, and use a common user to verify whether the logon is successful.
Log out of the root account and you can see that the password-free login to the local computer has been set.
6. Copy the public key to all Slave machines.
7. log on to the Slave machine to complete the remaining SSH configurations. Create a. ssh folder on Slave1 and change it to 700 (only the owner has read, write, and execute permissions)
Note:
Set all files in the current directory and sub-directory owner to user lamport of users Group
Chown-R lamport: users *
-Rw ------- (600) -- only the owner has read and write permissions.
-Rw-r -- (644) -- only the owner has read and write permissions, while the owner and other users have only read permissions.
-Rwx ------ (700) -- only the owner has read, write, and execution permissions.
-Rwxr-xr-x (755)-the owner has the read, write, and execution permissions, while the owner and other users have only the read and execution permissions.
-Rwx -- x (711) -- the owner has read, write, and execution permissions, while the owner and other users have only execution permissions.
-Rw-(666) -- all users have the permission to read and write files. This approach is not advisable.
-Rwxrwxrwx (777)-all users have read, write, and execute permissions. It is not advisable.
8. append the authorization file to authorized_keys. After the append is complete, delete the id_rsa.pub file because the file will be sent to the current node when you configure other nodes, which may conflict. Modify authorized_keys to 600. (very important)
9. Use the root user to modify/etc/ssh/sshd_config and restart the SSH service.
10. Finally, verify that the Master uses SSH without a password to log on to Slave1.
When Slave2 is modified according to the above method,
Note: This step is very important because the. ssh is not modified to 700 and the authorized_keys is 600, resulting in failure to log on to Slave2 without a password for SSH.
11. Use the same method to set Slave1 and Slave2 to log on to other machines without a password,
12. A problem:
This problem is very distressing. The modified permissions are also modified. The same permissions are available in Slave2, but cannot be generated in slave1.
The final solution is:
Http://eosrei.net/articles/2012/01/fixing-open-idrsa-failed-permission-denied-rhel6
Uninstalling selinux is said to be a bug in selinux iN OS.
Then generate the key pair.
L configure the java environment and jdk
1. First, you must use the following command to download the rpm package. There are also many introductions on the Internet, because of the problem with the oracle.com website.
Wget -- no-cookies -- no-check-certificate -- header "Cookie: gpw_e24 = http % 3A % 2F % 2Fwww.oracle.com" http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-i586.rpm
2. Run: rpm-ivh/usr/jdk-7u45-linux-i586.rpm
3. Configure environment variables:
Log on to the root account and open/etc/profile to add the java variable.
Reference: http://www.cnblogs.com/ydwgstz/p/3375852.html
4. Input: java-version to check the result and find that the default jdk is openJDK, which is the default java environment.
5. install java and javac again. Modify jdk1.7.0 _ 45 as the latest java environment.
When configuring Slave2, you should note that its OS is centos6.2 _ x64. Therefore, you must install a 64-bit jdk When configuring its jdk. Other configurations are the same as before.