ÎÊÌâµ¼¶Á£º
1.Èç¹û»ñÈ¡hadoop src maven°ü£¿
2.±àÒëhadoopÐèҪװÄÄЩÈí¼þ£¿
3.ÈçºÎ±àÒëhadoop2.4?
À©Õ¹£º
±àÒëhadoopΪºÎ°²×°ÕâЩÈí¼þ£¿
Ò»¡¢Ê×ÏÈÏÂÔØhadoopÔ´Âë°ü
ÏÂÔصķ½Ê½»¹ÊDZȽ϶àµÄ
1.svnµÄ·½Ê½
svnÏÂÔØÊ×ÏÈÐèÒª°²×°SVN£¬Èç¹ûÏë³¢ÊÔʹÓÃsvn£¬¿ÉÒԲο¼Ô´Âë¹ÜÀí¡¢»ñÈ¡ÍøÂçÔ´Â빤¾ß£ºTortoiseSVNʹÓÃÊֲᣬhadoopµÄsvnÏÂÔصØÖ·µã´Ë
2.ѹËõ°üµÄ·½Ê½
ÕâÀïÎÒÃǽéÉÜÒ»ÖÖѹËõ°üµÄ·½Ê½¡£
Ê×ÏÈÎÒÃǵǼ¹ÙÍø£º
http://hadoop.apache.org/£¬ÎÒÃÇÕÒµ½ÏÂÃæÁ´½Ó£¬µã½øÈ¥ÏÂÔؼ´¿É¡£Èç¹û¸Õ½Ó´¥£¬²»ÖªµÀÔõôÏÂÔØ£¬¿ÉÒԲ鿴Ìû×ÓÐÂÊÖÖ¸µ¼£ºhadoop¹ÙÍø½éÉܼ°ÈçºÎÏÂÔØhadoop£¨2.4£©¸÷¸ö°æ±¾Óë²é¿´hadoop API½éÉÜ£¬ÀïÃæ½éÉܵĺÜÏêϸ¡£
¶þ¡¢½âѹ
- aboutyun@master:~$ tar zxvf hadoop-2.4.0-src.tar.gz
¸´ÖÆ´úÂë
½âѹÍê±Ï£¬ÎÒÃǻῴµ½ÏàÓ¦µÄÎļþ¼Ð£º
Èý¡¢½âѹÍê±Ï£¬ÎÒÃÇ¿ªÊ¼×¼±¸±àÒëËùÐèÒªµÄÈí¼þ
ÕâÀïÈí¼þµÄ×¼±¸£¬ºÜ¶àÎÄÕÂдµÄ¶¼²»È«£¬ÕâÀïÕûÀíһϡ£ÄÄЩÈí¼þÊÇÐèÒª°²×°µÄ¡£
ÕâÀïÐèҪ˵Ã÷µÄÊÇÓеÄLinuxÓÐ×Ô´øµÄÕâЩ¹¤¾ß£¬Õâ¸öÐèÒª×Ðϸ¿´Ò»Ï°汾ÊÇ·ñÆ¥Å䣬²»Æ¥ÅäÔòÉý¼¶Ò»Ï£¬ÓÐЩ²»ÄÜÉý¼¶£¬ÄÇô¾ÍÖØװһϰÉ
1¡¢jdkµÄ°²×°
²½ÖèÏÂÔØѹËõ°ü¡¢½âѹ¡¢ÅäÖû·¾³±äÁ¿
£¨1£©jdkÏÂÔØ
Á´½Ó: http://pan.baidu.com/s/1jGr41SU ÃÜÂë: rawv
£¨2£©jdk½âѹ
- tar zxvf jdk-7u51-linux-x64.tar.gz
¸´ÖÆ´úÂë
È»ºóÖØÃüÁîΪ£º
£¨3£©ÅäÖû·¾³±äÁ¿£º
ÈçÏÂͼËùʾºì×Ö²¿·ÖΪ£º(¼ÇµÃÕâÀïµÄ·¾¶¸Ä³É×Ô¼ºµÄʵ¼Ê°²×°Â·¾¶)
¸´ÖÆ´úÂë
£¨4£©¼ìÑéÊÇ·ñ°²×°³É¹¦
2¡¢mavenµÄ°²×°
- sudo apt-get install maven
¸´ÖÆ´úÂë
ÎÒÕâÀïÒѾ°²×°
ÉÏÃæ¿ÉÄÜ»¹ÐèÒªÅäÖû·¾³±äÁ¿Ö®ÀàµÄ£¬µ«ÊÇÎÒÕâÀïûÓкÃÏñÊÇϵͳ×Ô´øµÄ£¬ÍøÉϵÄ×ÊÁÏÒ²±È½Ï¶à£¬×¢ÒâmavenµÄ°æ±¾£¬ÎÒÕâÀïÊÇ3.0.4£¬hadoop2.4ÐèÒªmavenµÄÕâ¸ö°æ±¾»òÔò¸ü¸ßµÄ°æ±¾3.2.1°æ±¾Ò²ÊÇ¿ÉÒԵġ£
ÑéÖ¤°²×°ÊÇ·ñ³É¹¦
¸´ÖÆ´úÂë
3.protobufµÄ°²×°
Ϊ·ÀÖ¹³ö´í£¬ÕâÀï²¹³äһЩÄÚÈÝ£¬
3.1ÏÈ°²×°g++¸´ÖÆ´úÂë
£¨1£©ÏÂÔØ
- sudo wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
¸´ÖÆ´úÂë
ÓÉÓÚgoogle²»ÄÜ·ÃÎÊ£¬¿ÉÒÔ´ÓÍøÅÌÏÂÔØÁ´½Ó£ºhttp://pan.baidu.com/s/1dDgWe6P ÃÜÂ룺xgiu
£¨2£©½âѹ
- tar zxvf protobuf-2.5.0.tar.gz
¸´ÖÆ´úÂë
ÈçÏÂЧ¹û£º
È»ºó½øÈëprotobuf-2.5.0Îļþ¼Ð£¬½øÐÐÈçϲÙ×÷£º
- $ sudo ./configure
- $ sudo make
- $ sudo make check
- $ sudo make install
- $ sudo ldconfig
¸´ÖÆ´úÂë
Ð޸Ļ·¾³±äÁ¿£º
¸´ÖÆ´úÂë
- export LD_LIBRARY_PATH=~/protobuf-2.5.0
¸´ÖÆ´úÂë
£¨LD_LIBRARY_PATHµÄÕâÀÌîдµÄÊÇprotobufÎļþµÄλÖã©
¸´ÖÆ´úÂë ×¢Ò⣺ÅäÖÃ/etc/profile£¬ÔÚÐéÄâ»úÖØÆôºó£¬¿ÉÄÜÅäÖûáʧЧ£¬ËùÒÔÖØÆôºó£¬ÐèÒªÔÙ´ÎÖ´ÐÐsource²Ù×÷¡£
£¨3£©ÑéÖ¤
¸´ÖÆ´úÂë
4.°²×°openssl¿â
- sudo apt-get install libssl-dev
¸´ÖÆ´úÂë
5.CMake°²×°
¸´ÖÆ´úÂë »òÔò
- sudo apt-get install cmake
¸´ÖÆ´úÂë
6.ant°²×°
£¨1£©Ê×ÏÈÏÂÔØant
°Ù¶ÈÍøÅÌ£º apache-ant-1.9.4-bin.tar.gz
http://pan.baidu.com/s/1c0vjhBy
»òÔòÏÂÃæÁ´½Ó£º
apache-ant-1.9.4-bin.tar.gz
£¨2£©½âѹ
- tar zxvf apache-ant-1.9.4-bin.tar.gz
¸´ÖÆ´úÂë
(3)ÅäÖû·¾³±äÁ¿
ÈçÏÂͼËùʾ£º
1.´ò¿ªprofile
¸´ÖÆ´úÂë 2.Ìí¼ÓÏÂͼºì×Ö²¿·Ö£¬¼ÇµÃÐ޸ijÉ×Ô¼ºµÄ·¾¶
3.ÉúЧ
¸´ÖÆ´úÂë
4.¼ìÑé
¸´ÖÆ´úÂë
ËÄ¡¢±àÒëhadoop2.4
ÉÏÃæ×¼±¸¹¤×÷ÒѾ×öµÄ²î²»¶àÁË£¬ÎÒÃÇÖÕÓÚ¿ÉÒÔ¿ªÊ¼£¬¼ÇµÃ½øÈësrcÎļþ¼ÐÏ£¬ÊäÈëÏÂÃæÃüÁî- mvn package -Pdist,native -DskipTests -Dtar
¸´ÖÆ´úÂë
µÈÁË40¶à·ÖÖÓ£¬ok
ÔÚĿ¼~/hadoop-2.4.0-src/hadoop-dist/targetÏÂÓÐÎļþ£º
hadoop-2.4.0.tar.gz
¸ü¶àÄÚÈÝ£ºhadoop2.4»ã×Ü£ºhadoop2.4²å¼þÏÂÔØ¡¢ÍêÈ«·Ö²¼Ê½¡¢Î±·Ö²¼¡¢eclipse²å¼þ¿ª·¢´óÈ«
ÎÊÌâ×ܽ᣺
ÕâÀﻹÐèÒªÔÚ²¹³ä£º
1.Óöµ½´íÎó1£ºCMakeûÓа²×°
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-
-
- plugin:1.6:run (make) on project hadoop-common: An Ant BuildException has
-
- occured: Execute failed: java.io.IOException: Cannot run program "cmake" (in
-
- directory "/home/wyf/hadoop-2.0.2-alpha-src/hadoop-common-project/hadoop-
-
- common/target/native"): java.io.IOException: error=2, No such file or directory
-
- -> [Help 1]
- [ERROR]
- [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
-
- switch.
- [ERROR] Re-run Maven using the -X switch to enable full debug logging.
- [ERROR]
- [ERROR] For more information about the errors and possible solutions, please
-
- read the following articles:
- [ERROR] [Help 1]
-
- http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
¸´ÖÆ´úÂë
½â¾ö·½·¨£º
CMakeûÓа²×°
¸´ÖÆ´úÂë »òÔòʹÓÃ
- sudo apt-get install cmake
¸´ÖÆ´úÂë
2.Óöµ½´íÎó2£ºantûÓа²×°
- ERROR] Failed to execute goal org.codehaus.mojo.jspc:jspc-maven-plugin:2.0-
-
- alpha-3:compile (hdfs) on project hadoop-hdfs: Execution hdfs of goal
-
- org.codehaus.mojo.jspc:jspc-maven-plugin:2.0-alpha-3:compile failed: Plugin
-
- org.codehaus.mojo.jspc:jspc-maven-plugin:2.0-alpha-3 or one of its dependencies
-
- could not be resolved: Could not transfer artifact ant:ant:jar:1.6.5 from/to
-
- central (http://repo.maven.apache.org/maven2): GET request of:
-
- ant/ant/1.6.5/ant-1.6.5.jar from central failed: Read timed out -> [Help 1]
- [ERROR]
- [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
-
- switch.
- [ERROR] Re-run Maven using the -X switch to enable full debug logging.
- [ERROR]
- [ERROR] For more information about the errors and possible solutions, please
-
- read the following articles:
- [ERROR] [Help 1]
-
- http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
- [ERROR]
- [ERROR] After correcting the problems, you can resume the build with the command
- [ERROR] mvn <goals> -rf :hadoop-hdfs
¸´ÖÆ´úÂë
1.Ê×ÏÈÏÂÔØant
°Ù¶ÈÍøÅÌ£º apache-ant-1.9.4-bin.tar.gz
http://pan.baidu.com/s/1c0vjhBy
»òÔòÏÂÃæÁ´½Ó£º
apache-ant-1.9.4-bin.tar.gz
2.½âѹ
- tar zxvf apache-ant-1.9.4-bin.tar.gz
¸´ÖÆ´úÂë
3.ÅäÖû·¾³±äÁ¿
¼ÇµÃÅäÖû·¾³±äÁ¿
ÈçÏÂͼËùʾ£º
1.´ò¿ªprofile¸´ÖÆ´úÂë 2.Ìí¼ÓÏÂͼºì×Ö²¿·Ö£¬¼ÇµÃÐ޸ijÉ×Ô¼ºµÄ·¾¶
3.ÉúЧ
¸´ÖÆ´úÂë
4.¼ìÑé
¸´ÖÆ´úÂë
3.protobuf°æ±¾¹ýµÍ£¬´íÎóÏÖÏó
- [ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.4.0:prot
- oc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecut
- ionException: 'protoc --version' did not return a version -> [Help 1]
- [ERROR]
- [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
- ch.
- [ERROR] Re-run Maven using the -X switch to enable full debug logging.
- [ERROR]
- [ERROR] For more information about the errors and possible solutions, please rea
- d the following articles:
- [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
- xception
- [ERROR]
- [ERROR] After correcting the problems, you can resume the build with the command
-
- [ERROR] mvn <goals> -rf :hadoop-common
¸´ÖÆ´úÂë
hadoop2.4¶ÔÓ¦µÄ°æ±¾ÊÇprotobuf-2.5.0
½â¾ö°ì·¨£º°´ÕÕ°²×°²½ÖèÖÐprotobufµÄ°²×°¼´¿É
4.ȨÏÞÎÊÌâ
½â¾ö°ì·¨£º
£¨1£©¼ÓÉÏsudo
£¨2£©Í¨¹ý
¸´ÖÆ´úÂë °²×°°ü½âѹ֮ºó£¬ËùÊôÓû§¿ÉÄÜ·¢Éú±ä»¯£º
¸Ä±äÓû§
sudo chown -R aboutyun:aboutyun hadoop-2.4.0-src
ÉÏÃæaboutyun¸Ä³É×Ô¼ºµÄËùÊô×éºÍÓû§
ÃüÁî²é¿´ÊÇ·ñÊôÓÚµ±Ç°Óû§
|