katta - distributed lucene index in production

22
1 Katta & Hadoop Katta, lucene in a grid Katta - Distributed Lucene Index in Production Stefan Groschupf Scale Unlimited, 101tec. sg{at}101tec.com foto by: belgianchocolate@flickr.com

Upload: vsodera

Post on 10-Apr-2015

2.849 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Katta - Distributed Lucene Index in Production

1

Katta & Hadoop

Katta, lucene in a grid

Katta - Distributed Lucene Index in Production

Stefan GroschupfScale Unlimited, 101tec.

sg{at}101tec.comfoto by: [email protected]

Page 2: Katta - Distributed Lucene Index in Production

Intro

2

• Business intelligence reports from event stream

• Existing event stream processing platform V1

• Build on top of oracle

• Scale problems

• Expensive

• Slow

• Hugh star schema

• New report expensiv to develop

• Expensive to keep old data

Page 3: Katta - Distributed Lucene Index in Production

Goals

3

• Build next generation platform for event stream processing

• Faster report development - plugins

• Reduce total coast of ownership

• No license fees, open source based

• Commodity hardware

• Lower maintenance coasts

• Better scalable

• Better performance

• Cheap storage

Page 4: Katta - Distributed Lucene Index in Production

Challenge

4

• Integrate system into big picture

• Log data via JMS

• Report WebApp uses jdbc

• Report developers do not know Map Redcuce but SQL, XPath etc.

• Which format store data in?

• Which format process records in?

• Where store processing results in?

Page 5: Katta - Distributed Lucene Index in Production

Challenges II

5

• Teleskop to Microscope - zoom to log record level

• One report - many mr jobs

• Job Scheduling

• Enterprise 24/7 monitoring - SNMP

• Work with open source releases cycles

Page 6: Katta - Distributed Lucene Index in Production

Our Solution I

6

Database

Web Page

35%

29%

11%

10%

8%7%

Pig

JMS MSG

JMS MSG

JMS MSGDFS

Hadoop MR

Files by organized by day

Convert logs to measures Store results of

pig queries

Customer Userinterface

Katta

Distributed index for log message retrival

Web - Console

Monitor and manage everything

binary feed

Aggregate data and generate report data

Page 7: Katta - Distributed Lucene Index in Production

Our Solution II

7

JMS DFS MR PIG DB

Binary tree format xml > tuples text tuplesSQL

Schema

Page 8: Katta - Distributed Lucene Index in Production

Katta

8

• Serving indexes the hadoop distributed file system way

• Index as index shards on many servers

• Replicate shards on different servers for performance and fault-tolerance

• Lightweight

• Master fail over

• Fast*

• Easy to integrate

• Plays well with hadoop clusters

• Apache Version 2 License

Page 9: Katta - Distributed Lucene Index in Production

Contras

9

• No realtime updates like Solr, Couch DB or Cassandra yet** though on roadmap

• Index serving tool, not indexer

Page 10: Katta - Distributed Lucene Index in Production

What is a Katta index?

10

Lucene Index

Lucene Index

Lucene Index

Katta Index

• Folder with Lucene indexes

• Shard Indexes can be zipped

Page 11: Katta - Distributed Lucene Index in Production

Overview

11

hadoop cluster or single server

create index and copy to shared filesystem

Master

NodeNode Node Node

Secondary Master

Zookeeper Zookeeper

assignshards

download shards

command line management

java API

shard replication(plug-able policy)

java client API

multicast query

multicast query

server nodes in the grid

fail over

distributed rankingplug-able selection policy (custom load

balancing)

HDFS, NAS or shared local filesystem

<REST API/> *

Page 12: Katta - Distributed Lucene Index in Production

CLI

12

Page 13: Katta - Distributed Lucene Index in Production

API

13

Page 14: Katta - Distributed Lucene Index in Production

Lucene Queries

14

• title:"The Right Way" AND text:go

• te?t or test* or te*t

• mod_date:[20020101 TO 20030101]

• state:CA AND age:[1 TO 15] AND product:ipod

• state:CA AND age:[16 TO 21] AND product:ipod

Page 15: Katta - Distributed Lucene Index in Production

Teleskop to Microscope

15

• Create Index from XML in MR stage

• Deploy indexes in katta

• Merge indexes frequently together

• Find documents by key

• Find documents by query

Page 16: Katta - Distributed Lucene Index in Production

XML to Lucene Document

16

<event id=”aKey” type=”sell”> <product id=”ipod”/> <user id=”stefan” state=”CA” age=”31”/></event>

/event/@id:aKey/event/@type:sell/event/product/@id:ipod/event/user/@id:stefan/event/user/@state:CA/event/user/@ age:31

Page 17: Katta - Distributed Lucene Index in Production

Range Queries

17

/event/product/@id:ipod AND /event/user/@state:CA AND/event/user/@ age:[001 TO 010]

/event/product/@id:ipod AND /event/user/@state:CA AND/event/user/@ age:[011 TO 020]

/event/product/@id:ipod AND /event/user/@state:CA AND/event/user/@ age:[021 TO 030]

/event/product/@id:ipod AND /event/user/@state:CA AND/event/user/@ age:[031 TO 040]

Counting results -> one network round trip

Page 18: Katta - Distributed Lucene Index in Production

Range Queries Result Graph

18

0

15,000

30,000

45,000

60,000

01-10 11-20 21-30 31-40

Page 19: Katta - Distributed Lucene Index in Production

Pros

19

• Easy reports can be generated from katta index

• Complex reports generated with many pig statements (>30 job)

• Zoom in data from complex reports

• System scales

• Scaling is cheap

• We keep more data

• Report developing is easy

Page 20: Katta - Distributed Lucene Index in Production

Problems

20

• There was no cascading, hive or jaql, pig was very young

• Develop against changing open source project (hadoop, pig)

• Pig is/was slow (always text) and (was) buggy

• Katta indexes need to merged frequently

• Monitoring and management

Page 21: Katta - Distributed Lucene Index in Production

Roadmap

21

• 0.1 released

• 0.2 Hadoop 0.17

• 0.3 Hadoop 0.18

• Performance improvements

• EC2 support

• Add realtime update support

• Not yet clear how exactly

• Might be similar to Dynamo

Page 22: Katta - Distributed Lucene Index in Production

Thanks

22

katta.sourceforge.net

sg{at}101tec.com