MogileFS administration client, this has little real-world usage and is considered a work-in-progress
Changes the device weight of device on host to weight. weight should be a non-negative Integer. Devices with higher weight values are more likely to be chosen for reads and writes.
Clears the tracker caches. Not implemented in all versions of MogileFS
Creates a new host named host. args must contain :ip and :port. Returns true if successful, false if not.
Enumerates fids using list_fids. Returns the number of valid fids processed
Returns an Array of device status Hashes. If devid is given only that device is returned.
admin.get_devices 1
Returns:
[{"status"=>"alive",
"mb_asof"=>nil,
"mb_free"=>666000,
"devid"=>1,
"hostid"=>1,
"mb_used"=>666,
"utilization"=>0.0,
"reject_bad_md5"=>false,
"observed_state"=>"writeable",
"mb_total"=>666666}]
Returns the domains and classes, and their policies present in the mogilefs.
admin.get_domains
Returns (on newer MogileFS servers):
{
"test" => {
"default" => {
"mindevcount" => 2,
"replpolicy" => "MultipleHosts()",
"hashtype => nil,
}
}
}
Returns (on older MogileFS servers without replication policies):
{"test"=>{"normal"=>3, "default"=>2}}
Returns an Array of host status Hashes. If hostid is given only that host is returned.
admin.get_hosts 1
Returns:
[{"status"=>"alive",
"http_get_port"=>nil,
"http_port"=>"",
"hostid"=>"1",
"hostip"=>"",
"hostname"=>"rur-1",
"altip"=>"",
"altmask"=>""}]
Returns a statistics structure representing the state of mogilefs.
*** This command no longer works with recent versions of MogileFS *** *** Use mogstats(1) from the MogileFS::Utils package on CPAN ***
admin.get_stats
Returns:
{"fids"=>{"max"=>"99", "count"=>"2"},
"device"=>
[{"status"=>"alive", "files"=>"2", "id"=>"1", "host"=>"rur-1"},
{"status"=>"alive", "files"=>"2", "id"=>"2", "host"=>"rur-2"}],
"replication"=>
[{"files"=>"2", "class"=>"normal", "devcount"=>"2", "domain"=>"test"}],
"file"=>[{"files"=>"2", "class"=>"normal", "domain"=>"test"}]}
Returns an Array of fid Hashes from from_fid, limited to count
admin.list_fids 0, 100
Returns:
[{"fid"=>99,
"class"=>"normal",
"domain"=>"test",
"devcount"=>2,
"length"=>4,
"key"=>"file_key"},
{"fid"=>82,
"class"=>"normal",
"devcount"=>2,
"domain"=>"test",
"length"=>9,
"key"=>"new_new_key"}]
reschedules all deferred replication, returns a hash with the number of files rescheduled:
admin.replicate_now => { "count" => 5 }
Turns the response res from the backend into an Array of Hashes from 1 to res. If underscore is true then a ‘_’ character is assumed between the prefix and the hash key value.
res = {"host1_remoteroot"=>"/mnt/mogilefs/rur-1",
"host1_hostname"=>"rur-1",
"host1_hostid"=>"1",
"host1_http_get_port"=>"",
"host1_altip"=>"",
"hosts"=>"1",
"host1_hostip"=>"",
"host1_http_port"=>"",
"host1_status"=>"alive",
"host1_altmask"=>""}
admin.clean 'hosts', 'host', res
Returns:
[{"status"=>"alive",
"http_get_port"=>nil,
"http_port"=>7600,
"hostid"=>1,
"hostip"=>"192.168.1.3",
"hostname"=>"rur-1",
"altip"=>"",
"altmask"=>""}]
Modifies klass on domain to store files on mindevcount devices via action. Returns the class name if successful, raises if not
Originally generated with the Darkfish Rdoc Generator 2, modified by wrongdoc.