lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathias Walter (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SOLR-1301) Solr + Hadoop
Date Mon, 09 Aug 2010 12:10:30 GMT

    [ https://issues.apache.org/jira/browse/SOLR-1301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896514#action_12896514
] 

Mathias Walter commented on SOLR-1301:
--------------------------------------

I tried this patch with Hadoop 0.20.2. It works pretty well, except if speculative execution
is enabled (at least for the reducer). If that is the case, some jobs are running twice. The
first job is creating the zip file. The second tries this too and failed. Unfortunately, the
first job also fails. I've added a fs.exists(perm) to the SolrRecordWriter.packZipFile method,
but the first job still fails with the following exception right after the last write and
at nearly the same time the other job tests the existence of the zip file:

2010-08-06 15:35:33,883 INFO com.excerbt.mapreduce.solrindexing.SolrRecordWriter: RawPath
/hadoop/hdfs5/tmp/solr_attempt_201007231114_0068_r_000001_0.1/data/index/_4.frq, baseName
part-00001, root /hadoop/hdfs5/tmp/solr_attempt_201007231114_0068_r_000001_0.1, inZip 2 part-00001/data/index/_4.frq
2010-08-06 15:35:36,164 ERROR com.excerbt.mapreduce.solrindexing.SolrRecordWriter: packZipFile
exception {}
java.io.IOException: Filesystem closed
	at org.apache.hadoop.hdfs.DFSClient.checkOpen(DFSClient.java:230)
	at org.apache.hadoop.hdfs.DFSClient.access$600(DFSClient.java:65)
	at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.writeChunk(DFSClient.java:3058)
	at org.apache.hadoop.fs.FSOutputSummer.writeChecksumChunk(FSOutputSummer.java:150)
	at org.apache.hadoop.fs.FSOutputSummer.write1(FSOutputSummer.java:100)
	at org.apache.hadoop.fs.FSOutputSummer.write(FSOutputSummer.java:86)
	at org.apache.hadoop.fs.FSDataOutputStream$PositionCache.write(FSDataOutputStream.java:49)
	at java.io.DataOutputStream.write(DataOutputStream.java:90)
	at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:161)
	at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:118)
	at java.util.zip.ZipOutputStream.write(ZipOutputStream.java:272)
	at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:51)
	at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:87)
	at com.excerbt.mapreduce.solrindexing.SolrRecordWriter.zipDirectory(SolrRecordWriter.java:493)
	at com.excerbt.mapreduce.solrindexing.SolrRecordWriter.zipDirectory(SolrRecordWriter.java:469)
	at com.excerbt.mapreduce.solrindexing.SolrRecordWriter.zipDirectory(SolrRecordWriter.java:469)
	at com.excerbt.mapreduce.solrindexing.SolrRecordWriter.zipDirectory(SolrRecordWriter.java:469)
	at com.excerbt.mapreduce.solrindexing.SolrRecordWriter.packZipFile(SolrRecordWriter.java:385)
	at com.excerbt.mapreduce.solrindexing.SolrRecordWriter.close(SolrRecordWriter.java:349)
	at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:567)
	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:408)
	at org.apache.hadoop.mapred.Child.main(Child.java:170)

That's really strange. I checked this for many jobs. Also, the incomplete zip file is not
removed after this exception.

> Solr + Hadoop
> -------------
>
>                 Key: SOLR-1301
>                 URL: https://issues.apache.org/jira/browse/SOLR-1301
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Andrzej Bialecki 
>             Fix For: Next
>
>         Attachments: commons-logging-1.0.4.jar, commons-logging-api-1.0.4.jar, hadoop-0.19.1-core.jar,
hadoop-0.20.1-core.jar, hadoop.patch, log4j-1.2.15.jar, README.txt, SOLR-1301-hadoop-0-20.patch,
SOLR-1301-hadoop-0-20.patch, SOLR-1301.patch, SOLR-1301.patch, SOLR-1301.patch, SOLR-1301.patch,
SOLR-1301.patch, SOLR-1301.patch, SOLR-1301.patch, SolrRecordWriter.java
>
>
> This patch contains  a contrib module that provides distributed indexing (using Hadoop)
to Solr EmbeddedSolrServer. The idea behind this module is twofold:
> * provide an API that is familiar to Hadoop developers, i.e. that of OutputFormat
> * avoid unnecessary export and (de)serialization of data maintained on HDFS. SolrOutputFormat
consumes data produced by reduce tasks directly, without storing it in intermediate files.
Furthermore, by using an EmbeddedSolrServer, the indexing task is split into as many parts
as there are reducers, and the data to be indexed is not sent over the network.
> Design
> ----------
> Key/value pairs produced by reduce tasks are passed to SolrOutputFormat, which in turn
uses SolrRecordWriter to write this data. SolrRecordWriter instantiates an EmbeddedSolrServer,
and it also instantiates an implementation of SolrDocumentConverter, which is responsible
for turning Hadoop (key, value) into a SolrInputDocument. This data is then added to a batch,
which is periodically submitted to EmbeddedSolrServer. When reduce task completes, and the
OutputFormat is closed, SolrRecordWriter calls commit() and optimize() on the EmbeddedSolrServer.
> The API provides facilities to specify an arbitrary existing solr.home directory, from
which the conf/ and lib/ files will be taken.
> This process results in the creation of as many partial Solr home directories as there
were reduce tasks. The output shards are placed in the output directory on the default filesystem
(e.g. HDFS). Such part-NNNNN directories can be used to run N shard servers. Additionally,
users can specify the number of reduce tasks, in particular 1 reduce task, in which case the
output will consist of a single shard.
> An example application is provided that processes large CSV files and uses this API.
It uses a custom CSV processing to avoid (de)serialization overhead.
> This patch relies on hadoop-core-0.19.1.jar - I attached the jar to this issue, you should
put it in contrib/hadoop/lib.
> Note: the development of this patch was sponsored by an anonymous contributor and approved
for release under Apache License.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message