Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Flume >> mail # user >> spoolDir source problem


Copy link to this message
-
RE: spoolDir source problem
I got this working with some code modifications. The reason for the exception on delete was either because the file didn't exist as it had been already deleted OR that the file was still in use.

I will follow up Monday when I have the time to test this thoroughly and review the code changes. I had some coworker help so the details of why it works now are in someone else's head.

thanks,
Paul
________________________________
From: Paul Chavez [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2013 2:23 PM
To: [EMAIL PROTECTED]
Subject: RE: spoolDir source problem

Er, I meant to say if file stream is not closed before attempting delete. I'm not a (good) programmer but it *looks* like that class is closing before delete but I honestly didn't understand entirely what was going on.

________________________________
From: Paul Chavez [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2013 2:05 PM
To: [EMAIL PROTECTED]
Subject: RE: spoolDir source problem

No issue with permissions that I can tell. Cursory research shows that this may happen if the file stream is not .close()'ed on creation.

________________________________
From: Nitin Pawar [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2013 1:53 PM
To: [EMAIL PROTECTED]
Subject: Re: spoolDir source problem

Paul,
here is part of code which is throwing the exception
it is part of flume-ng-core/src/main/java/org/apache/flume/serialization/DurablePositionTracker.java
    // On windows, things get messy with renames...
    // FIXME: This is not atomic. Consider implementing a recovery procedure
    // so that if it does not exist at startup, check for a rolled version
    // before creating a new file from scratch.
    if (PlatformDetect.isWindows()) {
      if (!trackerFile.delete()) {
        throw new IOException("Unable to delete existing meta file " +
            trackerFile);
      }
    }

I am not sure why the agent is not able to delete the file. Does the agent have the permission to access those directories ? i mean both read and write ?
I am no expert but just making a guess
On Sat, Apr 13, 2013 at 2:18 AM, Paul Chavez <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
We already have a CentOS cluster running half a dozen flume nodes, we've been feeding it production data for about 6 months and we've been very pleased with it so far. We are just looking to get agents on our app servers to smooth out cluster upgrades.
Thanks for your help,
Paul

________________________________
From: Israel Ekpo [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>]
Sent: Friday, April 12, 2013 1:42 PM

To: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>
Subject: Re: spoolDir source problem

It might be a good idea to set up Ubuntu 12 on a virtual machine using Virtual box and then set up your test environment there.

This will give you some confidence that the set up works before you deploy it

I dont really use Windows for development so unfortunately I am not able to help you troubleshoot this.

On 12 April 2013 16:37, Paul Chavez <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
1. Flume 1.3.1 I believe, whatever is packaged with latest CDH distribution.
2. Windows Server 2008 R2
3. The meta files are created by the flume agent, so should have full rights. I'm went through and recreated the spool directory with more explicit permissions now. It wasn't clear from the exception if the issue was with the meta files or the files I'm putting in the spool dir. Unfortunately it didn't seem to have an effect, recreated the directory with full access for everyone and same issue.

I'm ok with not having this functionality on Windows, just don't want to waste time on a solution that won't work. My current solution uses the Avro client to send files to a flume agent on our HDFS cluster running an avro source. The main reason I want a local Windows agent is for the HTTP Source which I've already been able to verify as working.

Thanks,
Paul
________________________________
From: Israel Ekpo [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>]
Sent: Friday, April 12, 2013 1:15 PM
To: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>
Subject: Re: spoolDir source problem

Paul,

I have the following questions:

(1) What version of Flume are you using?

(2) What version of Windows are you using?

(3) Does the user running Flume have permissions to read/write in the directories used for the spooling and channels?
This will help narrow down the reasons why this could be happening.

Nevertheless, it looks like the issue you are encountering is platform specific (just on Windows)
However, the problem is happening in org.apache.flume.serialization.DurablePositionTracker.getInstance()

Within the source code, there is a comment on line 94 in the file stating that on Windows renames is not really stable and the logic is not atomic.

There is also a recommendation for implementing a recovery procedure so that if the file does not exist on startup, it will check for a rolled version before attempting to create a brand new file.

If it is possible for you to move to a different environment other than Windows, that would be great.

If this is not possible, then try deleting your spooling directory "c:\flume_data\spool\web" which will also remove the metadata files recursively.

Back up all the pending files that have not yet been processed in the spooling directory before deleting the folder so that you can put the files back after the directory is recreated.

Then restart your agent to see if this works.

Let me know if this helps.

On 12 April 2013 14:41, Paul Chavez <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
Anyone have any ideas on this? I can't even find the class throwing the exception to try and see what it is doing. I would really like to use this on Windows, but would like to know at least if there's some
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB