Each map task will run in an separate JVM. So you should create connection
pool for each task, And all the mapper instances in one task share the same
connection pool.

Another suggestion is that you can use JNDI to manger the connection . It
can be shared by all the map tasks in your cluster.


Jeff Zhang




On Mon, Nov 16, 2009 at 8:52 AM, yz5od2 <[email protected]>wrote:

> Hi,
>
> a) I have a Mapper ONLY job, the job reads in records, then parses them
> apart.  No reduce phase
>
> b) I would like this mapper job to save the record into a shared mysql
> database on the network.
>
> c) I am running a 4 node cluster, and obviously running out of connections
> very quickly, that is something I can work on the db server side.
>
> What I am trying to understand, is that for each mapper task instance that
> is processing an input split... does that run in its own classloader? I
> guess I am trying to figure out how to manage a connection pool on each
> processing node, so that all mapper instances would use that to get access
> to the database. Right now it appears that each node is creating thousands
> of mapper instance each with their own connection management, hence this is
> blowing up quite quickly. I would like the connection management to live
> separately from the mapper instances per node.
>
> I hope I am explaining what I want to do ok, please let me know if anyone
> has any thoughts, tips, best practices, features I should look at etc.
>
> thanks
>
>
>
>
>

Reply via email to