您的位置:首页 > 运维架构 > Linux

CentOS nutch solr 集成问题 (二 )

2014-07-12 16:38 501 查看
前言: 对的版本是最好的,不要总想着最新的.

以下配置问题不行,直到把solr退到3.x,好了.

################################################################

##### ##########

#### ##########

#############################################################

1. 首先安装好java,并配置好环境:

yum update

yum list java*

yum install java-1.7.0-openjdk-devel.x86_64

vi + /etc/profile

JAVA_HOME=/usr/lib/jvm/java

JRE_HOME=/usr/lib/jvm/java/jre

PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib

export JAVA_HOME JRE_HOME PATH CLASSPATH
source /etc/profile

2. 然后,下载Solr(4.9),Nutch(1.8),各自解压.

复制 ${NUTCH_RUNTIME_HOME}/conf/schema.xml 到 ${APACHE_SOLR_HOME}/example/solr/conf/

到 ${APACHE_SOLR_HOME}/example 下去启动solr:

java -jar start.jar

3. 到 ${NUTCH_RUNTIME_HOME}/, index 数据到solr:

bin/crawl urls/seed.txt TestCrawl http://localhost:8983/solr/ 2

index之前,配置好抓数据的网址:

4. 问题遇到如下问题,放弃.

=============

====更新此问题20150326,后来看到解决方法:
http://sweblish.iteye.com/blog/1501700
在conf/nutch-default.xml中找到plugin.folders,修改value为绝对路径就好了.

======================

执行index动作的时候,出错:

SOLRIndexWriter

solr.server.url : URL of the SOLR instance (mandatory)

solr.commit.size : buffer size when sending to SOLR (default 1000)

solr.mapping.file : name of the mapping file for fields (default solrindex-mapping.xml)

solr.auth : use authentication (default false)

solr.auth.username : use authentication (default false)

solr.auth : username for authentication

solr.auth.password : password for authentication

Indexer: java.io.IOException: Job failed!

at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1357)

at org.apache.nutch.indexer.IndexingJob.index(IndexingJob.java:114)

at org.apache.nutch.indexer.IndexingJob.run(IndexingJob.java:176)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)

at org.apache.nutch.indexer.IndexingJob.main(IndexingJob.java:186)

Solr也出错如下:

114484 [qtp1333371531-18] ERROR org.apache.solr.core.SolrCore ▒C org.apache.solr.common.SolrException: ERROR: [doc=http://nutch.apache.org/apidocs/apidocs-1.1/index.html] unknown field 'host'

6.存储content

在solr的schema.xml中设置

<field name="content" type="text" stored="true" indexed="true"/>

5. 更多细节,请参考:
http://lucene.apache.org/solr/4_9_0/tutorial.html
http://wiki.apache.org/nutch/NutchTutorial#A3.3._Using_the_crawl_script


6. mac上搭建环境经历
1).找到java_home: /usr/libexec/java_home -V
2). 参考nutch文档配置nutch与solr. http://wiki.apache.org/nutch/NutchTutorial
3)启动solr最新版本,我选择的是bin/solr -e dih, 修改schemal也是修改对应example-dih中的schemal.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: