如题所述
å¦æè¦å®ç°Tasteç®æ³ï¼å¿
å¤çæ¡ä»¶æ¯ï¼
1ï¼ JDKï¼ä½¿ç¨1.6çæ¬ãéè¦è¯´æä¸ä¸ï¼å 为è¦åºäºEclipseæ建ï¼æ以å¨è®¾ç½®pathçå¼ä¹åè¦å å®ä¹JAVA_HOMEåéã
2ï¼ Mavenï¼ä½¿ç¨2.0.11çæ¬æ以ä¸ãå¨eclipseä¸å®è£ mavenæ件âm2eclipseã
3ï¼Apache Mahoutï¼ä½¿ç¨0.5çæ¬ã
Apache Mahout -Taste Documentationä¸çå®è£ æ¥éª¤ï¼
[javascript] view plaincopy
4. Demo
To build and run the demo, follow the instructions below, which are written for Unix-like
operating systems:
1. Obtain a copy of the Mahout distribution, either from SVN or as a downloaded archive.
2. Download the "1 Million MovieLens Dataset" from http://www.grouplens.org/.
3. Unpack the archive and copy movies.dat and ratings.dat to
trunk/taste-web/src/main/resources/org/apache/mahout/cf/taste/example/
under the Mahout distribution directory.
4. Navigate to the directory where you unpacked the Mahout distribution, and navigate
totrunk.
5. Runmvn install, which builds and installs Mahout core to your local repository
6. cd taste-web
7. cp ../examples/target/grouplens.jar ./lib
8. Edit recommender.properties and fill in therecommender.class:
recommender.class=org.apache.mahout.cf.taste.example.grouplens.GroupLe
9. mvn package
10.mvn jetty:run-war. You may need to give Maven more memory: in a bash shell,
export MAVEN_OPTS=-Xmx1024M
11.Get recommendations by accessing the web application in your browser:
http://localhost:8080/RecommenderServlet?userID=1
This will produce a simple preference-item ID list which could be consumed by a client
application. Get more useful human-readable output with the debug parameter:
http://localhost:8080/RecommenderServlet?userID=1&debug=true
Incidentally, Taste's web service interface may then be found at:
http://localhost:8080/RecommenderService.jws
Its WSDL file will be here...
http://localhost:8080/RecommenderService.jws?wsdl
... and you can even access it in your browser via a simple HTTP request:
.../RecommenderService.jws?method=recommend&userID=1&howMany=10
ä¸ãå¨windowä¸å®è£ maven
ç°å¨Javaæ°æ¶æçä¸æåºç°ï¼ä¾å¦Strutsï¼Springï¼Hibernateçï¼é¡¹ç®çé ç½®æ件çå¢å¤ï¼ç»å¼å人å带æ¥å¾å¤§éº»ç¦ãå¨å®é çå¼åå½ä¸ï¼Myeclipseä¸çprojectè¶æ¥è¶åºå¤§ï¼æä¾èµç第ä¸æ¹Jarå è¶æ¥è¶å¤ï¼è¿æ¾å¾Projectå¾èè¿ï¼ç»é¡¹ç®ç®¡ç带æ¥äºå¾å¤§ä¸ä¾¿ï¼å°¤å ¶æ¯å¨ä¸äºå¤§å项ç®ã为äºè§£å³ä¸è¿°é®é¢ï¼Apacheå¼æºç»ç»åå¸äºMavenï¼å®éç¨äºå¤§çJava项ç®ã
æå ³mavenä»ç»è§ãMavenæå¨æåã ï¼ä¸è½½å°åï¼http://www.juvenxu.com/mvn-def-guide/
å®è£ æ¥éª¤ï¼
1ãä¸è½½å ï¼è§http://maven.apache.org/download.html
2ã解å缩ï¼å°å ¶ä¸çbinç®å½è®¾ç½®å°windows Pathç¯å¢åéä¸ï¼mavenä¹æ¯ä¾èµjdkçï¼å è£ å¥½jdkï¼å¨ç¯å¢åééé¢é 置好jdkã
2.1ã设置JAVA_HOMEï¼é¡¾åå ¶æ该åéçå«ä¹å°±æ¯javaçå®è£ è·¯å¾ï¼ï¼æ¾å°pathï¼ç¶åç¹ç¼è¾ï¼pathåéçå«ä¹å°±æ¯ç³»ç»å¨ä»»ä½è·¯å¾ä¸é½å¯ä»¥è¯å«javaå½ä»¤ï¼ååéå¼ä¸ºâ.;%JAVA_HOME%\binâï¼
2.2ãæ°å»ºåéåï¼M2_HOMEï¼åéå¼ï¼E:\maven\apache-maven-2.2.1ï¼æ³¨æè¿éä¸å«binçè·¯å¾ã2ãå¨pathå追å ;%M2_HOME%\binï¼æ³¨æè¿éå°binç®å½
3ãæµè¯å®è£ æ¯å¦æåï¼å¼å§->è¿è¡->cmd->mvn -version
注æï¼å½æ示mvnæ示ä¸æ¯å é¨å½ä»¤æå¤é¨å½ä»¤ï¼æ¯å 为å¨è®¾ç½®ç¯å¢åépathçæ¶åï¼å¯è½è¦çäºåå 设置ççåéï¼åªè¦å¨pathåé¢æ·»å åéï¼%SystemRoot%\system32;
4ãå¨eclipseä¸å®è£ mavenæ件 http://she.iteye.com/blog/1217812ãhttp://www.cnblogs.com/freeliver54/archive/2011/09/07/2169527.html
5ã使ç¨links管çeclipseæ件 http://blog.csdn.net/cfyme/article/details/6099056/
äºãå¨windowsä¸æ建Apache Mahoutç¯å¢
Apache Mahout æ¯ Apache Software Foundation (ASF) å¼åçä¸ä¸ªå ¨æ°çå¼æºé¡¹ç®ï¼å ¶ä¸»è¦ç®æ æ¯å建ä¸äºå¯ä¼¸ç¼©çæºå¨å¦ä¹ ç®æ³ï¼ä¾å¼å人åå¨ Apache å¨è®¸å¯ä¸å 费使ç¨ã该项ç®å·²ç»åå±å°äºå®çæäºä¸ªå¹´å¤´ï¼ç®ååªæä¸ä¸ªå ¬å ±åè¡çãMahout å å«è®¸å¤å®ç°ï¼å æ¬é群ãåç±»ãCP åè¿åç¨åºã
详ç»å 容è§ï¼
1ãApache Mahout ç®ä»http://www.ibm.com/developerworks/cn/java/j-mahout/
2ãMaven 2.0:ç¼è¯ãæµè¯ãé¨ç½²ãè¿è¡http://www.ideagrace.com/html/doc/2006/06/14/00847.html
å¼å§æ建ï¼
1ãåºäº Apache Mahout æ建社ä¼åæ¨èå¼æhttp://www.ibm.com/developerworks/cn/java/j-lo-mahout/
æ¬ææ¯ç±æ¤ç¯æç« å¼ç³èæ¥ï¼æä»¥å ·ä½å°±æ¯å®ç°äºâTasteçå®è£ äºç®åçDemoå®ç°âã
2ã使ç¨mvnæ建Mahoutç¯å¢ http://anqiang1900.blog.163.com/blog/static/1141888642010380255296/
ç®åæ¥è¯´å°±æ¯å°Mahoutæºç ä»å®ç½ä¸ä¸è½½ä¸æ¥åï¼å¨dosä¸åæ¢å°æ ¹æ件夹åæ§è¡mvn installã
3ãå¨Eclipseä¸æ建Mahout http://www.cnblogs.com/dlts26/archive/2011/09/13/2174889.html
å°±æ¯å°Mahoutæºç å¯¼å ¥Eclipseä»èå½¢æMavenå·¥ç¨ãåå¨mahoutæ件夹ä¸æ§è¡maven installï¼å¦æä¸ä¸æ¥æ²¡åè¿ä¸ªçè¯ï¼ã
ä¸ãè¿è¡Apache Mahoutä¸çTaste Webappä¾å
Taste æ¯ Apache Mahout æä¾çä¸ä¸ªååè¿æ»¤ç®æ³çé«æå®ç°ï¼å®æ¯ä¸ä¸ªåºäº Java å®ç°çå¯æ©å±çï¼é«æçæ¨èå¼æã
1.ä¿®æ¹mahout-taste-webappå·¥ç¨çpom.xml,æ·»å 对mahout-examplesçä¾èµ
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mahout-examples</artifactId>
<version>0.5</version>
</dependency>
2.å¨mahout-taste-webappå·¥ç¨çrecommender.propertiesä¸æ·»å
recommender.class=org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommender
3.ä»http://www.grouplens.org/node/73ä¸ä¸è½½æ°æ®æ件ï¼æä¸è½½çæ¯1M Ratings Data Set (.tar.gz)ç»è¿æµè¯éªè¯éè¿ï¼å ¶ä»æ°æ®æ件请èªè¡éªè¯ã解å以åå°ratings.datå¤å¶å°mahout-taste-webappå·¥ç¨ç/org/apache/mahout/cf/taste/example/grouplens/ä¸ï¼è³äºä¸ºä»ä¹æ¯è¿ä¸ªè·¯å¾ï¼è¯·å¤§å®¶å»çè¿ä¸ªç±»GroupLensDataModelã
4.ç°å¨åå¤å·¥ä½åºæ¬å®æäºï¼cdå°taste-webæ们æ¥è¿è¡ä¸æ
mvn jetty:run-war
5.访é®ä¸ä¸http://localhost:8080/RecommenderServlet?userID=1å°±è½çå°ææï¼è¿ä¸ªservletè¿æ¯æå ¶ä»åæ°è¯·åçRecommenderServletçjavadoc说æ
详ç»å 容è§http://seanhe.iteye.com/blog/1124682
åãéå°çé®é¢
1ãå¨Eclipseä¸é ç½®Mavenæ¶éå°çé®é¢
å¯å¨eclipseçæ¶åä¼æ示warningï¼æ¾ä¸å°jdkå¥çï¼è§£å³åæ³ï¼
å¨eclipse.iniæ件ä¸å å ¥å¦ä¸ä¸¤è¡ï¼vmæåjavaw.exeçä½ç½®ï¼æè ç´æ¥å°biné£éä¹å¯ä»¥ï¼ï¼
-vm
D:\Development\Java\jdk1.5.0_16\bin\javaw.exeï¼æ³¨æè¿ä¸¤è¡å å°-startupä¸-launcher.libraryä¹é´ï¼
2ãå¨windowsä¸æ建mahoutç¯å¢æ¶åºç°çé®é¢ï¼
2.1 å¨mahoutç®å½ä¸ï¼è¿è¡"mvn install"æ¶ï¼éå°ä»¥ä¸é误
Cannot run program "chmod": CreateProcess error=2
chmodæ¯linuxå½ä»¤ï¼æ¤é误æ¯ç±äº Cygwin + Hadoop è·å¨ Windows ä¸åºç°çã
ä¹å°±æ¯è¯´å¦æå½åå¨windowsä¸è¿è¡mahoutç¼è¯ï¼ä¸å®è¦ç¡®ä¿æ£ç¡®å®è£ äºCygwinï¼æç §ä¸é¢çæç¨è£ ä¸Cygwin便å¯ï¼åé¢hadoopçé ç½®å¯ä»¥ä¸ç¨å ¨é¨å®æï¼ï¼
è¿éç¨å 个æ¯è¾å¥½çææï¼è®²è§£å¦ä½å¨windowsä¸å®è£ Hadoop Clusterï¼
http://ebiquity.umbc.edu/Tutorials/Hadoop/00%20-%20Intro.html
http://hayesdavis.net/2008/06/14/running-hadoop-on-windows/ï¼
ä¸è½½ hadoop-0.19.1å¨ http://archive.apache.org/dist/hadoop/core/hadoop-0.19.1/
2.2å¨Cygwinä¸è¿è¡å½ä»¤ssh localhostè¿æ¥ä¸æåæ¶åºç°Connection closed by ::1é误
Cygwinï¼èæ¶è¿xxxx个å°æ¶ï¼æ¥éä¸æå¤ææç®ï¼ç»äºå°æ¤é¢ç®è§£å³ãé®é¢æè¿°ï¼å¨Win7ä¸Cygwinä¸ï¼ä½¿ç¨sshlocalhostå½ä»¤ï¼ åºç°Connectionclosedby127.0.0.1çé®é¢ã解å³æ¹æ¡ï¼1ãå¼ç«¯ââè¿è¡ââservices.msc2ãå³é® CYGWINsshdââå±æ§ââç»å½é项å¡ââéæ©âæ¤è´¦æ·âââæµè§ââé«çº§ââç«å³æ¥æ¾ââéæ©ä½ çè´¦æ·åï¼å¿ 须为治çåæéï¼ââè¾è¿å¯ç ï¼å¿ é¡» è¦æï¼ç©ºå¯ç ä¸æ¿åï¼ä¸åçµèç»å½å¯ç ç¸åï¼ââç¡®å®ã3ãéå¯CYGWINsshdæå³å³å¯ãè¿æ ·å°±ä»¥ä½ çè´¦æ·çåä¹å¯å¨äºè¿ä¸ªæå³ãèåsshlocalhostæåãè¿æ · åçä¸ä¸ªç¼ºç¹å¯è½æ¯ä½ è¦ç»çµè设个å¯ç
详è§ï¼http://blog.sina.com.cn/s/blog_4abbf0ae0100r8hh.html
3ãè¿è¡Taste Webappæ¶éå°çé®é¢
å¨Eclipseä¸é 置好mahoutåï¼å°±å¯ä»¥å¨mahoutä¸è¿è¡taste-webappç®æ³äºã
æä¸1,2æ¥éª¤ç±äºåé¢å·²ç»é 置好ï¼å°±ç´æ¥ä»ç¬¬3æ¥å¼å§é ç½®mahout-taste-webappä¸çå 容ã
åºç°çé®é¢ï¼
å¨æµè§å¨æ è¾å ¥http://localhost:8080/RecommenderServlet?userID=1ååºç°é误ï¼
HTTP ERROR: 404
Problem accessing /RecommenderServlet. Reason:
Not Found
Powered by Jetty://
ä»ç»æ¥ç第7æ¥mvn jetty:run-waræ¶ï¼åç°å ¶ä¸åºç°é误ï¼
WARN::FAILED taste-recommender: java.lang.OutOfMemoryError: Java heap space
表æåºç°mavenå·¥ç¨å å溢åºã
解å³åæ³ï¼
Windowsç¯å¢ä¸
å¨Mavenå®è£ ç®å½ä¸æ¾å°æ件%M2_HOME%\bin\mvn.bat ï¼è¿å°±æ¯å¯å¨Mavençèæ¬æ件ï¼å¨è¯¥æ件ä¸ä½ è½çå°æä¸è¡æ³¨é为ï¼
@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE...
å®çæææ¯ä½ å¯ä»¥è®¾ç½®ä¸äºMavenåæ°ï¼æ们就å¨æ³¨éä¸é¢å å ¥ä¸è¡ï¼
set MAVEN_OPTS=-Xmx1024M
æè ï¼å¨æ§è¡mvn jetty:run-warå½ä»¤ä¹åï¼æ§è¡
F:\mahout-distribution-0.5\taste-web>set MAVEN_OPTS=-Xmx1024M
æ们çå°ï¼é ç½®çMavené项çæäºï¼OutOfMemoryErrorä¹è½å¾ä»¥ç¸åºç解å³ã
1ï¼ JDKï¼ä½¿ç¨1.6çæ¬ãéè¦è¯´æä¸ä¸ï¼å 为è¦åºäºEclipseæ建ï¼æ以å¨è®¾ç½®pathçå¼ä¹åè¦å å®ä¹JAVA_HOMEåéã
2ï¼ Mavenï¼ä½¿ç¨2.0.11çæ¬æ以ä¸ãå¨eclipseä¸å®è£ mavenæ件âm2eclipseã
3ï¼Apache Mahoutï¼ä½¿ç¨0.5çæ¬ã
Apache Mahout -Taste Documentationä¸çå®è£ æ¥éª¤ï¼
[javascript] view plaincopy
4. Demo
To build and run the demo, follow the instructions below, which are written for Unix-like
operating systems:
1. Obtain a copy of the Mahout distribution, either from SVN or as a downloaded archive.
2. Download the "1 Million MovieLens Dataset" from http://www.grouplens.org/.
3. Unpack the archive and copy movies.dat and ratings.dat to
trunk/taste-web/src/main/resources/org/apache/mahout/cf/taste/example/
under the Mahout distribution directory.
4. Navigate to the directory where you unpacked the Mahout distribution, and navigate
totrunk.
5. Runmvn install, which builds and installs Mahout core to your local repository
6. cd taste-web
7. cp ../examples/target/grouplens.jar ./lib
8. Edit recommender.properties and fill in therecommender.class:
recommender.class=org.apache.mahout.cf.taste.example.grouplens.GroupLe
9. mvn package
10.mvn jetty:run-war. You may need to give Maven more memory: in a bash shell,
export MAVEN_OPTS=-Xmx1024M
11.Get recommendations by accessing the web application in your browser:
http://localhost:8080/RecommenderServlet?userID=1
This will produce a simple preference-item ID list which could be consumed by a client
application. Get more useful human-readable output with the debug parameter:
http://localhost:8080/RecommenderServlet?userID=1&debug=true
Incidentally, Taste's web service interface may then be found at:
http://localhost:8080/RecommenderService.jws
Its WSDL file will be here...
http://localhost:8080/RecommenderService.jws?wsdl
... and you can even access it in your browser via a simple HTTP request:
.../RecommenderService.jws?method=recommend&userID=1&howMany=10
ä¸ãå¨windowä¸å®è£ maven
ç°å¨Javaæ°æ¶æçä¸æåºç°ï¼ä¾å¦Strutsï¼Springï¼Hibernateçï¼é¡¹ç®çé ç½®æ件çå¢å¤ï¼ç»å¼å人å带æ¥å¾å¤§éº»ç¦ãå¨å®é çå¼åå½ä¸ï¼Myeclipseä¸çprojectè¶æ¥è¶åºå¤§ï¼æä¾èµç第ä¸æ¹Jarå è¶æ¥è¶å¤ï¼è¿æ¾å¾Projectå¾èè¿ï¼ç»é¡¹ç®ç®¡ç带æ¥äºå¾å¤§ä¸ä¾¿ï¼å°¤å ¶æ¯å¨ä¸äºå¤§å项ç®ã为äºè§£å³ä¸è¿°é®é¢ï¼Apacheå¼æºç»ç»åå¸äºMavenï¼å®éç¨äºå¤§çJava项ç®ã
æå ³mavenä»ç»è§ãMavenæå¨æåã ï¼ä¸è½½å°åï¼http://www.juvenxu.com/mvn-def-guide/
å®è£ æ¥éª¤ï¼
1ãä¸è½½å ï¼è§http://maven.apache.org/download.html
2ã解å缩ï¼å°å ¶ä¸çbinç®å½è®¾ç½®å°windows Pathç¯å¢åéä¸ï¼mavenä¹æ¯ä¾èµjdkçï¼å è£ å¥½jdkï¼å¨ç¯å¢åééé¢é 置好jdkã
2.1ã设置JAVA_HOMEï¼é¡¾åå ¶æ该åéçå«ä¹å°±æ¯javaçå®è£ è·¯å¾ï¼ï¼æ¾å°pathï¼ç¶åç¹ç¼è¾ï¼pathåéçå«ä¹å°±æ¯ç³»ç»å¨ä»»ä½è·¯å¾ä¸é½å¯ä»¥è¯å«javaå½ä»¤ï¼ååéå¼ä¸ºâ.;%JAVA_HOME%\binâï¼
2.2ãæ°å»ºåéåï¼M2_HOMEï¼åéå¼ï¼E:\maven\apache-maven-2.2.1ï¼æ³¨æè¿éä¸å«binçè·¯å¾ã2ãå¨pathå追å ;%M2_HOME%\binï¼æ³¨æè¿éå°binç®å½
3ãæµè¯å®è£ æ¯å¦æåï¼å¼å§->è¿è¡->cmd->mvn -version
注æï¼å½æ示mvnæ示ä¸æ¯å é¨å½ä»¤æå¤é¨å½ä»¤ï¼æ¯å 为å¨è®¾ç½®ç¯å¢åépathçæ¶åï¼å¯è½è¦çäºåå 设置ççåéï¼åªè¦å¨pathåé¢æ·»å åéï¼%SystemRoot%\system32;
4ãå¨eclipseä¸å®è£ mavenæ件 http://she.iteye.com/blog/1217812ãhttp://www.cnblogs.com/freeliver54/archive/2011/09/07/2169527.html
5ã使ç¨links管çeclipseæ件 http://blog.csdn.net/cfyme/article/details/6099056/
äºãå¨windowsä¸æ建Apache Mahoutç¯å¢
Apache Mahout æ¯ Apache Software Foundation (ASF) å¼åçä¸ä¸ªå ¨æ°çå¼æºé¡¹ç®ï¼å ¶ä¸»è¦ç®æ æ¯å建ä¸äºå¯ä¼¸ç¼©çæºå¨å¦ä¹ ç®æ³ï¼ä¾å¼å人åå¨ Apache å¨è®¸å¯ä¸å 费使ç¨ã该项ç®å·²ç»åå±å°äºå®çæäºä¸ªå¹´å¤´ï¼ç®ååªæä¸ä¸ªå ¬å ±åè¡çãMahout å å«è®¸å¤å®ç°ï¼å æ¬é群ãåç±»ãCP åè¿åç¨åºã
详ç»å 容è§ï¼
1ãApache Mahout ç®ä»http://www.ibm.com/developerworks/cn/java/j-mahout/
2ãMaven 2.0:ç¼è¯ãæµè¯ãé¨ç½²ãè¿è¡http://www.ideagrace.com/html/doc/2006/06/14/00847.html
å¼å§æ建ï¼
1ãåºäº Apache Mahout æ建社ä¼åæ¨èå¼æhttp://www.ibm.com/developerworks/cn/java/j-lo-mahout/
æ¬ææ¯ç±æ¤ç¯æç« å¼ç³èæ¥ï¼æä»¥å ·ä½å°±æ¯å®ç°äºâTasteçå®è£ äºç®åçDemoå®ç°âã
2ã使ç¨mvnæ建Mahoutç¯å¢ http://anqiang1900.blog.163.com/blog/static/1141888642010380255296/
ç®åæ¥è¯´å°±æ¯å°Mahoutæºç ä»å®ç½ä¸ä¸è½½ä¸æ¥åï¼å¨dosä¸åæ¢å°æ ¹æ件夹åæ§è¡mvn installã
3ãå¨Eclipseä¸æ建Mahout http://www.cnblogs.com/dlts26/archive/2011/09/13/2174889.html
å°±æ¯å°Mahoutæºç å¯¼å ¥Eclipseä»èå½¢æMavenå·¥ç¨ãåå¨mahoutæ件夹ä¸æ§è¡maven installï¼å¦æä¸ä¸æ¥æ²¡åè¿ä¸ªçè¯ï¼ã
ä¸ãè¿è¡Apache Mahoutä¸çTaste Webappä¾å
Taste æ¯ Apache Mahout æä¾çä¸ä¸ªååè¿æ»¤ç®æ³çé«æå®ç°ï¼å®æ¯ä¸ä¸ªåºäº Java å®ç°çå¯æ©å±çï¼é«æçæ¨èå¼æã
1.ä¿®æ¹mahout-taste-webappå·¥ç¨çpom.xml,æ·»å 对mahout-examplesçä¾èµ
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mahout-examples</artifactId>
<version>0.5</version>
</dependency>
2.å¨mahout-taste-webappå·¥ç¨çrecommender.propertiesä¸æ·»å
recommender.class=org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommender
3.ä»http://www.grouplens.org/node/73ä¸ä¸è½½æ°æ®æ件ï¼æä¸è½½çæ¯1M Ratings Data Set (.tar.gz)ç»è¿æµè¯éªè¯éè¿ï¼å ¶ä»æ°æ®æ件请èªè¡éªè¯ã解å以åå°ratings.datå¤å¶å°mahout-taste-webappå·¥ç¨ç/org/apache/mahout/cf/taste/example/grouplens/ä¸ï¼è³äºä¸ºä»ä¹æ¯è¿ä¸ªè·¯å¾ï¼è¯·å¤§å®¶å»çè¿ä¸ªç±»GroupLensDataModelã
4.ç°å¨åå¤å·¥ä½åºæ¬å®æäºï¼cdå°taste-webæ们æ¥è¿è¡ä¸æ
mvn jetty:run-war
5.访é®ä¸ä¸http://localhost:8080/RecommenderServlet?userID=1å°±è½çå°ææï¼è¿ä¸ªservletè¿æ¯æå ¶ä»åæ°è¯·åçRecommenderServletçjavadoc说æ
详ç»å 容è§http://seanhe.iteye.com/blog/1124682
åãéå°çé®é¢
1ãå¨Eclipseä¸é ç½®Mavenæ¶éå°çé®é¢
å¯å¨eclipseçæ¶åä¼æ示warningï¼æ¾ä¸å°jdkå¥çï¼è§£å³åæ³ï¼
å¨eclipse.iniæ件ä¸å å ¥å¦ä¸ä¸¤è¡ï¼vmæåjavaw.exeçä½ç½®ï¼æè ç´æ¥å°biné£éä¹å¯ä»¥ï¼ï¼
-vm
D:\Development\Java\jdk1.5.0_16\bin\javaw.exeï¼æ³¨æè¿ä¸¤è¡å å°-startupä¸-launcher.libraryä¹é´ï¼
2ãå¨windowsä¸æ建mahoutç¯å¢æ¶åºç°çé®é¢ï¼
2.1 å¨mahoutç®å½ä¸ï¼è¿è¡"mvn install"æ¶ï¼éå°ä»¥ä¸é误
Cannot run program "chmod": CreateProcess error=2
chmodæ¯linuxå½ä»¤ï¼æ¤é误æ¯ç±äº Cygwin + Hadoop è·å¨ Windows ä¸åºç°çã
ä¹å°±æ¯è¯´å¦æå½åå¨windowsä¸è¿è¡mahoutç¼è¯ï¼ä¸å®è¦ç¡®ä¿æ£ç¡®å®è£ äºCygwinï¼æç §ä¸é¢çæç¨è£ ä¸Cygwin便å¯ï¼åé¢hadoopçé ç½®å¯ä»¥ä¸ç¨å ¨é¨å®æï¼ï¼
è¿éç¨å 个æ¯è¾å¥½çææï¼è®²è§£å¦ä½å¨windowsä¸å®è£ Hadoop Clusterï¼
http://ebiquity.umbc.edu/Tutorials/Hadoop/00%20-%20Intro.html
http://hayesdavis.net/2008/06/14/running-hadoop-on-windows/ï¼
ä¸è½½ hadoop-0.19.1å¨ http://archive.apache.org/dist/hadoop/core/hadoop-0.19.1/
2.2å¨Cygwinä¸è¿è¡å½ä»¤ssh localhostè¿æ¥ä¸æåæ¶åºç°Connection closed by ::1é误
Cygwinï¼èæ¶è¿xxxx个å°æ¶ï¼æ¥éä¸æå¤ææç®ï¼ç»äºå°æ¤é¢ç®è§£å³ãé®é¢æè¿°ï¼å¨Win7ä¸Cygwinä¸ï¼ä½¿ç¨sshlocalhostå½ä»¤ï¼ åºç°Connectionclosedby127.0.0.1çé®é¢ã解å³æ¹æ¡ï¼1ãå¼ç«¯ââè¿è¡ââservices.msc2ãå³é® CYGWINsshdââå±æ§ââç»å½é项å¡ââéæ©âæ¤è´¦æ·âââæµè§ââé«çº§ââç«å³æ¥æ¾ââéæ©ä½ çè´¦æ·åï¼å¿ 须为治çåæéï¼ââè¾è¿å¯ç ï¼å¿ é¡» è¦æï¼ç©ºå¯ç ä¸æ¿åï¼ä¸åçµèç»å½å¯ç ç¸åï¼ââç¡®å®ã3ãéå¯CYGWINsshdæå³å³å¯ãè¿æ ·å°±ä»¥ä½ çè´¦æ·çåä¹å¯å¨äºè¿ä¸ªæå³ãèåsshlocalhostæåãè¿æ · åçä¸ä¸ªç¼ºç¹å¯è½æ¯ä½ è¦ç»çµè设个å¯ç
详è§ï¼http://blog.sina.com.cn/s/blog_4abbf0ae0100r8hh.html
3ãè¿è¡Taste Webappæ¶éå°çé®é¢
å¨Eclipseä¸é 置好mahoutåï¼å°±å¯ä»¥å¨mahoutä¸è¿è¡taste-webappç®æ³äºã
æä¸1,2æ¥éª¤ç±äºåé¢å·²ç»é 置好ï¼å°±ç´æ¥ä»ç¬¬3æ¥å¼å§é ç½®mahout-taste-webappä¸çå 容ã
åºç°çé®é¢ï¼
å¨æµè§å¨æ è¾å ¥http://localhost:8080/RecommenderServlet?userID=1ååºç°é误ï¼
HTTP ERROR: 404
Problem accessing /RecommenderServlet. Reason:
Not Found
Powered by Jetty://
ä»ç»æ¥ç第7æ¥mvn jetty:run-waræ¶ï¼åç°å ¶ä¸åºç°é误ï¼
WARN::FAILED taste-recommender: java.lang.OutOfMemoryError: Java heap space
表æåºç°mavenå·¥ç¨å å溢åºã
解å³åæ³ï¼
Windowsç¯å¢ä¸
å¨Mavenå®è£ ç®å½ä¸æ¾å°æ件%M2_HOME%\bin\mvn.bat ï¼è¿å°±æ¯å¯å¨Mavençèæ¬æ件ï¼å¨è¯¥æ件ä¸ä½ è½çå°æä¸è¡æ³¨é为ï¼
@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE...
å®çæææ¯ä½ å¯ä»¥è®¾ç½®ä¸äºMavenåæ°ï¼æ们就å¨æ³¨éä¸é¢å å ¥ä¸è¡ï¼
set MAVEN_OPTS=-Xmx1024M
æè ï¼å¨æ§è¡mvn jetty:run-warå½ä»¤ä¹åï¼æ§è¡
F:\mahout-distribution-0.5\taste-web>set MAVEN_OPTS=-Xmx1024M
æ们çå°ï¼é ç½®çMavené项çæäºï¼OutOfMemoryErrorä¹è½å¾ä»¥ç¸åºç解å³ã
温馨提示:答案为网友推荐,仅供参考
第1个回答 2015-04-30
显然可以,Windows下 Eclipse+Maven+Mahout 单机环境的搭建