Hadoop running java environment, so before installing Hadoop, need to install jdk
Download the installation package in advance jdk (jdk-8u161-linux-x64.tar.gz), upload it to the installation directory you specify them, and then run the installation
CD / usr / local / the src / Rz # in a pop-up window, select the local jdk installation package uploaded to the server the tar -zxvf-jdk-x64-Linux-8u161. the tar .gz mkdir / usr / local / Java / Music Videos jdk1. . 8 .0_161 / usr / local / Java / JDK /
Configure the server environment variables
vi /etc/profile
Add the following configuration in the tail
export JAVA_HOME=/usr/local/java/jdk/ export JRE_HOME=$JAVA_HOME/jre export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:.
Save and exit, run the command, make the configuration take effect immediately
source /etc/profile
The installation package java synchronized to the other two servers
rsync -avz /usr/local/java/ master-backup:/usr/local/java/ rsync -avz /usr/local/java/ node1:/usr/local/java/ rsync -avz /usr/local/java/ node2:/usr/local/java/ rsync -avz /usr/local/java/ node3:/usr/local/java/
Then according to the above operation, each profile modifying configuration files on other servers
Installation and inspection java version
java -version
Disclaimer: This article was published in the original garden blog , author AllEmpty herein welcome to reprint, but without the author's consent declared by this section must be retained, and given the original connection in the apparent position of the article page, otherwise regarded as infringement.
On the blog: http: //www.cnblogs.com/EmptyFS/