国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識(shí)百科 - 正文

【Nutch2.2.1基礎(chǔ)教程之2.1】集成Nutch/Hbase/Solr構(gòu)建搜索引擎

來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-09 15:57:24
文檔

【Nutch2.2.1基礎(chǔ)教程之2.1】集成Nutch/Hbase/Solr構(gòu)建搜索引擎

【Nutch2.2.1基礎(chǔ)教程之2.1】集成Nutch/Hbase/Solr構(gòu)建搜索引擎:1、下載相關(guān)軟件,并解壓 版本號(hào)如下: (1)apache-nutch-2.2.1 (2) hbase-0.90.4 (3)solr-4.9.0 并解壓至/usr/search 2、Nutch的配置 (1)vi /usr/search/apache-nutch-2.2.1/conf/nutch-site.xml proper
推薦度:
導(dǎo)讀【Nutch2.2.1基礎(chǔ)教程之2.1】集成Nutch/Hbase/Solr構(gòu)建搜索引擎:1、下載相關(guān)軟件,并解壓 版本號(hào)如下: (1)apache-nutch-2.2.1 (2) hbase-0.90.4 (3)solr-4.9.0 并解壓至/usr/search 2、Nutch的配置 (1)vi /usr/search/apache-nutch-2.2.1/conf/nutch-site.xml proper

1、下載相關(guān)軟件,并解壓 版本號(hào)如下: (1)apache-nutch-2.2.1 (2) hbase-0.90.4 (3)solr-4.9.0 并解壓至/usr/search 2、Nutch的配置 (1)vi /usr/search/apache-nutch-2.2.1/conf/nutch-site.xml propertynamestorage.data.store.class/namevalueorg


1、下載相關(guān)軟件,并解壓

版本號(hào)如下:

(1)apache-nutch-2.2.1

(2) hbase-0.90.4

(3)solr-4.9.0

并解壓至/usr/search


2、Nutch的配置

(1)vi /usr/search/apache-nutch-2.2.1/conf/nutch-site.xml


storage.data.store.class
org.apache.gora.hbase.store.HBaseStore
Default class for storing data

(2)vi /usr/search/apache-nutch-2.2.1/ivy/ivy.xml

默認(rèn)情況下,此語句被注釋掉,將其注釋符號(hào)去掉,使其生效。

 

(3)vi /usr/search/apache-nutch-2.2.1/conf/gora.properties

添加以下語句:

gora.datastore.default=org.apache.gora.hbase.store.HBaseStore

以上三個(gè)步驟指定了使用HBase來進(jìn)行存儲(chǔ)。

以下步驟才是構(gòu)建基本Nutch的必要步驟。

(4)構(gòu)建runtime

cd /usr/search/apache-nutch-2.2.1/

ant runtime

(5)驗(yàn)證Nutch安裝完成

[root@jediael44 apache-nutch-2.2.1]# cd /usr/search/apache-nutch-2.2.1/runtime/local/bin/
[root@jediael44 bin]# ./nutch
Usage: nutch COMMAND
where COMMAND is one of:
inject inject new urls into the database
hostinject creates or updates an existing host table from a text file
generate generate new batches to fetch from crawl db
fetch fetch URLs marked during generate
parse parse URLs marked during fetch
updatedb update web table after parsing
updatehostdb update host table after parsing
readdb read/dump records from page database
readhostdb display entries from the hostDB
elasticindex run the elasticsearch indexer
solrindex run the solr indexer on parsed batches
solrdedup remove duplicates from solr
parsechecker check the parser for a given url
indexchecker check the indexing filters for a given url
plugin load a plugin and run one of its classes main()
nutchserver run a (local) Nutch server on a user defined port
junit runs the given JUnit test
or
CLASSNAME run the class named CLASSNAME
Most commands print help when invoked w/o parameters.


(6)vi /usr/search/apache-nutch-2.2.1/runtime/local/conf/nutch-site.xml 添加搜索任務(wù)


http.agent.name
My Nutch Spider

(7)創(chuàng)建seed.txt

cd /usr/search/apache-nutch-2.2.1/runtime/local/bin/

vi seed.txt

http://nutch.apache.org/


(8)修改網(wǎng)頁過濾器 vi /usr/search/apache-nutch-2.2.1/conf/regex-urlfilter.txt

vi /usr/search/apache-nutch-2.2.1/conf/regex-urlfilter.txt

# accept anything else
+.

修改為

# accept anything else
+^http://([a-z0-9]*\.)*nutch.apache.org/


(9)增加索引內(nèi)容

默認(rèn)情況下,schema.xml文件中的core及index-basic中的field才會(huì)被索引,為索引更多的field,可以通過以下方式添加。

修改nutch-default.xml,新增以下紅色內(nèi)容

plugin.includes

protocol-http|urlfilter-regex|parse-(html|tika)|index-(basic|anchor)|urlnormalizer-(pass|regex|basic)|scoring-opic|index-anchor|index-more|languageidentifier|subcollection|feed|creativecommons|tld

Regular expression naming plugin directory names to

include. Any plugin not matching this expression is excluded.

In any case you need at least include the nutch-extensionpoints plugin. By

default Nutch includes crawling just HTML and plain text via HTTP,

and basic indexing and search plugins. In order to use HTTPS please enable

protocol-httpclient, but be aware of possible intermittent problems with the

underlying commons-httpclient library.

或者可以在nutch-site.xml中添加plugin.includes屬性,并將上述內(nèi)容復(fù)制過去。注意,在nutch-site.xml中的屬性會(huì)代替nutch-default.xml中的屬性,因此必須將原有的屬性也復(fù)制過去。



3、Hbase的配置

(1)vi /usr/search/hbase-0.90.4/conf/hbase-site.xml





hbase.rootdir



hbase.zookeeper.property.dataDir



注:此步驟可不做。若不做,則使用hbase-default.xml(/usr/search/hbase-0.90.4/src/main/resources/hbase-default.xml)中的默認(rèn)值。

默認(rèn)值為:

 
 hbase.rootdir
 file:///tmp/hbase-${user.name}/hbase
 The directory shared by region servers and into
 which HBase persists. The URL should be 'fully-qualified'
 to include the filesystem scheme. For example, to specify the
 HDFS directory '/hbase' where the HDFS instance's namenode is
 running at namenode.example.org on port 9000, set this value to:
 hdfs://namenode.example.org:9000/hbase. By default HBase writes
 into /tmp. Change this configuration else all data will be lost
 on machine restart.
 
 
即默認(rèn)情況下會(huì)放在/tmp目錄,若機(jī)器重啟,有可能數(shù)據(jù)丟失。

但是建議還是把這些屬性做好配置,尤其是第二個(gè)關(guān)于zoopkeeper的,否則會(huì)導(dǎo)致各種問題。以下將目錄配置在本地文件系統(tǒng)中。



hbase.rootdir
file:///home/jediael/hbaserootdir


hbase.zookeeper.property.dataDir
file:///home/jediael/hbasezookeeperdataDir



注意,若無前綴file://,則默認(rèn)是hdfs://

但在0.90.4版本,默認(rèn)還是本地文件系統(tǒng)。



4、Solr的配置

(1)覆蓋solr的schema.xml文件。(對(duì)于solr4,應(yīng)該使用schema-solr4.xml)

cp /usr/search/apache-nutch-2.2.1/conf/schema.xml /usr/search/solr-4.9.0/example/solr/collection1/conf/

(2)若使用solr3.6,則至此已經(jīng)完成配置,但使用4.9,需要修改以下配置:

修改上述復(fù)制過來的schema.xml文件

刪除:

增加:


5、啟動(dòng)抓取任務(wù)

