[Hadoop] stand-alone attempt to install and test Hadoop2.7.1 (annotated script included)

Source: Internet
Author: User

It's quite smooth, the comments in the code are written in more detail. Attached script, interested friends can try. Note the changes to the environment variable names that are added in BASHRC, or the main class cannot be found.

1# # #ubuntu14.04LTS2 3## MakeHadoop Account4 sudoAddGroup Hadoop # Makea group named Hadoop5 sudoAddUser-ingroup Hadoop Hadoop #add an user named Hadoop6 sudo VI/etc/sudoers #add Hadoop into Sudoers (hadoop=root)7 8 # #change your account9 sudo suHadoopTen  One##Install SSH A sudoApt-getInstallOpenssh-server #Installopenssh-Server - sudo/etc/init.d/SSHStart #startSSHServer - PS-E |grep SSH#check whetherSSHIs started or not the  -# #loginchwithout password - Ssh-keygen-T Rsa-p""#loginchWithout password generate RSA &rsa.pub - CP~/.SSH/id_rsa.pub ~/.SSH/authorized_keys #add Authorized_keys to realize'log in without password' + SSHlocalhost #check - Exit #check +  A##InstallJava Environment at sudoApt-getInstallopenjdk-7-JDK #InstallJDK -Java-version #check whether Java is installed or not -  -# #get &InstallHadoop2.7.1(under User:hadoop) -CD ~ - mkdirHadoop in sudo wgethttp//mirror.bit.edu.cn/apache/hadoop/common/hadoop-2.7.1/hadoop-2.7.1.tar.gz #get hadoop2.7.1 - sudo TarXzf hadoop-2.7.1.Tar. GZ #UnzipThe hadoop-*.*.*.Tar. GZ to sudo RMhadoop-2.7.1.Tar. GZ #remove TheZip + sudo MVhadoop-2.7.1/usr/local/#InstallHadoop at local - sudo chmod 774/usr/local/hadoop #granted permissions to users (r&W) the  *# #configure ~/. BASHRC $Update-alternatives--config Java #get java's path (stared one such as'/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java'. But we just need'/usr/lib/jvm/java-7-openjdk-amd64'This shorter path to set up Java_home environment variables)Panax Notoginseng sudo VI~/.BASHRC #edit BASHRCfile -  the # #add The content below to the end of BASHRC +#--------------------------------------------------------------# A  the #HADOOP VARIABLES START +Export java_home=/usr/lib/jvm/java-7-openjdk-AMD64 -Export hadoop_install=/usr/local/hadoop-2.7.1 $Export path= $PATH: $HADOOP _install/bin $Export path= $PATH: $HADOOP _install/Sbin -Export Hadoop_mapred_home=$HADOOP _install -Export Hadoop_common_home=$HADOOP _install theExport Hadoop_hdfs_home=$HADOOP _install -Export Yarn_home=$HADOOP _installWuyiExport hadoop_common_lib_native_dir= $HADOOP _install/lib/native theExport hadoop_opts="-djava.library.path= $HADOOP _install/lib" - #HADOOP VARIABLES END Wu  -#--------------------------------------------------------------# AboutSOURCE ~/.BASHRC # MakeThe environment variables come into effect $  - # #configure Hadoop - sudo VI/usr/local/hadoop-2.7.1/etc/hadoop/hadoop-Env.SH#edit hadoop-Env.SH -? Java_home # (inchVimLocateJava_home A#change'Export Java_home=${java_home}'Into'Export JAVA_HOME=/USR/LIB/JVM/JAVA-7-OPENJDK-AMD64' +source/usr/local/hadoop-2.7.1/etc/hadoop/hadoop-Env.SH#update the  - # #test $cd/usr/local/hadoop-2.7.1/#go There the sudo mkdirTest the sudo CPREADME.txt Test theBin/hadoop Jar share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.7.1-sources.jar Org.apache.hadoop.examples.WordCount Input Output

[Hadoop] stand-alone attempt to install and test Hadoop2.7.1 (annotated script included)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.