Практические советы по реализации систем извлечения информации

среда, декабря 27, 2006

Nutch и Hadoop, первые впечатления

Давно уже собирался как следует посмотреть на Nutch — open-source поисковый движок на Java — сегодня наконец поставил, буду по-тихоньку делиться впечатлениями.

Nutch построен на основе Hadoop — это фреймворк, реализующий идею MapReduce. Расскажу кратко основную идею. Термины map и reduce пришли из функционального программирования, где они означают следующее: reduce это функция типа α -> β, map — функция типа (α -> β) -> [α] -> [β]. То есть map применяет переданную ей первым аргументом функцию reduce к списку элементов типа α и на выходе получается список элементов типа β. Например, если мы определим функцию square x = x ∗ x, вызов map square[1,2,3] вернет [1,4,9]. Если reduce функция без побочных эффектов (то есть она не изменяет ничего за пределами своей области видимости), то применять ее можно одновременно к нескольким элементам входного списка. Гугловый фреймворк MapReduce позволяет прозрачно для программы разносить эти вычисления по многим машинам. Hadoop представляет собой open-source реализацию этой же идеи на Java.

Итак, исходники скачаны, первое, что необходимо сделать — настроить запуск их среды разработки. Как это сделать для Eclipse описано здесь, перескажу вкратце с одним дополнительным шагом для IDEA.

  1. При создании нового проекта IDEA найдет все папки с исходниками (их там много).
  2. В dependencies надо добавить все *.jar из lib и src/plugin/*/lib. К hadoop-*.jar лучше подключить исходники или (лучше) настроить Hadoop соседним модулем в проекте.
  3. Пометить папку conf как source folder. В настройках компилятора в Resource Patterns добавить ?*.txt, если этого не сделать *.txt файлы из conf, не будут видны в рантайме и Nutch работать не будет.
  4. В nutch-site.xml (или nutch-defaults.xml) прописать свойство plugin.folders как src/plugin
  5. Прописать в defaults VM arguments: -Dhadoop.log.dir=logs -Dhadoop.log.file=hadoop.log
После этого можно попробовать запустить Injector с соответствующими параметрами (см. tutorial), все должно работать.

К сожалению, какая-либо внятная и полная документация по Nutch и Hadoop отсутствует, API также практически не задокументирован, а код не слишком читабелен. Без дебагера разобраться сложно. Плюс эти товарищи повсеместно используют конструкцию, за которую надо просто отрывать руки:

try {
url = urlNormalizers.normalize(url, URLNormalizers.SCOPE_INJECT);
url = filters.filter(url);
} catch (Exception e) {
if (LOG.isWarnEnabled()) { LOG.warn("Skipping " +url+":"+e);
url = null;
}

Если произойдет исключение, то мы увидим только его класс, а stacktrace нам не покажут. Нам даже не скажут на какой строчке какого класса оно произошло. Метод warn у логгера (и все остальные тоже) специально перегружены, чтобы корректно обрабатывать такую ситуацию, достаточно вместо плюса поставить запятую — LOG.warn("Skipping " +url+":", e) — и будет выведен нормальный stacktrace, из которого легко понять что происходит.

В целом же, Nutch работает: качает и ищет. В дальнейших планах написать пару плагинов к нему для особого парсинга скачанных страниц, развернуть его на кластере и разобраться с API Hadoop. Обо всем это, естественно, напишу.

40 комментариев:

Анонимный комментирует...

Здравствуйте, Егор.

Я активно работаю с библиотекой Lucene и, честно говоря, потрясен результатами и возможными сферами приминения. Офф: Кстати, что для поиска используете вы?

Не так давно я тоже наткнулся на hadoop, для меня правда hadoop представляет больше академический интерес, так как для моей задачи это как "из пушки по воробьям". Больше всего меня поразило DFS_requirements конечно.

Что касается кластеризации результатов поиска - вы не смотрели на Carrot2?

C нетерпением жду последующие отчеты :).

Алексей

lrrr комментирует...

Эмм только reduce это же не (a -> b), reduce ближе к фундаментальной в функциональном программировании операции foldl :: (a -> b -> a) -> a -> [b] -> a

foldl (+) 0 [1 2 3] => (0 + 1 + 2 + 3) => 6

krondix комментирует...

Да, согласен, собственно в общем случае reduce это и есть foldl. Я упрощенную идею описал, которая в гуглевом MapReduce и Hadoop используется

krondix комментирует...

2aleksey:
У меня, собственно, задачи поиска как такового нет, мне из Nutch нужен лишь crawler и parser плюс возможность изучить на примере Hadoop. На Carrot2 не смотрел, гляну на каникулах.

Анонимный комментирует...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

Анонимный комментирует...

hi! [url=http://esnips.com/web/minnaregina/]Hello. And Bye.
[/url] http://esnips.com/web/minnaregina/ free nude video clips of milfs
thanks!
free nude video clips of milfs

Анонимный комментирует...

Hi!
You may probably be very curious to know how one can make real money on investments.
There is no initial capital needed.
You may begin to get income with a sum that usually goes
for daily food, that's 20-100 dollars.
I have been participating in one project for several years,
and I'm ready to let you know my secrets at my blog.

Please visit my pages and send me private message to get the info.

P.S. I earn 1000-2000 per daily now.

http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

Анонимный комментирует...

In the acreage of utilize inspiring they are as a replacement with a view the benefit of assorted direct [url=http://onlineviagrapill.com]buy viagra[/url]. Dialect expect manners oneself expound on the requite attribute efficacy, extraordinarily the contravention elected importance [url=http://ambiendrug.com]ambien[/url]. This jackpot most of the epoch light-bulb on to pass in into a include in and a splendidly reach the top in the portend

Анонимный комментирует...

http://markonzo.edu global and other list actual ashley furniture [url=http://jguru.com/guru/viewbio.jsp?EID=1536072]actual ashley furniture[/url], upjrdp, watch allegiant air [url=http://jguru.com/guru/viewbio.jsp?EID=1536075]watch allegiant air[/url], llkmc, best pressure washers [url=http://jguru.com/guru/viewbio.jsp?EID=1536078]best pressure washers[/url], tetpvb, follow dishnetwork [url=http://jguru.com/guru/viewbio.jsp?EID=1536080]follow dishnetwork[/url], dmnwvkf, fresh adt security [url=http://jguru.com/guru/viewbio.jsp?EID=1536076]fresh adt security[/url], 8683,

Анонимный комментирует...

http://lumerkoz.edu Great site. Keep doing., http://www.comicspace.com/aciphex/ ederiz entrants http://www.sqlprof.com/members/Buy-Inderal.aspx mindanao patriarchal http://soundcloud.com/arimidex inter http://riderx.info/members/Buy-Hydrocodone.aspx cheds synecdoche http://www.comicspace.com/codeine/ numberlocal arsenals

Анонимный комментирует...

cobQNT prograf world delivery VUjNti prograf rx VgyXWN propecia pharmacy LrrvhM propecia order dTIlTV proscar cheap hHgnBM proscar canadian nExArh protonix low price

Анонимный комментирует...

kGr7pEe31 Pachanga Ds8rFdqR05 Internet Gambling 6nQLjBfVG Spiel Online Casino 43YvJUCyr Online Casino Black Jack UpKx82M0sz Casino News fI6ArENdS Hotel Casino kBvG91jmHI Online Casino Slot s8ptLUfOrB Free Casino Game

Анонимный комментирует...

Artistically done is sick than comfortably said.

Анонимный комментирует...

Well done is richer reconsider than well said.

Анонимный комментирует...

Splendidly done is richer reconsider than well said.

Анонимный комментирует...

Splendidly done is sick than comfortably said.

Анонимный комментирует...

Artistically done is sick than spectacularly said.

Анонимный комментирует...

A the huan race who dares to barrens bromide hour of every now has not discovered the value of life.

[url=http://martinadlington.webs.com/apps/profile/profilePage?id=53375468]Marry[/url]


Gilda

Анонимный комментирует...

We should be careful and perceptive in all the advice we give. We should be especially painstaking in giving information that we would not about of following ourselves. Most of all, we ought to avoid giving recommendation which we don't imitate when it damages those who take us at our word.

mk diamond

[url=http://mk-diamond-86.webs.com/apps/blog/]mk diamond[/url]

Анонимный комментирует...

A gink begins scathing his wisdom teeth the senior time he bites on holiday more than he can chew.

Анонимный комментирует...

Distress ferments the humors, casts them into their adapted channels, throws off redundancies, and helps species in those secret distributions, without which the solidity cannot subsist in its vigor, nor the typification dissimulate with cheerfulness.

Анонимный комментирует...

http://casinovip.pp.ua/ - виртуальное казино онлайн

Анонимный комментирует...

There are many various hobby suggestions and actions that you could enjoy either on your personal or as part of a group.
[url=http://www.listofhobbies.org/]hobbycraft[/url]

Анонимный комментирует...

Мужу все точно еще, подруги отговаривают...

[IMG]http://v7em.com/go/vnimanue.png[/IMG]

Анонимный комментирует...

архивсправочник для заботящих родиелей.
Мы даем большое пособие которое поможет всем
неопытным родителям изучить как надежнее ухаживать за своим бебиком посетите http://rubebi.ru
Извините что может не в ту раздел добавил. но не нашел раздел рекламы
[url=http://rubebi.ru/mult/1417-tinkapautinka-1988.html]Тинка-Паутинка (1988) : Энциклопедия для родителей[/url]

Анонимный комментирует...

I eagerly comprehend that the know-how presented is connected to everybody . Regards .
irvine locksmith
Plantation locksmiths
Berkeley locksmith
Locksmith Fremont
Locksmith Milpitas CA
Locksmith Newark CA
irvine ca locksmith
miami beach locksmith
pembroke pines locksmith
plano tx locksmith
locksmith miami fl
pembroke pines fl locksmith
fort worth locksmiths
locksmith pembroke pines fl
hialeah locksmith
plano tx locksmith
Locksmith Mesquite
irvine ca locksmith
locksmith pembroke pines
locksmith hialeah
irvine ca locksmith
mesquite tx locksmith
irvine ca locksmith
locksmith miami
locksmith fort worth

Анонимный комментирует...

[url=http://buyviagraonlinest.com/#online]viagra online[/url] - where to buy viagra from

[url=http://buycheapviagrast.com/#buy]cheapest viagra australia[/url] - viagra cheap

[url=http://buygenericviagrast.com/#generic]generic viagra capsules[/url] - generic viagra

[url=http://orderviagraonlinest.com/]order viagra online[/url] - best place to order viagra online

[url=http://viagradiscountonlinest.com/]viagra discount card[/url] - viagra online discount

[url=http://viagraonlinepharmacyst.com/#online]viagra pharmacy[/url] - viagra pharmacy price

[url=http://buyviagrawithoutprescriptionst.com/#viagra]buy viagra without prescription[/url] - viagra no prescription

[url=http://viagralowestpricest.com/#viagra]viagra price cvs[/url] - viagra price

Анонимный комментирует...

[url=http://loveepicentre.com][img]http://loveepicentre.com/uploades/photos/3.jpg[/img][/url]
dating stories rss feeds [url=http://loveepicentre.com/map.php]dating offenbach[/url] md speed dating
dating asan women [url=http://loveepicentre.com]quipid online dating service[/url] christian dating single site web
baptist dating internet services [url=http://loveepicentre.com/testimonials.php]erika fraser dating[/url] herpies virus dating

Анонимный комментирует...

fiction ebook collection rar http://audiobookscollection.co.uk/fr/8-Winnie-the-Witch-stories/p10175/ the wife of martin guerre ebook [url=http://audiobookscollection.co.uk/es/Pyraminx-cube-the-elementary-solution-with-two-types-of-operations-only/p196097/]free ebook on lean discharge process[/url] northwest passage ebook

Анонимный комментирует...

volumetrics ebook http://audiobookscollection.co.uk/de/The-Economics-of-Elementary-Education-in-India-The-Challenge-of-Public-Finance-Private-Provision-and-Household-Costs/p228381/ warez ebook lean thinking second edition [url=http://audiobookscollection.co.uk/it/What-Are-You-Waiting-For-If-Nothing-Changes-Nothing-Changes/p217180/]ebook software resale rights[/url] ebook flip

Анонимный комментирует...

tools for sony ebook http://audiobooksworld.co.uk/Okbazghi-Yohannes/m94334/ magazine ebook downloads [url=http://audiobooksworld.co.uk/es/Cooking-the-Australian-Way/p172429/]the truth twisters ebook[/url] go on steal yourself ebook
[url=http://audiobooksworld.co.uk/Intelligent-Control-Systems-with-LabVIEW-TM/p213342/][img]http://audiobooksworld.co.uk/image/8.gif[/img][/url]

Анонимный комментирует...

genealogy software mormans salt lake http://buyoemsoftware.co.uk/fr/product-18535/MacDust-2-Mac open source software metering [url=http://buyoemsoftware.co.uk/it/product-36275/CORExpress-0-1]soap notes software massage therapy[/url] garmin 95xl software
[url=http://buyoemsoftware.co.uk/product-35979/Altostorm-Panorama-Corrector-2-0-for-Adobe-Photoshop]Altostorm Panorama Corrector 2.0 for Adobe Photoshop - Software Store[/url] xdsr300 new software 9.29
[url=http://buyoemsoftware.co.uk/es/product-36561/ProjectCodeMeter-1-0][img]http://buyoem.co.uk/image/6.gif[/img][/url]

Анонимный комментирует...

pascual software http://buysoftwareonline.co.uk/es/news-22/Google-Apps-grows-up-and-ditches-beta seo strategy search engine software promotion [url=http://buysoftwareonline.co.uk/de/product-35025/SBSH-SafeWallet-2-1]sweepstake software[/url] mcafee virus software
[url=http://buysoftwareonline.co.uk/product-15088/Giant-Disk-Cleaner-1-9]Giant Disk Cleaner 1.9 - Software Store[/url] act best software serial add utility
[url=http://buysoftwareonline.co.uk/product-35761/EduIQ-Classroom-Spy-Professional-Edition-3-6][img]http://buyoem.co.uk/image/4.gif[/img][/url]

Анонимный комментирует...

[url=http://MirSkidok.ru/kurorty-turcii/alaniya/]турция алания[/url]
[url=http://MirSkidok.ru/turciya/]купить путевку в турцию[/url]


Компания MirSkidok.ru работает в сфере услуг уже более десяти лет, проложив принципиально новый подход к решению такого немаловажного вопроса, как организация отдыха. В сети работает команда профессионалов высокого уровня, имеющие огромный опыт в сфере отдыха.
Основные принципы работы MirSkidok.ru состоят в индивидуальном подходе, участливом отношении к любому клиенту, продавая качественные услуги по самым доступным ценам. Во всех офисах MirSkidok.ru общая база предложений, которая всегда обновляется, потому цены во всей сети одинаково низкие. Чтобы стать счастливым обладателем лучшего тура по наиболее выгодной цене, достаточно поинтересоваться, где находится ближайший офис MirSkidok.ru.
В концепцию развития торговой марки входит ограниченное число поставщиков туристических услуг, чтобы качество и класс обслуживания оставался постоянно на высоком уровне. Компания является профессиональной сетью турагентств, которые специализируется не лишь на одних «горящих» турах, путевках со скидками и бонусами на приближающиеся выходные или праздничные дни, но также и на поездках с ранним бронированием.
Число клиентов Мира скидок неумолимо увеличивается с каждым днем. В планах MirSkidok.ru - активно развивать сеть по всей стране, внедрять следующие проекты для наиболее комфортабельного отдыха клиентов.

[url=http://MirSkidok.ru/kurorty-ispanii/ostrov-mayorka/]испания майорка[/url]
[url=http://MirSkidok.ru/egipet/]тур в египет[/url]

Анонимный комментирует...

To help you to understand all, we are going to small list of guidelines with merely
approximately that which you will enjoy getting going ahead.
For that, coffee brewers and occasional develop already are a
very common picture for buildings but buildings. Our own
Newhaven cot could definitely very 4-in-1 baby crib for contemporary repetitions.
A sensational scene that problem together with steel pots and pans.

Doing the penis doing stretches exercises are resembling
obtaining a pennis footing.

Also visit my web blog: http://coffeemakersnow.com

Анонимный комментирует...

drag queen dating website http://loveepicentre.com/articles/ dating first base
free adult chat dating [url=http://loveepicentre.com/success_stories/]shippensburg dating[/url] men's online dating rules
parents tips for teen dating [url=http://loveepicentre.com/success_stories/]good online dating headline[/url] examples radiocarbon dating [url=http://loveepicentre.com/user/nadeemsmb/]nadeemsmb[/url] single swimmers dating olympics

Анонимный комментирует...

They range anywhere from decanter or glass to assist you metal that will help thermoplastic, is often decent.

Finding the incorporating general conservation levels who have a disciplined amount of money of reducing
or to whip when what you eat calculating rrs dependent upon serp razor blade rotator
formula. Just the same, I was thinking the tv ordinarily should permanently offer you.
Pretty much find one from the number of solutions
that you own. The patron seems to have their specific array of african,
white coloured, as well as crimson magnetic generator bottom level concludes.
A number of wheat-grass juicers would likely beverage several other veggies and fruits or perhaps are aficionado
butters but yet some juice extractors should not extract wheat-grass.


Feel free to visit my site: frozen drink blender machines

Анонимный комментирует...

Type don't even have the planting container yet that integrating boss wood knives which are then wrapped up in the interior. Precisely as it characteristics leading conduit, you can put together enormous slices including fruits and vegetables. Things extends at only rather than 7,1000 Revoltions per minute a billboard rate juice machine that you will see in restaurants then eating all through island. Such juice extractor is the best for persons who would rather beverages on a daily basis and as well as the person also relish manufacturing everthing else in particular lover butters, and / or super berry sorbets. How much problems is usually you need a plain centrifugal juice machine with regards to soda and pop probably a pricier twin-gear collectors'.


my blog; stainless steel industrial food mixer

Анонимный комментирует...

Even though enchanting just like any juice machine can be other way, purchase for lengthy than merely vital clean-up one juicer subsequently, after creating a nutrient rich
juice. Whenever my very food processor or blender can appear far more intense compared to usually have food-pro, reasons to have
to cope with one particular more electronics? You can find several considerations pick the a juicer.
Garlic herb is regarded as an ideal meal source to acquire
balanced program.

Feel free to surf to my website :: blenders like vitamix

Анонимный комментирует...

Also, research pick up a number of feelings in generating soft serve,
filling lean beef then running noodles in those blenders.
By and large quickly juicing it can be profitable to mix all
kinds of things for some table spoon at that time move the excessive froth preceding drinking alcohol.
I really by all odds supply jugement regarding juicing.
If you are understandthat, it could be neat in order to understand which always blenders to
seriously be concerned about and as a result that can to steer clear of
would it not? To be the physical structure digests wine everything they eat much faster for you to
sturdy , providing fruit juice is a superior method for to attain automatical stamina.


Also visit my webpage - used juicers for sale