Ubic::Service::MongoDB - running MongoDB as Ubic service
version 0.01
# 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', });
This is a Ubic service for MongoDB. You can start/stop mongod and mongos using this module.
mongod
mongos
new($params)
Creates new MongoDB service. $params is a hashref with the following parameters:
$params
Hashref with keys and values for MongoDB .conf file. This conf file regenerates every time at start.
What you want to start: mongod or mongos. Default is mongod.
User name that will be used as real and effective user identifier during exec of MongoDB.
Coderef for checking MongoDB status. Takes current instance of Ubic::Service::MongoDB as a first param.
Ubic::Service::MongoDB
Default implemetation uses serverStatus() MongoDB command.
serverStatus()
Path to ubic log.
Path to stdout log.
Path to stderr log.
Pidfile for Ubic::Daemon module.
Ubic::Daemon
If not specified it is a /tmp/mongo(d|s).<port>.pid.
Generated MongoDB config file name.
If not specified it is a /tmp/mongo(d|s).<port>.conf.
http://www.mongodb.org/display/DOCS/File+Based+Configuration
Ubic
Yury Zavarin <yury.zavarin@gmail.com>
This software is copyright (c) 2011 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.
To install Ubic::Service::MongoDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ubic::Service::MongoDB
CPAN shell
perl -MCPAN -e shell install Ubic::Service::MongoDB
For more information on module installation, please visit the detailed CPAN module installation guide.