Mogilefs client scripts does not work

thusitha thusitha at mnetplus.com
Fri Jul 7 02:04:11 UTC 2006


thusitha wrote:

> I didn't get your point exactly from the last reply.
>
> the result comes from the $mogfs is MogileFS=ARRAY(0x87d9d84)
>
> Is this an error code.
>
> And when I use the $mogfs to create new files and stick them in the system
>
> I always get the Unable to allocate filehandle. (at the 2nd line what 
> we have put)
>
> this is my MogileFS cluster that has been structured.
>
> 3 (x86 Intel) PCs where all 3 of them have Red Hat EL4 installed.
> IP adresses of them
> 192.168.5.141   (MySQL 5.0 cluster Management Server )
> 192.168.5.125   (MySQL 5.0 cluster ndb storage node, mogiletracker server)
> 192.168.5.117   (MySQL 5.0 cluster ndb storage node, mogiledb server 
> connected to mysql db, mogilestorage server)
>
> _Tracker setup (__/etc/mogilefs/mogilefsd.conf)_
> db_dsn DBI:mysql:mogilefs:192.168.5.117
> db_user mog
> db_pass mogpass
> conf_port 6001
> listener_jobs 5
>
> _mogilestorage setup (_/etc/mogilefs/mogstored.conf)
> httplisten=0.0.0.0:7500
> mgmtlisten=0.0.0.0:7501
> docroot=/var/mogdata
>
> this is what I get to _mogadm --lib=/usr/local/share/perl/5.8.4 
> --trackers=192.168.5.125:6001 check_ after running it on mogstorage 
> servever
> Checking trackers...
>         192.168.5.125:6001 ... OK
>
> Checking hosts...
>         [ 1] mogilestorage ... OK
>
> Checking devices...
>         host device            size(G)    used(G)    free(G)   use%
>         ---- --------------- ---------- ---------- ---------- ------
>         [ 1] dev1                4.780      4.185      0.595  87.55%
>         ---- --------------- ---------- ---------- ---------- ------
>                       total:     4.780      4.185      0.595  87.55%
>
> _these are the installed packages_
> BSD-Resource-1.28         IO-AIO-1.8               
> MogileFS-1.00                Perlbal-XS-HTTPHeaders-0.18
> Danga-Socket-1.48         IO-stringy-2.110         
> mogilefs-server-1.00         Sys-Syscall-0.21
> DBD-mysql-3.0006          Linux-AIO-1.9            Perlbal-1.41
>
> So what went wrong at the client script.
>
> Can you please send me the written client perl script for the above 
> configuration 
> which I can do the create a object, file save and delete in http usage.
>
> Thanks.
>
> Thusitha.
>
>
>
>
> Brad Fitzpatrick wrote:
>
>>You should ask the $mogfs object what its last error code was when it
>>doesn't give you a $fh.
>>
>>
>>On Tue, 4 Jul 2006, thusitha wrote:
>>
>>  
>>
>>>dear Sir
>>>
>>>I configured the mogile file system in two machines using Red Hat EL4
>>>platform. db, tracker and storage are perfectly working without any
>>>problem. Here I used mysql cluster and it also perfectly working.
>>>
>>>But I have a problem with client script. Only I can do is creating a
>>>object. I used two types of codings. And here they are..
>>>_object create_
>>>
>>>
>>>use MogileFS;
>>>my $mogfs = MogileFS->new(domain => 'testdomain',
>>>                          hosts  => [ '192.168.5.125:6001' ],
>>>                          # only on NFS/disk based installations
>>>                          root   => '/var/mogdata',);
>>>die "Unable to initialize MogileFS object.\n" unless $mogfs;
>>>
>>>above part works OK.
>>>
>>>_key create
>>>
>>>_my $fh = $mogfs->new_file("file_key", "testclass");
>>>die "Unable to allocate filehandle.\n" unless $fh;
>>>$fh->print($file_contents);
>>>die "Unable to save file to MogileFS.\n" unless $fh->close;
>>>
>>>this gives the error Unable to allocate filehandle at the 2nd line.
>>>
>>>_other code (ruby)
>>>
>>>_ # Create a new instance that will communicate with these trackers:
>>>  hosts = %w[192.168.5.125:6001]
>>>  mg = MogileFS::MogileFS.new(:domain => 'testdomain', :hosts => hosts
>>>                              :root => '/var/mogdata')
>>>
>>>  # Stores "A bunch of text to store" into 'some_key' with a class of 'text'.
>>>  mg.store_content 'some_key', 'testclass', "A bunch of text to store"
>>>
>>>that code gives so many errors
>>>
>>>I don't know much about perl scripting. I would like to do the client communication using http. I'll be very thankful if you can send me Most
>>>suitable and bias to working client code for file save to delete.
>>>
>>>Thanks
>>>
>>>Thusitha A.W.
>>>
>>>
>>>
>>>
>>>
>>>    
>>>
>>
>>
>>  
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/mogilefs/attachments/20060707/cff18b75/attachment.html


More information about the mogilefs mailing list