By building a Hadoop cluster (ii), we have been able to run our own WordCount program smoothly.Learn how to create your own Java applications, run on a Hadoop cluster, and debug with Debug.How many kinds of debug methods are there?How Hadoop is debug on eclipseIn general, the most debug scenario is debugging the code l
-1.6.0.0.x86_64 here to modify the installation location for your JDK.Test Hadoop Installation: (with Hadoop users)Hadoop jar Hadoop-0.20.2-examples.jar WordCount conf//tmp/out1.8 Cluster configuration (all nodes are the same) or in master configuration, copy to other machin
/127.0.1.1 ******************************* *****************************/
3. Start bin/start-all.sh. Enter the command: Bin/start-all.sh
4. Check whether hadoop is successfully started. Enter the command: JPs
If there are five processes: namenode, secondarynamenode, tasktracker, datanode, and jobtracker, it indicates that your hadoop standalone environment has been configured.
OK. A
Hadoop Foundation----Hadoop Combat (vi)-----HADOOP management Tools---Cloudera Manager---CDH introduction
We have already learned about CDH in the last article, we will install CDH5.8 for the following study. CDH5.8 is now a relatively new version of Hadoop with more than hadoop2.0, and it already contains a number of
successfully formatted" and so on appear that the format is successful. Note: Each format will generate a namenode corresponding ID, after multiple formatting, if the Datanode corresponding ID number is not changed, run WordCount will fail to upload the file to input.
Start HDFs
start-all.sh
Show process
JPs
Enter http://localhost:50070/in the browser, the following page appears
Enter http://localhost:8088/, the following page appears
Indicate
supplement is ' \ n '; If the number of characters in the line is less than or equal to size-1, all characters are read and the last supplement ' for(i=0; i) {C=Buffer[i]; if(c==' '|| c=='\ t'){ !blank wnum++; Blank=1; }Else if(c!='\ n'c!='\ r') {CNum++; Blank=0; } }Word number +1 for not a space !blank wnum++; EOF is just to identify that the end of the file has been read, and it is not a byte stored in the file. So when you judge whether a file is read or
");Long count = Input.getlongbyfield ("Count");This.countMap.put (Word, count);Logger.info (Word + "-----------------" + count);}@Overridepublic void Declareoutputfields (Outputfieldsdeclarer declarer) {}@Overridepublic void Cleanup () {Super.cleanup ();}}View the log, which can be queried through the UI, such as ip:8080 can see the submitted topology name, point in, the point port number can be viewed on the dayYou can also log into the Storm installation directory of the corresponding work nod
We know that the IDE has a number of selected versions for development. As most of us often use is as follows.Eclipse * VersionEclipse * DownloadAnd we know that for the Scala development of Spark, there's a specially designed eclipse for it,Scala IDE for Eclipse 1. Scala IDE for eclipse downloadhttp://scala-ide.org/ 2. Installation of Scala IDE for EclipseTo decompress 3. Preliminary use of Scala IDE for Eclipse WordCountBefore that, install Java and Scala in the local area first.By default it
hdfs file system through NameNode Network Interface
Run the sample program
[root@hadoop hadoop]# hadoop jar /usr/share/hadoop/hadoop-examples-1.2.1.jar wordcount input output
View execution status through JobTracker Network Inte
/hadoop
Run the following command:# Bin/hadoopThe usage document of the hadoop script is displayed.
You can start a Hadoop cluster in one of the following three modes:Standalone ModePseudo-distributed modeFully Distributed Mode
Standalone Mode
By default, Hadoop is configured to run an independent Java Process in non-d
–>hadoop If you can show the folder (2) that the configuration is correct and if "Deny connection" is displayed, please check your configuration.
New WordCount ProjectFile->project, select Map/reduce Project, enter the item name WordCount, and so on.Create a new class in the WordCount project named
Protoc (requires compiling the specified compiled path./configure--prefix=/usr/app/protoc)Config/etc/profileMvn-v OKProtoc--version OK SVN download Source Compile HadoopMVN Package-dskiptests-pdist,native,docs-dtar (-dtar comes with generating a. Tar installation package)SVN checkout http://svn.apache.org/repos/asf/hadoop/common/trunk/(Hadoop trunk or/common/tags/x.x.x for oldVersionThe compiled storage
Starting the clustersbin/start-all.sh4 Viewing the cluster processJPs5 Administrator Run Notepad6 Local Hosts fileThen, save, and then close.7 Finally, it is time to verify that Hadoop is installed successfully.On Windows, you can access WebUI through http://djt002:50070 to view the status of Namenode, the cluster, and the file system. This is the Web page for HDFs.http://djt002:500708 new Djt.txt, used for testing. Test with the
configuration file and create folders in the directory later.Configuring the Hadoop environment is configuring the hadoop-env.sh file. Commands such as:Modify the Java_home path and add the Hadoop_home path (the path matches your actual location). Content such as:To verify that the configuration was successful, enter Bin/hadoop version to view
. -->>!--global properties -->>>hadoop.tmp.dir
Clear
[hadoop@hadoop-datanode1 tmp]$ rm -rf /usr/hadoop/tmp/*
Then restart hadoop and use jps on datanode to check whether datanode has been started.
4. When running the wordcount program, the fs cannot find the folder:
Input p
write/modify operations. Users can submit and kill applications through REST APIs.The timeline store in YARN, used for storing generic and application-specific information for applications, supports authentication through Kerberos.The Fair Scheduler supports dynamic hierarchical user queues, user queues are created dynamically at runtime under any specified parent-queue.
First, create a new file and copy the English content to the file:Cat> testThen place the newly created test file on the HDFS
To do well, you must first sharpen your tools.
This article has built a hadoop standalone version and a pseudo-distributed development environment starting from scratch. It is illustrated in the following figures and involves:
1. Develop basic software required by hadoop;
2. Install each software;
3. Configure the hadoop standalone mode and run the
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.