Giter Site home page Giter Site logo

echocat / puppet-mongodb Goto Github PK

View Code? Open in Web Editor NEW
33.0 6.0 57.0 199 KB

This module manages mongodb services. It provides the functions for sharding, mongod and mongos instances.

License: Other

Ruby 16.20% Puppet 35.32% Shell 38.35% HTML 10.12%
puppet mongodb echocat

puppet-mongodb's Introduction

mongodb

Table of Contents

  1. Overview - What is the mongodb module?
  2. Module Description - What does this module do?
  3. Setup - The basics of getting started with mongodb
  4. Usage - The class and defined types available for configuration
  5. Requirements
  6. Limitations - OS compatibility, etc.
  7. Contributing to the mongodb module

Overview

This module installs and makes basic configs for mongodb. That includes mongod and mongos. Out-of-the-box the defaults are set to install a mongodb version 2.4.x. If you want to use 2.6 see the setup examples below.

Github Master: Build Status

Module Description

MongoDB, is an open-source document database, and the leading NoSQL database. This module can be used to set up a simple standalone DB or all components for a full sharding cluster.

Setup

What mongodb affects:

  • repos/packages/services/basic configuration files for MongoDB

What mongodb NOT affects:

  • internal configuration of your MongoDB cluster, like Sharding Members and so on

Beginning with MongoDB

Starting with a mongodb server with replSet. This will install a 2.4.x version MongoDB:

  include mongodb
  mongodb::mongod {
    'my_mongod_instanceX':
      mongod_instance    => 'mongodb1',
      mongod_replSet     => 'mongoShard1',
      mongod_add_options => ['slowms = 50']
  }

Install MongoDB version 2.6

  class { 'mongodb':
    package_name  => 'mongodb-org',
    logdir       => '/var/log/mongodb/',
    # only debian like distros
    old_servicename => 'mongod'
  }
  mongodb::mongod {
    'my_mongod_instanceX':
      mongod_instance    => 'mongodb1',
      mongod_replSet     => 'mongoShard1',
      mongod_add_options => ['slowms = 50']
  }

Install exact version

Holy shit, I work in an enterprise environment. I need an specific version. So on a RHEL like system it would look like this:

  # mongodb 2.6.x
  class { 'mongodb':
    package_name   => 'mongodb-org',
    package_ensure => '2.6.2-1',
    logdir         => '/var/log/mongodb/',
    # only debian like distros
    old_servicename => 'mongod'
  }
  
  # mongodb 2.4.x
  class { 'mongodb':
    package_ensure => '2.4.10-mongodb_1',
    logdir         => '/var/log/mongodb/'
  }  

Configure MongoDB with run as user

Now we change the run as user and logdir path.

  class { 'mongodb':
    run_as_user  => mongod,
    run_as_group => wheel,
    logdir       => '/nfsshare/mymongologs/'
  }
  mongodb::mongod {
    'my_mongod_instanceX':
      mongod_instance    => 'mongodb1',
      mongod_replSet     => 'mongoShard1',
      mongod_add_options => ['slowms = 20']
}

Configuration mongodb cluster

And here is a more complex example of building a mongo sharding cluster 4 nodes (3 of them config server) with 4 shards in replication.

node mongo_sharding_default {

  # Install MongoDB

  include mongodb

  # Install the MongoDB shard server

  mongodb::mongod { 'mongod_Shard1':
    mongod_instance => 'Shard1',
    mongod_port     => 27019,
    mongod_replSet  => 'Shard1',
    mongod_shardsvr => 'true'
  }

  mongodb::mongod { 'mongod_Shard2':
    mongod_instance => 'Shard2',
    mongod_port     => 27020,
    mongod_replSet  => 'Shard2',
    mongod_shardsvr => 'true'
  }

  mongodb::mongod { 'mongod_Shard3':
    mongod_instance => 'Shard3',
    mongod_port     => 27021,
    mongod_replSet  => 'Shard3',
    mongod_shardsvr => 'true'
  }

  mongodb::mongod { 'mongod_Shard4':
    mongod_instance => 'Shard4',
    mongod_port     => 27022,
    mongod_replSet  => 'Shard4',
    mongod_shardsvr => 'true'
  }

  # Install the MongoDB Loadbalancer server

  mongodb::mongos { 'mongos_shardproxy':
    mongos_instance      => 'mongoproxy',
    mongos_port          => 27017,
    mongos_configServers => 'mongo1.my.domain:27018,mongo2.my.domain:27018,mongo3.my.domain:27018'
  }
}

 # This three nodes are shard members and run a mongoS

