设为首页 收藏本站
查看: 1150|回复: 0

[经验分享] NUTCH2.3 hadoop2.7.1 hbase1.0.1.1 solr5.2.1部署(三)

[复制链接]

尚未签到

发表于 2017-12-20 09:41:59 | 显示全部楼层 |阅读模式
  Precondition:
  hadoop 2.7.1
  
hbase 0.98.13
  
solr 5.2.1 / Apache Solr 4.8.1
  
http://archive.apache.org/dist/lucene/solr/4.8.1/
  
gora 0.6.1
  

  gora编译和Nutch编译部署
  1. Gora下载
  最新版本号呢gora是0.6.1,下载或者直接通过git获取 git clonehttps://github.com/apache/gora.git
  2.  改动gora pom.xml
  下面可能是Nutch2.3能终于执行的关键。没有1.0.1.1-hadoop2:)
  

<hadoop-1.version>1.2.1</hadoop-1.version>  
<hadoop-2.version>2.7.1</hadoop-2.version>
  
<hadoop-1.test.version>1.2.1</hadoop-1.test.version>
  
<hadoop-2.test.version>2.7.1</hadoop-2.test.version>
  
<hbase.version>0.98.13-hadoop2</hbase.version>
  
<hbase.test.version>0.98.13-hadoop2</hbase.test.version>
  

  3. 编译gora
  mvn clean install -DskipTests
  
mvn install -DskipTests
  4. 改动$NUTCH_HOME/conf/nutch-site.xml
<configuration>  
<property>
  <name>storage.data.store.class</name>
  <value>org.apache.gora.hbase.store.HBaseStore</value>

  <description>Default>  
</property>
  
<property>
  <name>http.agent.name</name>
  <value>My Nutch Spider</value>
  
</property>
  
<property>
  <name>plugin.includes</name>
  <value>protocol-httpclient|urlfilter-regex|parse-(html|tika)|index-(basic|anchor)|indexer-solr|scoring-opic|urlnormalizer-(pass|regex|basic)</value>
  
</property>
  
</configuration>
  

  5. 改动$NUTCH_HOME/ivy/ivy.xml
  全部&quot;org.apache.gora&quot;涉及到的rev改动为0.6。比如:
<dependency org=&quot;org.apache.gora&quot; name=&quot;gora-hbase&quot; rev=&quot;0.5&quot; conf=&quot;*->default&quot; /> =>  
<dependency org=&quot;org.apache.gora&quot; name=&quot;gora-hbase&quot; rev=&quot;0.6&quot; conf=&quot;*->default&quot; />
  删除&quot;org.apache.hadoop&quot;。加入:
  

<dependency org=&quot;org.apache.hadoop&quot; name=&quot;hadoop-client&quot; rev=&quot;2.7.1&quot; conf=&quot;*->default&quot;/>  

  

  6.改动$NUTCH_HOME/ivy/ivysettings.xml
<ivysettings>  
<settings defaultResolver=&quot;default&quot;/>     
  
<property name=&quot;m2-pattern&quot; value=&quot;${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]&quot; override=&quot;false&quot; />     
  
<resolvers>         
  
<chain name=&quot;default&quot;>            
  
<filesystem name=&quot;local-maven2&quot; m2compatible=&quot;true&quot; >                 
  
<artifact pattern=&quot;${m2-pattern}&quot;/>                 
  
<ivy pattern=&quot;${m2-pattern}&quot;/>            
  
</filesystem>            
  
<ibiblio name=&quot;central&quot; m2compatible=&quot;true&quot;/>         
  
</chain>     
  
</resolvers>
  
</ivysettings>
  

  7. $NUTCH_HOME/conf/gora.properties 加入
  gora.datastore.default=org.apache.gora.hbase.store.HBaseStore
  
8. 依据须要改动 $NUTCH_HOME/conf/regex-urlfilter.txt $NUTCH_HOME/conf/nutch-default.xml
  能够不用改
  9. 编译。要非常长时间
  ant runtime
  10. 将gora以下的hadoop*.jar复制到runtime/local/lib/
  cp /disk/gora/gora-core/lib/hadoop* /disk2/nutch/nutch-2.3/runtime/local/lib/
  11. 建立搜索url
  mkdir urls
  
