现在的位置: 首页 > 综合 > 正文

Heritrix安装问题处理

2013年01月13日 ⁄ 综合 ⁄ 共 2752字 ⁄ 字号 评论关闭

(以下说明是在windows平台操作的)

下载heritrix-1.14.4,解压,修改conf/heritrix.properties, 设置好jmxremote.password相关信息,在bin目录下写个简单的批处理脚本start.bat,用来启动heritrix,内容如下:

heritrix.cmd --admin=admin:admin 

其中amin:admin为在配置文件中设置的登录用户名及密码。

 

接着双击start.bat,满怀期望地等待heritrix的成功启动,不料想等来了以下的错误:

Heritrix failed to start properly. Possible causes:

- Login and password have not been specified (see --admin switch)
- another program uses the port for the web UI (8080 by default)
  (e.g. another Heritrix instance)
- JMX password file is missing or permissions not set correctly	

 

排查,发现8080服务真的给占用了。可以直接修改conf/properties里面的属性,把8080改为其它端口。我这里直接把其它服务的端口给改了,并关闭该服务。接着再次双击start.bat,还是报以上的错误。登录账号和密码是没问题了,端口也没问题了,只能怀疑"JMX password file is missing or permissions not set correctly", 也就是jmxremote.password的权限设置。查看该文件的属性,发现该文件只有读的权限的,尝试修改一下,把所有权限都加上了,还是报错。

Do you want to try to fix the permissions (Y/N)?y
Restart Heritrix (Y/N)?y

输入“Y“ 之后还是不行,这时再打开该文件,看到权限又是只读了,看来该文件的权限只能设置了“只读”。不过看报错信息,问题应该还是出在那个文件上,可能还是权限问题。再次打开该文件的属性,看到“安全”标签,点击“高级”,发现该文件的所有者是“administrator“,而当前操作用户却不是administrator,会不会是这个问题导致的呢?接着把文件所有者由administrator换成当前用户,再次双击start.bat,这回终于成功运行了。

03:28:38.896 EVENT  Starting Jetty/4.2.23
03:28:39.582 EVENT  Started WebApplicationContext[/,Heritrix Console]
03:28:39.931 EVENT  Started SocketListener on 127.0.0.1:8080
03:28:39.932 EVENT  Started org.mortbay.jetty.Server@43050e86
2012-08-12 03:28:41.270 信息 thread-1 org.archive.crawler.Heritrix.postRegister(
) org.archive.crawler:guiport=8080,host=WIN-IRQDQ53U7HO,jmxport=8849,name=Heritr
ix,type=CrawlService registered to MBeanServerId=WIN-IRQDQ53U7HO_1344742115594,
SpecificationVersion=1.4, ImplementationVersion=1.7.0_03-b05, SpecificationVendo
r=Oracle Corporation
Heritrix version: 1.14.4

 

Heritrix成功运行时 ,会打开一个background window,如果不细心,会忽略该窗口,以为服务没运行。如果再次点击start.bat,由于服务已在运行,所以会报错:

错误: 代理抛出异常错误: java.rmi.server.ExportException: Port already in use: 8
49; nested exception is:
        java.net.BindException: Address already in use: JVM_Bind
请按任意键继续. . .

 

服务成功启动后,打开浏览器,输入http://localhost:8080就可以访问了

 

-----------------------以下是安装过程的一些疑问------------------

Q1:为什么jmxremote.password只能设置为“只读”

这个问题一开始出现在头脑中的时候,首要反应就是在搜索,结果找了一会没找到,在heritrix官网上找也不好找,因为官网的查找功能太弱了。但是又回到该文件,看到一堆注释的时候,就找到答案了,是为了防止别人修改该文件才做这样的限制的。原文如下:

# In a typical installation, this file can be read by anybody on the
# local machine, and possibly by people on other machines.
# For # security, you should either restrict the access to this file,
# or specify another, less accessible file in the management config file
# as described above.

Q2:heritrix成功启动后,进入管理页面,点击Help标签,里面有帮助文档、用户手册、开发文档等。User Manual里面写着是在Linu平台的,难道没有Windows平台的User Manual ?

However we are only committed to supporting its operation on Linux and so this chapter only covers setup on that platform. Because of this, what follows assumes basic Linux administration skills. Other chapters in the user manual are platform agnostic.

简单浏览了一下User Manual,发现里面的说明真的都是相对Linux平台来说的,不涉及到Windows(^_^,莫非英语水平不行,看不到重点)。不过也没关系,差别也不是很大。安装过程差别稍为大了一点,成功安装之后,进行管理页面,里面的基本都差不多了。

 

抱歉!评论已关闭.