node 'mongo1.my.domain',
     'mongo2.my.domain',
     'mongo3.my.domain' inherits mongo_sharding_default {

  # Install the MongoDB config server

  include mongodb

  mongodb::mongod { 'mongod_config':
    mongod_instance  => 'shardproxy',
    mongod_port      => 27018,
    mongod_replSet   => '',
    mongod_configsvr => 'true'
  }
}

 # This node is just a shard member

node 'mongo4.my.domain' inherits mongo_sharding_default { }

Usage

Classes and Defined Types

This module installs mongodb from the repo with class mongodb. The redis service(s) are configured with the defined type redis::server.

Class: mongodb

This class installs mongodb packages and makes basic install configurations. It does not configure any mongo services. This is done by defined type mongodb::mongod and mongodb::mongos.

Most global parameters are set in params.pp and should fit the most use cases. But you can also set them, when including class mongodb.

Parameters within mongodb:

dbdir

Default is '/var/lib' (string). This is the root directory where the mongo instances will create their own subdirectories.

pidfilepath

Default is dbdir.

logdir

Default on Redhat '/var/log/mongo' and on Debian '/var/log/mongodb'.

logrotatenumber

Number of days to keep the logfiles.

package_ensure

Default is 'installed' . Here you can choose the version to be installed.

repo_manage

Default is true (boolean). Choose if this module should manage the repos needed to install the mongodb packages.

ulimit_nofiles

Default is 64000 (integer). Number of allowed filehandles. See recommendations

ulimit_nproc

Default is 64000 (integer). See recommendations

run_as_user

Default on Redhat is 'mongod' and on Debian 'mongodb' (string). The user the mongod is run with.

run_as_group

Default on Redhat is 'mongod' and on Debian 'mongodb' (string). The group the mongod is run with.

old_servicename

Default on Redhat is 'mongod' and on Debian 'mongodb' (string). Name of the origin mongodb package service. his will be deactivated.

Defined Type: mongodb::mongod

Used to configure mongoD instances. You can setup multiple mongodb servers on the same node. See the setup examples.

**Parameters within mongodb::mongod

mongod_instance

Despription of mongd service (shard1, config, etc) (required)

mongod_bind_ip

Default is '' (empty string). So listen in all.

mongod_port

Listen port (defaul: 27017)

mongod_replSet

Name of ReplSet (optional)

mongod_enable

Enable/Disable service at boot (default: true)

mongod_running

Start/Stop service (default: true)

mongod_configsvr

Is config server true/false (default: false)

mongod_shardsvr

Is shard server true/false (default: false)

mongod_logappend

Enable/Disable log file appending (default: true)

mongod_rest

Enable/Disable REST api (default: true)

mongod_fork

Enable/Disable fork of mongod process (default: true)

mongod_auth

Enable/Disable auth true/false (default: false)

mongod_useauth

Keyfile contents. Your random string/false (default: false)

mongod_engine

Select the database engine (default: wiredTiger)

mongod_monit

Use monit monitoring for mongod instances (default: false)

mongod_add_options

Array. Each field is "key" or "key=value" for parameters for config file

Defined Type: mongodb::mongos

Used to configure mongoS instances. You can setup multiple mongodb proxy servers on the same node. See the setup examples.

**Parameters within mongodb::mongos

mongos_instance

Despription of mongd service (shard1, config, etc) (required)

mongos_bind_ip

Listen ip (defaul: emtpy, so listen in all)

mongos_port

Listen port (defaul: 27017)

mongos_configServers

String with comma seperated list of config servers (optional)

mongos_enable

Enable/Disable service at boot (default: true)

mongos_running

Start/Stop service (default: true)

mongos_logappend

Enable/Disable log file appending (default: true)

mongos_fork

Enable/Disable fork of mongod process (default: true)

mongos_useauth

Keyfile contents. Your random string/false (default: false)

mongos_add_options

Array. Each field is "key" or "key=value" for parameters for config file

Requirements

Modules needed:

  • puppetlabs-stdlib
  • yo61-logrotate
  • puppetlabs-apt ( only for Debian/Ubuntu )

Software versions needed:

  • facter > 1.6.2
  • puppet > 2.6.2

On Redhat distributions you need the EPEL or RPMforge repository, because Graphite needs packages, which are not part of the default repos.

Limitations

This module is tested on CentOS 6.5 and should also run without problems on

  • RHEL/CentOS/Scientific 6+
  • Debian 6+
  • Ubunutu 10.04 and newer

Contributing

Echocat modules are open projects. So if you want to make this module even better, you can contribute to this module on Github.

puppet-mongodb's People

Contributors

cdenneen avatar chiemseesurfer avatar cynipe avatar dwerder avatar fraenki avatar goll avatar huandu avatar jvetter83 avatar micthiesen avatar mleiner avatar omehegan avatar reist avatar roganartu avatar smougenot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

puppet-mongodb's Issues

Duplicate declaration: Package[logrotate]

I'm using a logrotate module on my own for other things but this mongodb module seems to break things. Even passing in false for mongodb::logrotate::package_manage does not help. I tried adding a if ! defined(Package['logrotate']) { around your logrotate.pp definition but it does not help.

Error: Duplicate declaration: Package[logrotate] is already declared in file /tmp/packer-puppet-masterless/module-0/mongodb/manifests/logrotate.pp:18; cannot redeclare at /tmp/packer-puppet-masterless/module-0/logrotate/manifests/base.pp:9 on node ip-10-229-156-63.us-west-2.compute.internal

stand alone mongoS

The 'debian_mongos-init.conf.erb' file contains the lines:
mongod_<%= mongod_instance %>
.....
CONF="/etc/mongod_<%= mongos_instance %>.conf"

These may be a copy-paste error from the original 'debian_mongod-init.conf.erb' file...

When doing a 'puppet apply' of the code at the bottom,
it throws an error stating:
Detail: Could not find value for 'mongod_instance'

I replaced all 3 instances of mongod_ with mongos_ and it works.

Code:

node default
{
    # Install MongoDB
    include mongodb
    # Install the MongoDB shard server
    mongodb::mongos
    {
        'mongos_router': mongos_instance => "router", mongos_port => '27017', mongos_configServers => 'localhost:27050'
    }
}

Module does not run for fresh mongod install

Module depends on $::mongodb::old_servicename:

If mongo has not previously been installed this puppet module will not run

Error: /Stage[main]/Mongodb/Service[mongodb]: Could not evaluate: Could not find init script or upstart conf file for 'mongodb'
Notice: /Stage[main]/Mongodb/File[/etc/init.d/mongodb]: Dependency Service[mongodb] has failures: true

launching several instances with diferent parameters from outside arrays

Guys, can you help me with this? I have this global array of strings, $mongo_instances, defined by someone else, and i'm supposed to to create a mongod resource for each string in that array.
Problem is, the port also changes.
Before using your module I solved this problem with a define that looped over the array and used an .erb template that create an adequate mongo .conf file for each mongod.
I was wondering if you know a better way of doing this.

Pseudo code:

#these are the global arrays i get from someone else:
$mongo_instances = ['mongo1','mongo2','mongo3']
$mongo_ports = [27017,27018,27019]

for $i=0; $i<3; $i++ {

#create a resource like so

  mongodb::mongod { $mongo_instances[$i]:
    mongod_instance => $mongo_instances[$i],
    mongod_port     => $mongo_ports[$i],
    mongod_replSet  => 'samerepleset',
  }

}

or actually, more close to what I have is:

$mongo_instances = ['mongo1','mongo2','mongo3']
$mongo_iport = 27017

for $i=0; $i<count($mongo_instances); $i++ {

#create a resource like so

  mongodb::mongod { $mongo_instances[$i]:
    mongod_instance => $mongo_instances[$i],
    mongod_port     => $mongo_iport+$i,
    mongod_replSet  => 'samerepleset',
  }
 }

I know current mongo doesn't have straight forward iteration. Right now I'm experimenting with this:

https://docs.puppetlabs.com/references/latest/function.html#createresources

So I was wondering how to do accomplish the above, and also another question:

