Setup Nutch 1.6 to run on Hadoop cluster and integrate Solr for search

 

Nutch is an open source web crawler written in Java.  I had a previous post talking about Solr and Nutch integration, which mainly covered how you setup Nutch to run on local mode (without Hadoop) and integrate with Apache Solr for search. Today I am going to cover how we can run Nutch 1.6 on top of Hadoop.

1. Setup Apache Nutch 1.6

1.1a Setup Nutch from binary distribution:

This is no longer an option because the binary distribution by default in 1.6 is running on local mode.
1.1b Setup Nutch from source distribution:
  1. Download Nutch 1.6 source from http://www.apache.org/dyn/closer.cgi/nutch/.
  2. Unzip it and put the directory as $HOME/apache-nutch-1.6
  3. cd $HOME/apache-nutch-1.6
  4. Add your spider name as http.agent.name in conf/nutch-default.xml, for example:
    <property>
     <name>http.agent.name</name>
     <value>My Nutch Spider</value>
    </property>
  5. run “ant” command.
  6. It should generate a directory called $HOME/apache-nutch-1.6/runtime.
From now on, I am going to use ${NUTCH_RUNTIME_HOME} to refer to the current directory.
1.2 Verify Nutch installation
run the following command:
cd ${NUTCH_RUNTIME_HOME}/deploy 
bin/nutch
You are good to go if you are seeing the following:
Usage: nutch [-core] COMMAND
....
Troubleshooting tips:
1. Run the following command if you are seeing "Permission denied":
chmod +x bin/nutch
2. Setup JAVA_HOME if you are seeing JAVA_HOME not set.On Mac, you can run the following command or add it to ~/.bashrc:
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home

2. Setup Solr 3.6 or 4.1 for search

2.1a Setup Solr 3.6 from source distribution

You can setup Solr from source distribution with Maven. The link below shows how to do that:
http://thetechietutorials.blogspot.com/2011/06/how-to-build-and-start-apache-solr.html.

2.1b Setup Solr 3.6 from binary distribution

1. Download binary file from http://www.apache.org/dyn/closer.cgi/lucene/solr/.
2. unzip apache-solr-3.6.2.zip
3. cd apache-solr-3.6.2/example
4. java -jar start.jar

2.2 Verify Solr installation

After you started Solr admin console, you should be able to access the following links:
http://localhost:8983/solr/admin/
http://localhost:8983/solr/admin/stats.jsp

3. Setup Hadoop
You can skip this if you already setup Hadoop, otherwise, follow the instructions here.

4. Integrate Solr with Nutch

We have both Nutch, Solr and Hadoop installed and setup correctly. Below are the steps to make hyperlinks to be searchable:
  1.  For Solr 3.*: Run the command:
    cp ${NUTCH_RUNTIME_HOME}/conf/schema.xml ${APACHE_SOLR_HOME}/example/solr/conf/
  2. For Solr 4.*: Run the command below:
    cp ${NUTCH_RUNTIME_HOME}/conf/schema-solr4.xml ${APACHE_SOLR_HOME}/example/solr/conf/ 
    and add "_version_" to schema.xml for concurrency control as below: 
    <field name="_version_" type="long" indexed="true" stored ="true"/> 
  3. restart Solr with the command “java -jar start.jar” under ${APACHE_SOLR_HOME}/example
  4. Now we are ready to access http://localhost:8983/solr/admin/.
5. Crawl your first website
1. cd $HOME/apache-nutch-1.6/runtime/deploy
2. mkdir -p firstSite/urls
3. create a file nutch under firstSite/urls with the following content:
http://tutorial.waycoolsearch.com/
or any site you want Nutch to crawl.
4. Put the firstSite directory to HDFS.
hadoop fs -put firstSite firstSite
5.1 Run one of the following command if you don't want to send results to Solr yet:
hadoop jar apache-nutch-1.6.job org.apache.nutch.crawl.Crawl firstSite/urls -dir urls -depth 1 -topN 5
OR:
bin/nutch crawl firstSite/urls -dir urls -depth 1 -topN 5 
5.2 Run the following command, which will crawl the sites and send results to Solr for searching:
bin/nutch crawl firstSite/urls -dir urls -depth 1 -topN 5 -solr http://localhost:8983/solr/
6. Now we are ready to search with http://localhost:8983/solr/admin/.

Note: You must miss 1.1b 4-5 if you are seeing the following error:
ERROR fetcher.Fetcher: Fetcher: No agents listed in 'http.agent.name' property.

 

[출처] http://thetechietutorials.blogspot.kr/2013/02/setup-nutch-16-to-run-on-hadoop-cluster.html

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
338 [온라인 무료 대학강의] 졸리운_곰 2015.06.05 498
337 [온라인무료학습],인터넷만 되면 공부할 수 있는 사이트 모음 , 공짜로 공부하자! 무료 온라인 강의 사이트 모아모아왔어요! 졸리운_곰 2015.06.05 663
336 SQL로 하둡 쿼리를 처리하는 방법 10가지 file 졸리운_곰 2015.05.31 347
» Setup Nutch 1.6 to run on Hadoop cluster and integrate Solr for search 졸리운_곰 2015.05.20 199
334 RESTFul 에 대해서 알아보자 졸리운_곰 2015.05.15 371
333 사물인터넷 서비스 아이디어 전략5단계 file 졸리운_곰 2015.05.15 160
332 Mathematical Logic 졸리운_곰 2015.05.07 140
331 작은 출판사와 번역자의 괴로운 현실 졸리운_곰 2015.05.07 195
330 저작권 계약 진행절차 file 졸리운_곰 2015.05.07 276
329 [1인출판] 한 권 출판하는 데 얼마나 들까? 졸리운_곰 2015.05.07 578
328 번역 출판에 따른 저작권 문제와 유형별 해법 졸리운_곰 2015.05.07 210
327 소액사건심판절차 file 졸리운_곰 2015.05.07 530
326 소액재판이란 무엇인가요? 졸리운_곰 2015.05.07 436
325 소액사건재판의 진행과정 file 졸리운_곰 2015.05.07 401
324 소액사건재판의 개념 file 졸리운_곰 2015.05.07 492
323 손해배상 청구의 소장 작성법 및 주의사항 file 졸리운_곰 2015.05.07 777
322 민사소송에서의 무고죄 [자료출처: 법률구조관리공단] secret 졸리운_곰 2015.05.07 0
321 소액재판 안내 졸리운_곰 2015.05.07 694
320 [출처] 검찰청 고소장 서식모음 (검찰청) file 졸리운_곰 2015.05.07 261
319 LG Smart SMA 빅데이터 플랫폼 소프트웨어설계실습 자료 [설계서 make product] [무슨 뜻인지 아나] [학생들이 한걸 보여주지] file 졸리운_곰 2015.05.02 448
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED