mogilefs newbie help

Rob Rogers robrogers at mac.com
Thu Mar 31 06:12:11 PST 2005


Hi,

I'm trying to configure mogilefs and perlbal and I'm having some 
difficulty.

Specifically, when I try to create a new file with MogileFS using the 
example code on the danga site, I get this error message:

- unable to save file cuz Bad file descriptor at ./m.pl line 22, <GEN2> 
line 7.

And, when I did into /var/log/messages I see Perlbal is logging this 
messages when I try to save a file (ie $fh->close):

Mar 31 04:16:29 sls2 perlbal[30001]: system error: Unable to create 
file (error = Invalid argument, \
path = /var/mogdata//dev3/0/000/000, file = 0000000044.fid, fd = -1 
(Error obtaining link info: No s\
uch file or directory))

Pls note the path argument.


Here's my code:

#!/usr/bin/perl
use MogileFS;
use Carp;
use Data::Dumper;
$MogileFS::DEBUG = 1;
sub println {
     while ($_ = shift) {
         print("\n");
         print($_);
     }
     print "\n";
}
println('starting');
$myfile = `cat /etc/passwd`;
my $mogfs = MogileFS->new(domain => 'test',hosts => ['127.0.0.1:6001']);
die "Unable to init mogfs obj cuz $!\n" unless $mogfs;
my $fh = $mogfs->new_file("mykey1","normal");
#print "DUMPING:", Dumper($fh);
die "no fh cuz $!\n" unless $fh;
$fh->print($myfile);
$ret = $fh->close;
warn "unable to save file cuz $!" unless $ret;
println('done');

Thanks,

Rob



More information about the mogilefs mailing list