what is the diference between the mongod resource name and the mongod_instance resource parameter? Your docs say it's a description, but, does it actually go somewhere in mongo .conf or is it just used internally?

Found 1 dependency cycle

After upgrading from 3.4.3 to 3.5.0 I'm getting:
Error: Failed to apply catalog: Found 1 dependency cycle: (Anchor[apt::source::mongodb-source] => Apt::Source[mongodb-source] => Class[Mongodb::Repos::Apt] => Class[Apt::Update] => Exec[apt_update] => Class[Apt::Update] => Anchor[apt::source::mongodb-source])

this is puppet 3.8.6 and the installed modules:

/etc/puppet/modules
├── ajcrowe-supervisord (v0.6.0)
├── darin-zypprepo (v1.0.2)
├── duosecurity-duo_unix (v0.3.1)
├── dwerder-mongodb (v3.5.0)
├── fadeit-s3_backup (v0.2.0)
├── installmcollective (???)
├── jfryman-nginx (v0.2.7)
├── loggly-loggly (v1.0.4)
├── nanliu-staging (v1.0.3)
├── petems-swap_file (v2.1.0)
├── puppet (???)
├── puppet-mcollective (v2.1.1)
├── puppetlabs-activemq (v0.4.0)
├── puppetlabs-apt (v1.8.0)
├── puppetlabs-concat (v1.2.1)
├── puppetlabs-firewall (v1.6.0)
├── puppetlabs-java (v1.3.0)
├── puppetlabs-nodejs (v0.8.0)
├── puppetlabs-rabbitmq (v5.2.3)
├── puppetlabs-stdlib (v4.6.0)
├── puppetlabs-vcsrepo (v1.2.0)
├── purpleidea-gluster (v0.1.0)
├── richardc-datacat (v0.5.0)
├── rodjek-logrotate (v1.1.1)
├── rtyler-jenkins (v1.4.0)
├── saz-ssh (v2.6.0)
├── serverdensity-serverdensity_agent (v0.9.5)
└── thias-sysctl (v1.0.2)

and our code

  class { 'mongodb':
    package_name    => 'mongodb-org',
    package_ensure  => '3.0.11',
    logdir          => '/var/log/mongodb',
    # only debian like distros
    old_servicename => 'mongod'
  }
  mongodb::mongod { "localhost_${mongoPort}":
    mongod_port    => $mongoPort,
    mongod_replSet => $replicaSet,
  }

what could be causing this?

How to initiate replica set using the module.

We are using module to initiate single node, But there is no sample script to initiate a replicate as it is there for single node and sharded nodes. I want help in getting a sample script for initiating replica set with 3 nodes in it.

mongos keyfile being created before mongodb is installed

There is a race condition with the mongos_useauth option between the creation of /etc/mongos_${mongos_instance}.key and the actual installation of mongodb.

The error encountered is:

err: /Stage[main]/Common::Mongoproxy/Mongodb::Mongos[mongos_profile]/File[/etc/mongos_${mongos_instance}.key]/ensure: change from absent to file failed: Could not set 'file on ensure: Could not find user mongodb at /tmp/vagrant-puppet-1/modules-0/mongodb/manifests/mongos.pp:36
notice: /Stage[main]/Common::Mongoproxy/Mongodb::Mongos[mongos_profile]/Service[mongos_${mongos_instance}]: Dependency File[/etc/mongos_${mongos_instance}.key] has failures: true
warning: /Stage[main]/Common::Mongoproxy/Mongodb::Mongos[mongos_profile]/Service[mongos_${mongos_instance}]: Skipping because of failed dependencies

It is caused by the file creation not requiring mongodb install (hence no user yet exists).

Permissions error when starting instances

Hiya!

I'm experiencing a rather strange issue where my mongo instances won't start due to permission errors:

err: /Stage[main]//Mongodb::Mongod[mongod]/Service[mongod_mongod]/ensure: change from stopped to running failed: Could not start Service[mongod_mongod]: Execution of '/etc/init.d/mongod_mongod start' returned 1:  at /tmp/vagrant-puppet/modules-0/mongodb/manifests/mongod.pp:66

I've checked the permissions on the init script and they're 0755 as per the Puppet setup. Any idea what might be happening?

When removing the old mongodb init script, the service check fails

