nutch研究记录2(搜索器配置)

2.    搜索器配置。
    a)    将nutch-1.0.war部署到tomcat上,第一次部署tomcat会报错,没关系,因为还没进行配置,我们目的在于解压出nutch-1.0,呵呵。
    b)    打开搜索器目录(我们称为web nutch),配置WEB-INF/classes/nutch-site.xml,

<property>
	    <name>searcher.dir</name>
	    <value>E:/java/CoreJava/IndexSearchAbout/nutch-1.0/crawled</value>
</property>
 

    c)    现在启动web nutch应该就没问题了,不过搜索中文时候会出现乱码,可以修改tomcat/conf/server.xml来解决

<!--
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
 -->
<Connector port="8080" 
     		maxThreads="150" 
     		minSpareThreads="25" 
     		maxSpareThreads="75" 
     		enableLookups="false" 
     		redirectPort="8443" 
     		acceptCount="100" 
     		debug="0" 
     		connectionTimeout="20000" 
     		disableUploadTimeout="true" 
     		URIEncoding="UTF-8" 
     		useBodyEncodingForURI="true" />
 

这里需要提醒一下,如果同一机器上同时运行搜索器和爬虫时候,当爬虫抓取数据保存到索引时候会抛出异常,因为有些索引文件被搜索器锁定,所以操作不了,导致异常!

你可能感兴趣的:(tomcat,C++,c,Web,xml)