echo http://nutch.apache.org/ >> urls/seek.txt
  12. 測试执行
  cd runtime/local/
  bin/nutch inject urls/seek.txt
  

  solr5.2.1 部署执行
  1. 下载解压
  2. example/example-DIH 包括了完整的solr home配置,复制到server/solr
  cp -rf /disk2/solr/solr-5.2.1/example/example-DIH/solr/* /disk2/solr/solr-5.2.1/server/solr/
  3. 解决Nutch执行中可能遇到的Error
404: Prob accessing /solr/solr/update. Reason: Not Found
  cd /disk2/solr/solr-5.2.1/server/solr
  cp /disk2/solr/solr-5.2.1/example/exampledocs/monitor.xml .
  curl http://127.0.0.1:8983/solr/solr/update --data-binary
@monitor.xml -H 'Content-type:application/xml'
  3. 为nutch crawl执行。还要改动/disk2/solr/solr-5.2.1/server/solr/solr/conf/schema.xml。加上:
<field name=&quot;host&quot; type=&quot;string&quot; stored=&quot;false&quot; indexed=&quot;true&quot;/>  <field name=&quot;site&quot; type=&quot;string&quot; stored=&quot;false&quot; indexed=&quot;true&quot;/>
  <field name=&quot;cache&quot; type=&quot;string&quot; stored=&quot;true&quot; indexed=&quot;false&quot;/>
  <field name=&quot;digest&quot; type=&quot;string&quot; stored=&quot;true&quot; indexed=&quot;false&quot;/>
  <field name=&quot;segment&quot; type=&quot;string&quot; stored=&quot;true&quot; indexed=&quot;false&quot;/>
  <field name=&quot;boost&quot; type=&quot;float&quot; stored=&quot;true&quot; indexed=&quot;false&quot;/>
  <field name=&quot;tstamp&quot; type=&quot;date&quot; stored=&quot;true&quot; indexed=&quot;false&quot;/>
  <field name=&quot;stamp&quot; type=&quot;date&quot; stored=&quot;true&quot; indexed=&quot;false&quot;/>  
  <field name=&quot;anchor&quot; type=&quot;string&quot; stored=&quot;true&quot; indexed=&quot;true&quot; multiValued=&quot;true&quot;/>  
  

4. bin/solr start  5. http://192.168.1.106:8983/solr
  6. bin/crawl urls/seek.txt TestCrawl http://192.168.1.106:8983/solr/solr
2
  

  FAQ
  以下是过程中遇到的让人愤慨的。。。
  

  1. 错误: 找不到或无法载入主类 org.apache.nutch.crawl.InjectorJob:
  
没有ant runtime
  2. Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
  nutch2.3 须要使用hbase 0.98.13 的几个hbase-comm*.jar / hbase-client*.jar / hbase-protocol*.jar。千万不要用hbase1.0.1.1的。
  
cd /disk2/hbase/hbase-0.98.13-hadoop2/lib
  
cp hbase-common* /disk2/nutch/nutch-2.3/runtime/local/lib/
  cp hbase-client-0.98.13-hadoop2.jar /disk2/nutch/nutch-2.3/runtime/local/lib/
  
cp hbase-protocol* /disk2/nutch/nutch-2.3/runtime/local/lib/
  3. Exception in thread &quot;main&quot; java.lang.NoSuchFieldError: HBASE_CLIENT_PREFETCH_LIMIT
  
原因同上。hbase 和 nutch不匹配
  

  4. 2015-07-21 13:53:53,238 WARN  util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java>
  就让他native好了
  
mkdir -p /disk2/nutch/nutch-2.3/runtime/local/lib/native/Linux-amd64-64/
  
cd /disk2/hadoop/hadoop-2.7.1/lib/native/
  
cp * /disk2/nutch/nutch-2.3/runtime/local/lib/native/Linux-amd64-64/
  
cp * /disk2/nutch/nutch-2.3/runtime/local/lib/native/
  

  


&#65279;&#65279;
&#65279;&#65279;
&#65279;&#65279;

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-425965-1-1.html 上篇帖子: ubuntu14.04环境下利用docker搭建solrCloud集群 下篇帖子: 9.Solr4.10.3数据导入(post.jar方式和curl方式)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表