执行:bin/nutch fetch data/segments/20180611001910/命令时,出现如下错误:
Fetcher: No agents listed in 'http.agent.name' property.
Fetcher: java.lang.IllegalArgumentException: Fetcher: No agents listed in 'http.agent.name' property.
可能的原因是:
nutch-default.xml配置文件或者nutch-site.xml配置文件中下面的<property>标签中配置信息的问题:
<name>http.agent.name</name>
<value></value>
在没有修改之前,该标签中的value内容是空,在其中添加一些信息,就可以了,例如:
<name>http.agent.name</name>
<value>YFC nutch agent</value>
在执行bin/nutch fetch data/segments/20180611001910/命令出现的内容如下:
Fetcher: starting at 2018-06-11 00:28:34
Fetcher: segment: data/segments/20180611001910
Using queue mode : byHost
Fetcher: threads: 10
Fetcher: time-out divisor: 2
QueueFeeder finished: total 1 records + hit by time limit :0
Using queue mode : byHost
Using queue mode : byHost
fetching https://blog.csdn.net/Y_FC_EMBEDD/ (queue crawl delay=5000ms)
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
Using queue mode : byHost
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
Using queue mode : byHost
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
Using queue mode : byHost
Thread FetcherThread has no more work available
Using queue mode : byHost
Using queue mode : byHost
-finishing thread FetcherThread, activeThreads=1
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
Using queue mode : byHost
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
Using queue mode : byHost
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
Using queue mode : byHost
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
Fetcher: throughput threshold: -1
Fetcher: throughput threshold retries: 5
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=1
-activeThreads=1, spinWaiting=0, fetchQueues.totalSize=0, fetchQueues.getQueueCount=1
Thread FetcherThread has no more work available
-finishing thread FetcherThread, activeThreads=0
-activeThreads=0, spinWaiting=0, fetchQueues.totalSize=0, fetchQueues.getQueueCount=0
-activeThreads=0
Fetcher: finished at 2018-06-11 00:28:37, elapsed: 00:00:03