(1)啟動(dòng)HBase

[root@jediael44 bin]# cd /usr/search/hbase-0.90.4/bin/
[root@jediael44 bin]# ./start-hbase.sh

(2)啟動(dòng)Solr

[root@jediael44 bin]# cd /usr/search/solr-4.9.0/example/
[root@jediael44 example]# java -jar start.jar

(3)啟動(dòng)Nutch,開始抓取任務(wù)

[root@jediael44 example]# cd /usr/search/apache-nutch-2.2.1/runtime/local/bin/
[root@jediael44 bin]# ./crawl seed.txt TestCrawl http://localhost:8983/solr 2

大功告成,任務(wù)開始執(zhí)行。


關(guān)于上述過程的一些分析請(qǐng)見:

集成Nutch/Hbase/Solr構(gòu)建搜索引擎之二:內(nèi)容分析

http://blog.csdn.net/jediael_lu/article/details/37738569


使用crontab來設(shè)置Nutch的例行任務(wù)時(shí),出現(xiàn)以下錯(cuò)誤

JAVA_HOME is not set。

于是創(chuàng)建了一個(gè)腳本,用于執(zhí)行抓取工作:

#!/bin/bash
export JAVA_HOME=/usr/java/jdk1.7.0_51
/opt/jediael/apache-nutch-2.2.1/runtime/local/bin/crawl /opt/jediael/apache-nutch-2.2.1/runtime/local/urls/ mainhttp://localhost:8080/solr/ 2 >> ~jediael/nutch.log

然后再配置例行任務(wù)

30 0,6,8,10,12,14,16,18,20,22 * * * bash /opt/jediael/apache-nutch-2.2.1/runtime/local/bin/myCrawl.sh

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

【Nutch2.2.1基礎(chǔ)教程之2.1】集成Nutch/Hbase/Solr構(gòu)建搜索引擎

【Nutch2.2.1基礎(chǔ)教程之2.1】集成Nutch/Hbase/Solr構(gòu)建搜索引擎:1、下載相關(guān)軟件,并解壓 版本號(hào)如下: (1)apache-nutch-2.2.1 (2) hbase-0.90.4 (3)solr-4.9.0 并解壓至/usr/search 2、Nutch的配置 (1)vi /usr/search/apache-nutch-2.2.1/conf/nutch-site.xml proper
推薦度:
標(biāo)簽: 教程 基礎(chǔ) 2.2
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 欧美日韩亚洲高清不卡一区二区三区 | 欧美色人阁| 国产精品久久久久影院色 | 亚洲欧美激情在线 | 久久精品无遮挡一级毛片 | 欧美一区二区免费 | 性夜影院爽黄a爽免费看网站 | 国产精品一区二区久久精品 | 欧美日韩亚洲综合另类ac | 国产成人综合欧美精品久久 | 中文字幕欧美在线观看 | www.国产精品视频 | 亚洲国产成人久久综合碰碰动漫3d | 亚洲欧美视屏 | 亚洲欧美视频在线观看 | 欧美在线 | 亚洲 | 青青国产成人久久91网站站 | 日韩二区三区 | 精品国产乱码久久久久久浪潮 | 无遮挡色视频 | 欧美日韩性视频一区二区三区 | 毛片综合| 在线视频亚洲 | 国产成人三级经典中文 | 欧美极品在线视频 | 国内精品一级毛片免费看 | 九九久久久2 | 亚洲国产精品欧美日韩一区二区 | 久久久久国产精品美女毛片 | 国产视频网| 亚洲欧美日韩在线观看播放 | 国产精品乱码一区二区三区 | 久久国产精品成人免费 | 日韩在线不卡 | 美女一区 | 国产国语在线播放视频 | 特级全黄一级毛片视频 | 欧美嫩交| 欧美一区二区三区在线视频 | 日韩精品一区二区三区不卡 | 国产精品久久久久影院色 |