In the previous article we talked about how to install the CentOS system using VMware, and then we'll look at how to install the JDK we're most familiar with! Before installing the system to see if there is no JDK installed, input java-version, if the query out of other versions of the JDK version, first deleted, I use jdk1.6 here. Let's start with the beginning and start by explaining the installation steps.
1. We go to Oracle to get jdk1.6 installation files, address sharing: http://download.oracle.com/otn/java/jdk/6u45-b06/ Jdk-6u45-linux-i586.bin, this address cannot be downloaded directly need to login to Oracle;
2. Start the virtual machine, enter the CentOS system, first into the/usr/local directory, new Java directory, into the Java directory, download a good installation package copy into this directory, do not know how to copy, VMware can share folders, Baidu Search will know how to share, Once shared, you can copy directly;/jdk-6u45-linux-i586.bin the installation directly and a jdk1.6.0_45 folder appears.
cd/usr/Localmdkir JAVACD java
#将文件拷贝进/usr/local/java, execute the following command
Jdk-6u45-linux-i586.bin
./jdk-6u45-linux-i586.bin
3. Edit the/etc/profile file for the environment configuration (vim/etc/profile, direct input I into the edit mode), append the following code;
# java variable settingsexport java_home=/usr/local/java/jdk1. 6 . 0_45export PATH= $PATH: $JAVA _home/bin export CLASSPATH
Export Java_home PATH CLASSPATH
4. After setting the environment variable, type Source/etc/profile to make the newly edited content take effect, then test that the JDK is installed successfully, enter Java-version, and appear as shown, indicating that the installation was successful.
5. We installed four virtual machines to facilitate cluster use, so in the other three virtual machines to complete the installation of the JDK, the environment variable file can be directly copied into the other three virtual machines, the following command for remote copy, after the execution of the corresponding user will be required to enter the virtual machine password;
SCP -r/etc/profile [email protected].slave1:/etcSCP -r/etc/profile [email protected]:/ etc SCP -r/etc/profile [email protected]:/etc
6. Speaking of which, there is a supplement, because the last installment is finished, not yet how to set the static IP and hostname, here is added, if not set, in the 5th step [email protected] The hadoop.slave1 can be replaced with IP, and the copy can also be implemented .
6.1 Static IP setting (statically IP configuration)
> Edit/etc/sysconfig/network-scripts/ifcfg-eth0, modify as shown, execute command service network restart restart NIC after modification is complete, IP and gateway addresses can be modified according to their own circumstances
6.2 Hostname Modification
> Edit the/etc/hosts file, modify the content, the same IP according to their own situation to modify, the other three virtual machines are also executed, the same can be copied into the same as/etc/profile three other virtual machines
192.168. 3.180 Hadoop.master 192.168. 3.181 hadoop.slave1 192.168. 3.182 Hadoop.slave2 192.168. 3.183 Hadoop.slave3
Upcoming Announcements
The next article is about the installation of Hadoop, the support of remember to pay attention to Oh! Have not understood also can in comment area comment, see will reply, everybody support Oh!!
Hadoop self-paced collection (ii)----installing JDK under CentOS