Initial puppet run will complete, but after /etc/init.d/mongodb is removed, the service checks fail.

Error: /Stage[main]/Mongodb/Service[mongodb]: Could not evaluate: Could not find init script or upstart conf file for 'mongodb'
Notice: /Stage[main]/Mongodb/File[/etc/init.d/mongodb]: Dependency Service[mongodb] has failures: true
Warning: /Stage[main]/Mongodb/File[/etc/init.d/mongodb]: Skipping because of failed dependencies

Mongodb package mongo-10gen-server is obsoleted by mongodb-org-server on CentOS

I got following error on a CentOS 6.4 server. It seems package name is changed.

Error: /Stage[main]/Mongodb::Install/Package[mongodb-10gen]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install mongo-10gen-server' returned 1: Package mongo-10gen-server is obsoleted by mongodb-org-server, trying to install mongodb-org-server-2.6.5-1.x86_64 instead

Issues with cycle being generated

In grabbing the plugin and I think configuring it correctly, I get the following issue:

Error: Could not apply complete catalog: Found 1 dependency cycle:
(Anchor[mongodb::install::end] => File[/etc/yum.repos.d/mongodb.repo] => Yum::Managed_yumrepo[mongodb] => Class[Yum::Repo::Mongodb] => Package[mongodb-10gen] => Anchor[mongodb::install::end])

I'm using Puppet v3.0.1 and the first sample configuration provided.

I resolved it by removing the following line from the init.pp file:

    File {
        require => Anchor['mongodb::install::end'],
    }

This appears to remove the cycle and appears to set everything up correctly.

Here is a copy of the cycle.dot digraph that is generated:

digraph Resource_Cycles {
  label = "Resource Cycles"
"Anchor[mongodb::install::end]" -> "File[/etc/yum.repos.d/mongodb.repo]" -> "Yum::Managed_yumrepo[mongodb]" -> "Class[Yum::Repo::Mongodb]" -> "Package[mongodb-10gen]" -> "Anchor[mongodb::install::end]"
"Anchor[mongodb::install::end]" -> "File[/etc/yum.repos.d/mongodb.repo]" -> "Yumrepo[mongodb]" -> "Yum::Managed_yumrepo[mongodb]" -> "Class[Yum::Repo::Mongodb]" -> "Package[mongodb-10gen]" -> "Anchor[mongodb::install::end]"
"Anchor[mongodb::install::end]" -> "File[rpm_gpg]" -> "Yumrepo[mongodb]" -> "Yum::Managed_yumrepo[mongodb]" -> "Class[Yum::Repo::Mongodb]" -> "Package[mongodb-10gen]" -> "Anchor[mongodb::install::end]"
"Anchor[mongodb::install::end]" -> "File[yum.conf]" -> "Class[Yum]" -> "Class[Yum::Prerequisites]" -> "File[rpm_gpg]" -> "Yumrepo[mongodb]" -> "Yum::Managed_yumrepo[mongodb]" -> "Class[Yum::Repo::Mongodb]" -> "Package[mongodb-10gen]" -> "Anchor[mongodb::install::end]"
}

Duplicate declaration

Testing with:

node 'mongotest1.dallas07', 'mongotest.dallas07',
'mongotest3.dallas07' inherits default {
include base

include mongodb

Install the MongoDB shard server

mongodb::mongod {'mongod_Shard1': mongod_instance => "Shard1", mongod_port => '27019', mongod_replSet => "Shard1", mongod_shardsvr => 'true' }
mongodb::mongod {'mongod_Shard2': mongod_instance => "Shard2", mongod_port => '27020', mongod_replSet => "Shard2", mongod_shardsvr => 'true' }
mongodb::mongod {'mongod_Shard3': mongod_instance => "Shard3", mongod_port => '27021', mongod_replSet => "Shard3", mongod_shardsvr => 'true' }
mongodb::mongod {'mongod_Shard4': mongod_instance => "Shard4", mongod_port => '27022', mongod_replSet => "Shard4", mongod_shardsvr => 'true' }

Install the MongoDB Loadbalancer server

mongodb::mongos {
'mongos_profile':
mongos_instance => 'mongoproxy',
mongos_port => 27017,
mongos_configServers => 'mongotest1.dallas07:27018,mongotest2.dallas07:27018,mongotest3.dallas07:27018'
}
mongodb::mongod {
'mongod_config':
mongod_instance => 'profileConfig',
mongod_port => '27018',
mongod_replSet => '',
mongod_configsvr => 'true'
}
}

