Hello, just joined, need to start with a plea for help.
I'm setting up a test installation, one tracker, one storage server, two
devices, all on the same machine. They seem to be running fine:
-bash-3.1$ ./mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=127.0.0.1:6001
check
Checking trackers...
127.0.0.1:6001 ... OK
Checking hosts...
[ 1] mogilestorage ... OK
Checking devices...
host device size(G) used(G) free(G) use% ob state
I/O%
---- ------------ ---------- ---------- ---------- ------ ----------
-----
[ 1] dev1 72.252 55.958 16.294 77.45% writeable
0.0
[ 1] dev2 72.252 55.958 16.294 77.45% writeable
0.0
---- ------------ ---------- ---------- ---------- ------
total: 144.505 111.916 32.588 77.45%
-bash-3.1$ ./mogadm --lib=/usr/lib/perl5/5.8.8 --trackers=127.0.0.1:6001
domain
list
domain class mindevcount
-------------------- -------------------- -------------
foo default 2
foo test 2
so I wrote a little test client based on the MogileFS::Client doc:
use MogileFS::Client;
# create client object w/ server-configured namespace
# and IPs of trackers
$mogc = MogileFS::Client->new(domain => "foo::test",
hosts => ['127.0.0.1:6001']);
die "Unable to initialize MogileFS object.\n" unless $mogc;
# create a file
# mogile is a flat namespace. no paths.
$key = "test:bar";
# must be configured on server
$fh = $mogc->new_file($key);
die "Unable to allocate filehandle: ".$mogc->errstr.".\n" unless $fh;
$data = "baz";
print $fh $data;
unless ($fh->close) {
die "Error writing file: " . $mogc->errcode . ": " . $mogc->errstr;
}
$file_contents = $mogc->get_file_data("foo");
print "Retrieved $file_contents\n";
and when running it I get an error:
-bash-3.1$ perl test1.pl
Unable to allocate filehandle: unreg_domain Domain name invalid/not
found.
which I don't understand since I have a domain::class of foo::test, as
above, looks registered to me. Or is it that my key namespace must be
registered with the servers (as suggested by the "must be configured on
server" comment from the docs). But I don't know how to register key
namespaces.
Any help greatly appreciated.
jay