NAME

Ubic::Service::MongoDB - running MongoDB as Ubic service

VERSION

version 0.02

SYNOPSIS

# in your ubic service (/etc/ubic/service/mymongo, for example)
use Ubic::Service::MongoDB;
return Ubic::Service::MongoDB->new({
    config => {
        dbpath    => '/var/lib/mongodb',
        logpath   => "/var/log/mongodb/mongodb.log",
        logappend => "true",
    },
    daemon => 'mongod',
    user   => 'mongodb',
    ubic_log => '/var/log/mongodb/ubic.log',
    stdout   => '/var/log/mongodb/stdout.log',
    stderr   => '/var/log/mongodb/stderr.log',
});

DESCRIPTION

This is a Ubic service for MongoDB. You can start/stop mongod and mongos using this module.

METHODS

new($params)

Creates new MongoDB service. $params is a hashref with the following parameters:

config

Hashref with keys and values for MongoDB .conf file. This conf file regenerates every time at start.

daemon (optional)

What you want to start: mongod or mongos. Default is mongod.

user (optional)

User name that will be used as real and effective user identifier during exec of MongoDB.

status (optional)

Coderef for checking MongoDB status. Takes current instance of Ubic::Service::MongoDB as a first param.

Default implemetation uses serverStatus() MongoDB command.

ubic_log (optional)

Path to ubic log.

stdout (optional)

Path to stdout log.

stderr (optional)

Path to stderr log.

pidfile (optional)

Pidfile for Ubic::Daemon module.

If not specified it is a /tmp/mongo(d|s).<port>.pid.

gen_cfg (optional)

Generated MongoDB config file name.

If not specified it is a /tmp/mongo(d|s).<port>.conf.

SEE ALSO

http://docs.mongodb.org/manual/reference/configuration-options/

Ubic

AUTHOR

Yury Zavarin <yury.zavarin@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Yury Zavarin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.