Here is what I am getting on puppet runs from these nodes...

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Mongodb::Limits::Conf[mongod-soft] is already declared in file /etc/puppet/environments/development/modules/mongodb/manifests/init.pp:116; cannot redeclare at /etc/puppet/environments/development/modules/mongodb/manifests/init.pp:116 on node mongotest1.dallas07
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

osfamily case statement in mongos.pp fails

osfamily case statement in mongos.pp fails. Debian and Redhat use uppercase where in mongod.pp they are lower case. I have tested and changing to lowercase works (as does quoting the uppercase strings). Will fork and raise pull request.

Error: Evaluation Error: No matching entry for selector parameter with value 'Debian' at /usr/src/puppet/modules/mongodb/manifests/mongos.pp:18:20 on node allinone01.watermelon.aws-us-w1.vc.i.kixeye.com
Error: Evaluation Error: No matching entry for selector parameter with value 'Debian' at /usr/src/puppet/modules/mongodb/manifests/mongos.pp:18:20 on node allinone01.watermelon.aws-us-w1.vc.i.kixeye.com

apt-get update errors involving 10gen.list

Running ubuntu 12.04 with puppet 3.8, I can't get the vm to spin out without apt-get errors involving the 10gen list. Logging included below. I did a strace and it appears that the Translation_en and Translation_en_US are missing.

Any thoughts?

db01: Debug: Apt::Key[Add key: 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10 from Apt::Source 10gen]: The container Apt::Source[10gen] will propagate my refresh event
==> db01: Notice: /Stage[main]/Mongodb::Repos::Apt/Apt::Source[10gen]/File[10gen.list]/ensure: created
==> db01: Debug: /Stage[main]/Mongodb::Repos::Apt/Apt::Source[10gen]/File[10gen.list]: The container Apt::Source[10gen] will propagate my refresh event
==> db01: Info: /Stage[main]/Mongodb::Repos::Apt/Apt::Source[10gen]/File[10gen.list]: Scheduling refresh of Exec[apt_update]
==> db01: Debug: Execapt_update: Executing '/usr/bin/apt-get update'
==> db01: Debug: Executing '/usr/bin/apt-get update'
==> db01: Error: /Stage[main]/Apt::Update/Exec[apt_update]: Failed to call refresh: Command exceeded timeout
==> db01: Error: /Stage[main]/Apt::Update/Exec[apt_update]: Command exceeded timeout

Could not find init script for 'mongodb'

I encountered an error:

err: /Stage[main]/Mongodb/Service[mongodb]: Could not evaluate: Could not find init script for 'mongodb'

This error occurs when the server reboots. While when installing to clean virtual machine all goes without errors

Here is debug messages:

debug: Service[mongodb](provider=debian): Could not find mongodb in /etc/init.d
debug: Service[mongodb](provider=debian): Could not find mongodb.sh in /etc/init.d
err: /Stage[main]/Mongodb/Service[mongodb]: Could not evaluate: Could not find init script for 'mongodb'
notice: /Stage[main]/Mongodb/File[/etc/init.d/mongodb]: Dependency Service[mongodb] has failures: true
warning: /Stage[main]/Mongodb/File[/etc/init.d/mongodb]: Skipping because of failed dependencies

Here is puppet:

class mongo {
    include mongodb

    mongodb::mongod {
        "mdb01":
            mongod_instance => "mdb01"
    }
}

Invalid resource type logrotate::rule

I'm trying to get the module working (using ref: 21b6930). But when I try to provision the server, it errors out with the following:

==> db01: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type logrotate::rule at /tmp/vagrant-puppet/modules-078fcdc8fc841e4b19c52c75025d7110/mongodb/manifests/logrotate.pp:29 on node ctcinteract-db01.ap.org
==> db01: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type logrotate::rule at /tmp/vagrant-puppet/modules-078fcdc8fc841e4b19c52c75025d7110/mongodb/manifests/logrotate.pp:29 on node ctcinteract-db01.ap.org

