我如何在Linux内核上运行nutch?

前端之家收集整理的这篇文章主要介绍了我如何在Linux内核上运行nutch?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想在 linux内核上运行nutch,我已经以root用户身份运行了,
我已经设置了所有环境变量和nutch文件设置.
我创建了一个url.txt文件,其中包含要抓取的网址,
当我试图使用以下命令运行nutch时,
bin/nutch crawl urls -dir pra

它会产生以下异常.

crawl started in: pra
rootUrlDir = urls
threads = 10
depth = 5
Injector: starting
Injector: crawlDb: pra/crawldb
Injector: urlDir: urls
Injector: Converting injected urls to crawl db entries.
Exception in thread "main" java.io.IOException: Failed to get the current user's information.
        at org.apache.hadoop.mapred.JobClient.getUGI(JobClient.java:717)
        at org.apache.hadoop.mapred.JobClient.configureCommandLineOptions(JobClient.java:592)
        at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:788)
        at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1142)
        at org.apache.nutch.crawl.Injector.inject(Injector.java:160)
        at org.apache.nutch.crawl.Crawl.main(Crawl.java:113)
Caused by: javax.security.auth.login.LoginException: Login Failed: Cannot run program "whoami": java.io.IOException: error=12,Cannot allocate memory
        at org.apache.hadoop.security.UnixUserGroupInformation.login(UnixUserGroupInformation.java:250)
        at org.apache.hadoop.security.UnixUserGroupInformation.login(UnixUserGroupInformation.java:275)
        at org.apache.hadoop.mapred.JobClient.getUGI(JobClient.java:715)
        ... 5 more

服务器有足够的空间来运行任何java应用程序.我附加了静态..

total       used       free  
Mem:        524320     194632     329688 
-/+ buffers/cache:     194632     329688
Swap:      2475680          0    2475680
Total:     3000000     194632    2805368

是否有足够的存储空间用于nutch?
请有人帮助我,我是linux内核和nutch的新手.
提前致谢.

解决方法

阅读输出

Cannot run program “whoami”: java.io.IOException: error=12,Cannot allocate memory

看起来你没有足够的RAM或没有交换文件/分区.

猜你在找的Linux相关文章