I'm running ubuntu 12.04 with puppet 3.8.3

Any help is appreciated.

can't install repo for mongodb 3.0.12 and Ubuntu 14.04

this maybe a version specific issue but for some reason when trying to install mongodb 3.0.12 on ubuntu 14.04 puppet does not pass the correct repo location. The path itself is correct but there are extra spaces in the address causing apt-get update to not find the mongodb 3.0 repo.

mismatched case between class name and module name

When you install this module from Puppet Forge, it installs with a module name "MongoDB". This was causing Puppet to not find the 'mongodb' class therein. Manually renamed the module folder to 'mongodb' and it worked.

Cool project btw. Thanks for sharing!

Could not find init script or upstart conf file for 'mongodb'

Using the following config:

class { 'mongodb':
 package_name   => 'mongodb-org',
 package_ensure => '2.6.3',
}

I get this error:

Error: /Stage[main]/Mongodb/Service[mongodb]: Could not evaluate: Could not find init script or upstart conf file for 'mongodb'
Error: /Stage[main]/Mongodb/Service[mongodb]: Failed to call refresh: Could not find init script or upstart conf file for 'mongodb'
Error: /Stage[main]/Mongodb/Service[mongodb]: Could not find init script or upstart conf file for 'mongodb'
Warning: /Stage[main]/Mongodb/File[/etc/init.d/mongodb]: Skipping because of failed dependencies
Warning: /Stage[main]/Mongodb/Anchor[mongodb::end]: Skipping because of failed dependencies

However...

vagrant@vagrant-ubuntu-trusty-64:~$ ls /etc/init/mongod.conf
ls: cannot access /etc/init/mongod.conf: No such file or directory

vagrant@vagrant-ubuntu-trusty-64:~$ ls /etc/init.d/mongod
/etc/init.d/mongod

vagrant@vagrant-ubuntu-trusty-64:~$ ps aux | grep mongo
mongodb   4293  2.6  3.9 351068 40492 ?        Sl   22:03   0:09 /usr/bin/mongod --config /etc/mongod.conf
vagrant   4365  0.0  0.0  10464   916 pts/0    S+   22:09   0:00 grep --color=auto mongo

So everything seem to have been installed and running just fine...

debian repo gpg key is too short

Hi,

We see a lot of the following messages on our machines;

[Add key: 7F0CEB10 from Apt::Source 10gen]) The id should be a full fingerprint (40 characters), see README.

This is due to not using the full finger print, which in this case is: 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10

Is this enough info for you, or do I need to fork the repo, make the change, issue a PR etc?

Cheers

R.

Cleanup package_ensure

./manifests/init.pp:9:  $package_ensure           = $mongodb::params::package_ensure,
./manifests/init.pp:34:                    package_ensure => $package_ensure,
./manifests/install.pp:5:  $package_ensure = 'installed',

Need to cleanup references since I think init.pp 9 and 34 aren't necessary since install.pp is doing it or 9 should be deleted and install.pp:5 should be changed to source $mongodb::params::package_ensure

initiate replicaset?

Does this module actually initiate a replicaset? I have created multiple mongod instances with the mongod_replSet attribute set but running rs.conf() shows that no replicaSet has been initiated.

Does this module support that? Am I missing something?

Constant Changing State or "Code Drift" Fix Ideas

I wanted to add this issue/discussion/etc as a place holder for someone to come up with an idea of how Because of the service check in init.pp for service ensure => stopped

https://github.com/echocat/puppet-mongodb/blob/master/manifests/init.pp#L45-L53

Because the instance named mongod processes still use the underlying mongod binary on every puppet run it thinks the oldservicename is running and tries to change it to stopped.

Notice: /Stage[main]/Mongodb/Service[mongod]/ensure: ensure changed 'running' to 'stopped'

Few ideas would be to check based on pid

exec { 'foo'
  command => 'service something stop && chkconfig something off',
  onlyif => '/usr/bin/test -f  /var/run/somepid.pi',
}

or add

onlyif => 'chkconfig --list | grep ^mongod$'

to existing service (but this wouldn't work on Debian)

running something like

 source /etc/init.d/functions; status mongod
mongod (pid 1881) is running...

shows as running so without copying binaries to instance names (maybe symlinks?) not sure how to avoid that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.