GithubHelp home page GithubHelp logo

sunggun-yu / chef-mongodb3 Goto Github PK

View Code? Open in Web Editor NEW
33.0 9.0 58.0 155 KB

Chef Cookbook for MongoDB v3

Home Page: https://supermarket.chef.io/cookbooks/mongodb3

License: Apache License 2.0

Ruby 87.34% HTML 9.94% Shell 2.71%

chef-mongodb3's Introduction

mongodb3 cookbook

Build Status

Install and configure the MongoDB 3

  • Install and configure the mongod (or configure the config server for shard cluster)
  • Install and configure the mongos
  • Also, mongos configure the mongos service with runit : service mongos start|stop|restart|status
  • Install and configure the MMS Automation Agent
  • Install and configure the MMS Monitoring Agent

NOTICE :

  • Current version is not supporting automation and monitoring mms agent installation for Debian 7.8.
  • MongoDB 3.2.8 is default version of mongodb3 cookbook.
  • Mongodb3 cookbook is NO LONGER SUPPORT Chef Client version 11.

Contributors

Supported Platforms

The following platforms have been tested with Test Kitchen

  • Ubuntu 12.04, 14.04, 15.04, 16.04
  • Debian 7.8
  • CentOS 6.8, 7.2
  • Oralce 6.6
  • Amazon Linux

Attributes

Cookbook Attributes

mongodb3 cookbook uses the package installation of mongodb3 such as yum or apt. and these attributes are used for setting default values in order to provide the correct installation of mongodb3. typically, you can modify cookbook attributes if you need. however, I do not recommend to modify these attributes if you want to use package that is provided from MongoDB.

WARNING : Please do not set the user and group attribute on your side. This cook book let installing user and group by mongodb package (except mongos and mms-monitoring-agent recipe). The user and group name will be set by condition in default attribute because mongodb package installs different user and group name by platform.

# MongoDB version to install
default['mongodb3']['version'] = '3.2.1'
default['mongodb3']['package']['version'] = Actual package version to install. It builds from version attribute.

# Package repository url
default['mongodb3']['package']['repo']['url'] = Package repository url

# Attribute for apt_repository
default['mongodb3']['package']['repo']['apt']['name'] = nil  # eg. 3.0, 3.2
default['mongodb3']['package']['repo']['apt']['keyserver'] = nil # eg. hkp://keyserver.ubuntu.com:80
default['mongodb3']['package']['repo']['apt']['key'] = nil # eg. 3.2 : 'EA312927', 3.0 : '7F0CEB10'
default['mongodb3']['package']['repo']['apt']['components'] = nil # `multiverse` for ubuntu. `main` for debian

# MongoDB user:group : PLEASE DO NOT SET THE USER AND GROUP ATTRIBUTE
default['mongodb3']['user'] = 'mongod' | 'mongodb'
default['mongodb3']['group'] = 'mongod' | 'mongodb'

# Mongod config file path
default['mongodb3']['mongod']['config_file'] = '/etc/mongod.conf'

# Mongos config file path
default['mongodb3']['mongos']['config_file'] = '/etc/mongos.conf'

# Runit template cookbook for mongos
default['mongodb3']['mongos']['runit_template_cookbook'] = 'mongodb3'

# Key file contents
default['mongodb3']['config']['key_file_content'] = nil

Mongod config Attributes

  • The default value of the attribute is referred to the MongoDB documentation.
  • The nil value attribute will be ignored for mongod config file.
  • This cookbook fills nil for some of the attribute value to concise initial mongod config file.
  • Also, deprecated attributed is not included.

systemLog Options

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

default['mongodb3']['config']['mongod']['systemLog']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['quiet'] = nil # default : false
default['mongodb3']['config']['mongod']['systemLog']['traceAllException'] = nil # default : false
default['mongodb3']['config']['mongod']['systemLog']['syslogFacility'] = nil # default : 'user'
default['mongodb3']['config']['mongod']['systemLog']['path'] = '/var/log/mongodb/mongod.log'
default['mongodb3']['config']['mongod']['systemLog']['logAppend'] = true # default : false
default['mongodb3']['config']['mongod']['systemLog']['logRotate'] = nil # default : 'rename'
default['mongodb3']['config']['mongod']['systemLog']['destination'] = 'file' # default : 'file'
default['mongodb3']['config']['mongod']['systemLog']['timeStampFormat'] = nil # default : 'iso8601-local'

systemLog.component Options

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

default['mongodb3']['config']['mongod']['systemLog']['component']['accessControl']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['command']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['control']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['geo']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['index']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['network']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['query']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['replication']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['sharding']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['storage']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['storage']['journal']['verbosity'] = nil # default : 0
default['mongodb3']['config']['mongod']['systemLog']['component']['write']['verbosity'] = nil # default : 0

processManagement Options

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

default['mongodb3']['config']['mongod']['processManagement']['fork'] = true or nil # default : false
default['mongodb3']['config']['mongod']['processManagement']['pidFilePath'] = '/var/run/mongodb/mongodb.pid' or nil

net Options

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

default['mongodb3']['config']['mongod']['net']['port'] = 27017
default['mongodb3']['config']['mongod']['net']['bindIp'] = nil # default : '0.0.0.0'
default['mongodb3']['config']['mongod']['net']['maxIncomingConnections'] = nil # default : 65536
default['mongodb3']['config']['mongod']['net']['wireObjectCheck'] = nil # default : true
default['mongodb3']['config']['mongod']['net']['ipv6'] = nil # default : false

net.unixDomainSocket Options

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

default['mongodb3']['config']['mongod']['net']['unixDomainSocket']['enabled'] = nil # default : true
default['mongodb3']['config']['mongod']['net']['unixDomainSocket']['pathPrefix'] = nil # default : '/tmp'
default['mongodb3']['config']['mongod']['net']['unixDomainSocket']['filePermissions'] = nil # default : '0700'

net.http Options

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

default['mongodb3']['config']['mongod']['net']['http']['enabled'] = nil # default : false
default['mongodb3']['config']['mongod']['net']['http']['JSONPEnabled'] = nil # default : false
default['mongodb3']['config']['mongod']['net']['http']['RESTInterfaceEnabled'] = nil # default : false

net.ssl Options

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

default['mongodb3']['config']['mongod']['net']['ssl']['mode'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['PEMKeyFile'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['PEMKeyPassword'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['clusterFile'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['clusterPassword'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['CAFile'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['CRLFile'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['allowConnectionsWithoutCertificates'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['allowInvalidCertificates'] = nil
default['mongodb3']['config']['mongod']['net']['ssl']['allowInvalidHostnames'] = nil # default : false
default['mongodb3']['config']['mongod']['net']['ssl']['FIPSMode'] = nil

security Options

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

default['mongodb3']['config']['mongod']['security']['keyFile'] = nil
default['mongodb3']['config']['mongod']['security']['clusterAuthMode'] = nil
default['mongodb3']['config']['mongod']['security']['authorization'] = 'disabled'
default['mongodb3']['config']['mongod']['security']['javascriptEnabled'] = nil # default : true

security.sasl Options

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

default['mongodb3']['config']['mongod']['security']['sasl']['hostName'] = nil
default['mongodb3']['config']['mongod']['security']['sasl']['serviceName'] = nil
default['mongodb3']['config']['mongod']['security']['sasl']['saslauthdSocketPath'] = nil

storage Options

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

default['mongodb3']['config']['mongod']['storage']['dbPath'] = '/var/lib/mongo' | '/var/lib/mongodb'
default['mongodb3']['config']['mongod']['storage']['indexBuildRetry'] = nil # default : true
default['mongodb3']['config']['mongod']['storage']['repairPath'] = nil
default['mongodb3']['config']['mongod']['storage']['journal']['enabled'] = true
default['mongodb3']['config']['mongod']['storage']['directoryPerDB'] = nil # default : false
default['mongodb3']['config']['mongod']['storage']['syncPeriodSecs'] = nil # default : 60
default['mongodb3']['config']['mongod']['storage']['engine'] = 'mmapv1'

storage.mmapv1 Options

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

default['mongodb3']['config']['mongod']['storage']['mmapv1']['preallocDataFiles'] = nil # default : true
default['mongodb3']['config']['mongod']['storage']['mmapv1']['nsSize'] = nil # default : 16
default['mongodb3']['config']['mongod']['storage']['mmapv1']['quota']['enforced'] = nil # default : false
default['mongodb3']['config']['mongod']['storage']['mmapv1']['quota']['maxFilesPerDB'] = nil # default : 8
default['mongodb3']['config']['mongod']['storage']['mmapv1']['smallFiles'] = nil # default : false
default['mongodb3']['config']['mongod']['storage']['mmapv1']['journal']['debugFlags'] = nil
default['mongodb3']['config']['mongod']['storage']['mmapv1']['journal']['commitIntervalMs'] = nil # default : 100 or 30

storage.wiredTiger Options

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

default['mongodb3']['config']['mongod']['storage']['wiredTiger']['engineConfig']['cacheSizeGB'] = nil
default['mongodb3']['config']['mongod']['storage']['wiredTiger']['engineConfig']['statisticsLogDelaySecs'] = nil # default : 0
default['mongodb3']['config']['mongod']['storage']['wiredTiger']['engineConfig']['journalCompressor'] = nil # default : 'snappy'
default['mongodb3']['config']['mongod']['storage']['wiredTiger']['engineConfig']['directoryForIndexes'] = nil # default : false
default['mongodb3']['config']['mongod']['storage']['wiredTiger']['collectionConfig']['blockCompressor'] = nil # default : 'snappy'
default['mongodb3']['config']['mongod']['storage']['wiredTiger']['indexConfig']['prefixCompression'] = nil # default : true

operationProfiling Options

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

default['mongodb3']['config']['mongod']['operationProfiling']['slowOpThresholdMs'] = nil # default : 100
default['mongodb3']['config']['mongod']['operationProfiling']['mode'] = nil # default : 'off'

replication Options

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

default['mongodb3']['config']['mongod']['replication']['oplogSizeMB'] = nil
default['mongodb3']['config']['mongod']['replication']['replSetName'] = nil
default['mongodb3']['config']['mongod']['replication']['secondaryIndexPrefetch'] = nil # default : 'all'

sharding Options

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

default['mongodb3']['config']['mongod']['sharding']['clusterRole'] = nil
default['mongodb3']['config']['mongod']['sharding']['archiveMovedChunks'] = nil # default : true

auditLog Options

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

default['mongodb3']['config']['mongod']['auditLog']['destination'] = nil
default['mongodb3']['config']['mongod']['auditLog']['format'] = nil
default['mongodb3']['config']['mongod']['auditLog']['path'] = nil
default['mongodb3']['config']['mongod']['auditLog']['filter'] = nil

snmp Options

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

default['mongodb3']['config']['mongod']['snmp']['subagent'] = nil
default['mongodb3']['config']['mongod']['snmp']['master'] = nil

Mongos config Attributes

Default config for mongos

default['mongodb3']['config']['mongos']['net']['port'] = 27018 # default : 27017
default['mongodb3']['config']['mongos']['net']['bindIp'] = '127.0.0.1' # default : '0.0.0.0'
default['mongodb3']['config']['mongos']['systemLog']['path'] = '/var/log/mongodb/mongos.log'
default['mongodb3']['config']['mongos']['systemLog']['logAppend'] = true # default : false
default['mongodb3']['config']['mongos']['systemLog']['destination'] = 'file' # default : 'file'

mongos-only Options

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

default['mongodb3']['config']['mongos']['replication']['localPingThresholdMs'] = nil # default : 15
default['mongodb3']['config']['mongos']['sharding']['autoSplit'] = true # default : true
default['mongodb3']['config']['mongos']['sharding']['configDB'] = nil
default['mongodb3']['config']['mongos']['sharding']['chunkSize'] = 64 # default : 64

MMS Automation/Monitoring Agent

Common configuration attributes for both automation and monitoring agent.

default['mongodb3']['config']['mms']['mmsApiKey'] = nil
default['mongodb3']['config']['mms']['mmsBaseUrl'] = 'https://api-agents.mongodb.com'
default['mongodb3']['config']['mms']['httpProxy'] = nil
default['mongodb3']['config']['mms']['krb5ConfigLocation'] = nil
default['mongodb3']['config']['mms']['sslTrustedMMSServerCertificate'] = nil
default['mongodb3']['config']['mms']['sslRequireValidMMSServerCertificates'] = nil

Attributes for automation agent.

https://docs.opsmanager.mongodb.com/current/reference/automation-agent

default['mongodb3']['config']['mms']['mmsGroupId'] = nil
default['mongodb3']['config']['mms']['logFile'] = '/var/log/mongodb-mms-automation/automation-agent.log'
default['mongodb3']['config']['mms']['mmsConfigBackup'] = '/var/lib/mongodb-mms-automation/mms-cluster-config-backup.json'
default['mongodb3']['config']['mms']['logLevel'] = 'INFO'
default['mongodb3']['config']['mms']['maxLogFiles'] = 10
default['mongodb3']['config']['mms']['maxLogFileSize'] = 268435456

Attributes for monitoring agent.

https://docs.opsmanager.mongodb.com/current/reference/monitoring-agent

default['mongodb3']['config']['mms']['useSslForAllConnections'] = nil
default['mongodb3']['config']['mms']['sslClientCertificate'] = nil
default['mongodb3']['config']['mms']['sslClientCertificatePassword'] = nil
default['mongodb3']['config']['mms']['sslTrustedServerCertificates'] = nil
default['mongodb3']['config']['mms']['sslRequireValidServerCertificates'] = nil
default['mongodb3']['config']['mms']['krb5Principal'] = nil
default['mongodb3']['config']['mms']['krb5Keytab'] = nil
default['mongodb3']['config']['mms']['gsappiServiceName'] = nil
default['mongodb3']['config']['mms']['enableMunin'] = nil

Usage

mongodb3::default

Install and configure the mongod or config server instance.

Include mongodb3::default in your node's run_list:

{
  "run_list": [
    "recipe[mongodb3::default]"
  ]
}

mongodb3::mongos

Install and configure the mongos.

Include mongodb3::mongos in your node's run_list:

{
  "run_list": [
    "recipe[mongodb3::mongos]"
  ]
}

mongodb3::mms_automation_agent

Install the MMS Automation Agent.

Include mongodb3::mms_automation_agent in your node's run_list:

{
  "run_list": [
    "recipe[mongodb3::mms_automation_agent]"
  ]
}

mongodb3::mms_monitoring_agent

Install the MMS Monitoring Agent.

Include mongodb3::mms_monitoring_agent in your node's run_list:

{
  "run_list": [
    "recipe[mongodb3::mms_monitoring_agent]"
  ]
}

Examples

Default mongod.conf file contents

Simply mongodb3::default recipe with none of additional attribute setting

{
  "run_list": [
    "recipe[mongodb3::default]"
  ]
}

Result of mongod.conf

# THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.
---
systemLog:
  path: /var/log/mongodb/mongod.log
  logAppend: true
  destination: file
net:
  port: 27017
security:
  authorization: disabled
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
  engine: mmapv1

Replicaset

Role file

You can set the config attribute on node or wrapper recipe.

{
  "name": "replica",
  "description": "Role for Replica set",
  "json_class": "Chef::Role",
  "default_attributes": {
    "mongodb3" : {
      "config" : {
        "mongod" : {
          "replication" : {
            "replSetName" : "replset-1"
          }
        }
      }
    }
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[mongodb3::default]"
  ],
  "env_run_lists": {
  }
}

Result of mongod.conf

# THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.
---
systemLog:
  path: /var/log/mongodb/mongod.log
  logAppend: true
  destination: file
net:
  port: 27017
security:
  authorization: disabled
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
  engine: mmapv1
replication:
  replSetName: replset-1

Config server

Role file

You can set the config attribute on node or wrapper recipe.

{
  "name": "configsvr",
  "description": "Role for MongoDB Config server",
  "json_class": "Chef::Role",
  "default_attributes": {
    "mongodb3": {
      "config" : {
        "mongod" : {
          "net" : {
            "port" : 27019
          },
          "sharding" : {
            "clusterRole" : "configsvr"
          }
        }
      }
    }
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[mongodb3::default]"
  ],
  "env_run_lists": {
  }
}

Result of mongod.conf

# THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.
---
systemLog:
  path: /var/log/mongodb/mongod.log
  logAppend: true
  destination: file
net:
  port: 27019
security:
  authorization: disabled
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
  engine: mmapv1
sharding:
  clusterRole: configsvr

WiredTiger storage engine config

Role file

You can set the config attribute on node or wrapper recipe.

{
  "name": "wired_tiger",
  "description": "Role for testing Wired Tiger storage engine",
  "json_class": "Chef::Role",
  "default_attributes": {
    "mongodb3" : {
      "config" : {
        "mongod" : {
          "storage" : {
            "dbPath" : "/var/lib/mongodb/wiredTiger",
            "engine" : "wiredTiger",
            "wiredTiger" : {
              "engineConfig" : {
                "cacheSizeGB" : 10,
                "statisticsLogDelaySecs" : 60,
                "journalCompressor" : "snappy",
                "directoryForIndexes" : false
              },
              "collectionConfig" : {
                "blockCompressor" : "snappy"
              },
              "indexConfig" : {
                "prefixCompression" : true
              }
            }
          }
        }
      }
    }
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[mongodb3::default]"
  ],
  "env_run_lists": {
  }
}

Result of mongod.conf

# THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.
---
systemLog:
  path: /var/log/mongodb/mongod.log
  logAppend: true
  destination: file
net:
  port: 27017
security:
  authorization: disabled
storage:
  dbPath: /var/lib/mongodb/wiredTiger
  journal:
    enabled: true
  engine: wiredTiger
  wiredTiger:
    engineConfig:
      cacheSizeGB: 10
      statisticsLogDelaySecs: 60
      journalCompressor: snappy
      directoryForIndexes: false
    collectionConfig:
      blockCompressor: snappy
    indexConfig:
      prefixCompression: true

Mongos

Role file

You can set the config attribute on node or wrapper recipe.

{
  "name": "mongos",
  "description": "Role for Mongos",
  "json_class": "Chef::Role",
  "default_attributes": {
    "mongodb3" : {
      "config" : {
        "mongos" : {
          "sharding" : {
            "configDB" : "configsvr1:27019, configsvr2:27019, configsvr3:27019"
          }
        }
      }
    }
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[mongodb3::mongos]"
  ],
  "env_run_lists": {
  }
}

Result of mongos.conf

# THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.
---
net:
  port: 27017
  bindIp: 0.0.0.0
systemLog:
  path: /var/log/mongodb/mongos.log
  logAppend: true
  destination: file
sharding:
  autoSplit: true
  configDB: configsvr1:27019, configsvr2:27019, configsvr3:27019
  chunkSize: 64

MMS Automation agent

Role file

You can set the config attribute on node or wrapper recipe.

{
  "name": "mms_automation_agent",
  "description": "Role for MMS automation agent",
  "json_class": "Chef::Role",
  "default_attributes": {
    "mongodb3" : {
      "config" : {
        "mms" : {
          "mmsGroupId" : "grpgrpididid",
          "mmsApiKey" : "apikeykekekekeke"
        }
      }
    }
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[mongodb3::mms_automation_agent]"
  ],
  "env_run_lists": {
  }
}

Result of /etc/mongodb-mms/automation-agent.config

# /etc/mongodb-mms/automation-agent.config

#
# REQUIRED
# Enter your Group ID - It can be found at https://cloud.mongodb.com/settings/group
#
mmsGroupId=grpgrpididid

#
# REQUIRED
# Enter your API key - It can be found at https://cloud.mongodb.com/settings/group
#
mmsApiKey=apikeykekekekeke

#
# Base url of the MMS web server.
#
mmsBaseUrl=https://api-agents.mongodb.com

#
# Path to log file
#
logFile=/var/log/mongodb-mms-automation/automation-agent.log

#
# Path to backup cluster config to
#
mmsConfigBackup=/var/lib/mongodb-mms-automation/mms-cluster-config-backup.json

#
# Lowest log level to log.  Can be (in order): DEBUG, ROUTINE, INFO, WARN, ERROR, DOOM
#
logLevel=INFO

#
# Maximum number of rotated log files
#
maxLogFiles=10

#
# Maximum size in bytes of a log file (before rotating)
#
maxLogFileSize=268435456

#
# URL to proxy all HTTP requests through
#
#httpProxy=

#
# The absolute path to an non-system-standard location for the Kerberos configuration file
#
#krb5ConfigLocation=

#
# The path on disk that contains the trusted certificate authority certificates in PEM format.
#
#sslTrustedMMSServerCertificate=

#
# Use this option to disable certificate verification by setting this value to false.
#
#sslRequireValidMMSServerCertificates=

# For additional optional settings, please see
# https://docs.cloud.mongodb.com/reference/automation-agent/


MMS Monitoring agent

Role file

You can set the config attribute on node or wrapper recipe.

{
  "name": "mms_monitoring_agent",
  "description": "Role for MMS monitoring agent",
  "json_class": "Chef::Role",
  "default_attributes": {
    "mongodb3" : {
      "config" : {
        "mms" : {
          "api_key" : "apikeykekekekeke"
        }
      }
    }
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[mongodb3::mms_monitoring_agent]"
  ],
  "env_run_lists": {
  }
}

Result of /etc/mongodb-mms/monitoring-agent.config

# THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.

#
# Enter your API key  - See: cloud.mongodb.com/settings/group
#
mmsApiKey=apikeykekekekeke

#
# Hostname of the MMS monitoring web server.
#
mmsBaseUrl=https://api-agents.mongodb.com

#
# URL to proxy all HTTP requests through
#
#httpProxy=

#
# Set to true to enable SSL support globally and to use SSL for all MongoDB connections.
#
#useSslForAllConnections=

#
# The path to the private key, client certificate, and optional intermediate certificates in PEM format
#
#sslClientCertificate=

#
# The password needed to decrypt the private key in the file specified in sslClientCertificate.
#
#sslClientCertificatePassword=

#
# The path on disk that contains the trusted certificate authority certificates in PEM format.
#
#sslTrustedServerCertificates=

#
# Use this option to disable certificate verification by setting this value to false.
#
#sslRequireValidServerCertificates=

#
# The Kerberos principal used by the agent.
#
#krb5Principal=

#
# The absolute path to Kerberos principal’s keytab file.
#
#krb5Keytab=

#
# The absolute path to an non-system-standard location for the Kerberos configuration file.
#
#krb5ConfigLocation=

#
# The default service name used by MongoDB is mongodb can specify a custom service name with the gssapiServiceName option.
#
#gsappiServiceName=

#
# By default the Monitoring Agent will use the trusted root CAs installed on the system. If the agent cannot find the trusted root CAs, configure these settings manually.
#
#sslTrustedMMSServerCertificate=

#
# You can disable certificate verification by setting this value to false.
#
#sslRequireValidMMSServerCertificates=

#
# Set to false if you do not with the Monitoring Agent to collect hardware statistics via Munin-node.
#
#enableMunin=


# For additional optional settings, please see
# https://docs.cloud.mongodb.com/reference/monitoring-agent/

License and Authors

Author:: Sunggun Yu ([email protected])

Copyright (c) 2016, Sunggun Yu.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

chef-mongodb3's People

Contributors

dblock avatar dherges avatar dpattmann avatar drazzib avatar gottaloveit avatar jolcese avatar jperville avatar mskurski avatar popsikle avatar sunggun-yu 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  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-mongodb3's Issues

Mongodb configuration file generation

The helper for the mongodb configuration template fails to delete the null values and update the hash, as the object being received by it is of type ImmuatableMash.

Is there option not to restart mongod when there is config change ?

Question rather than issue :
We hade made default.rb where we are modifying values

cat default.rb

node.default['mongodb3']['version'] = '3.2.8'
node.default['mongodb3']['package']['version'] = '3.2.8'
....

Is there any such option we can put here so that when there is config change, we don't want to restart mongodb server process. By default action is restart.

Cookbook installation fails with service unable to restart

I have tried it both on a chef client and with vagrant, in both the cases the same error pops up. Although mongo is installed after this and I am able to run mongodb, but when running first time on any node it gives following error. Any solutions for this?
I am trying on CENTOS7.

==> default:     - restore selinux security context
==> default: 
==> default: 
==> default:   * service[mongod] action enable
==> default:  (up to date)
==> default: [2016-01-18T11:51:40+00:00] INFO: [template[/etc/mongod.conf]] sending restart action to service[mongod] (delayed)
==> default:   * service[mongod] action restart
==> default: 
==> default:     
==> default:     ================================================================================
==> default:     Error executing action `restart` on resource 'service[mongod]'
==> default:     ================================================================================
==> default:     
==> default:     Mixlib::ShellOut::ShellCommandFailed
==> default:     ------------------------------------
==> default:     Expected process to exit with [0], but received '1'
==> default:     ---- Begin output of /sbin/service mongod restart ----
==> default:     STDOUT: Restarting mongod (via systemctl):  [FAILED]
==> default:     STDERR: Job for mongod.service failed because a timeout was exceeded. See "systemctl status mongod.service" and "journalctl -xe" for details.
==> default:     ---- End output of /sbin/service mongod restart ----
==> default:     Ran /sbin/service mongod restart returned 1
==> default:     
==> default:     Resource Declaration:
==> default:     ---------------------
==> default:     # In /tmp/vagrant-chef/da638a2947ff0fd9cfc67f8fb5e370d9/cookbooks/mongodb3/recipes/default.rb
==> default:     
==> default:      63: service 'mongod' do
==> default:      64:   supports :start => true, :stop => true, :restart => true, :status => true
==> default:      65:   action :enable
==> default:      66:   subscribes :restart, "template[#{node['mongodb3']['mongod']['config_file']}]", :delayed
==> default:      67:   subscribes :restart, "template[#{node['mongodb3']['config']['mongod']['security']['keyFile']}", :delayed
==> default:      68: end
==> default:     
==> default:     Compiled Resource:
==> default:     ------------------
==> default:     # Declared in /tmp/vagrant-chef/da638a2947ff0fd9cfc67f8fb5e370d9/cookbooks/mongodb3/recipes/default.rb:63:in `from_file'
==> default:     
==> default:     service("mongod") do
==> default:       action [:enable]
==> default:       supports {:start=>true, :stop=>true, :restart=>true, :status=>true}
==> default:       retries 0
==> default:       retry_delay 2
==> default:       default_guard_interpreter :default
==> default:       service_name "mongod"
==> default:       enabled true
==> default:       pattern "mongod"
==> default:       declared_type :service
==> default:       cookbook_name :mongodb3
==> default:       recipe_name "default"
==> default:     end
==> default:     
==> default: 
==> default: 
==> default: Running handlers:
==> default: [2016-01-18T11:56:40+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2016-01-18T11:56:40+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 9 resources updated in 09 minutes 28 seconds
==> default: [2016-01-18T11:56:40+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2016-01-18T11:56:40+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2016-01-18T11:56:40+00:00] ERROR: service[mongod] (mongodb3::default line 63) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
==> default: ---- Begin output of /sbin/service mongod restart ----
==> default: STDOUT: Restarting mongod (via systemctl):  [FAILED]
==> default: STDERR: Job for mongod.service failed because a timeout was exceeded. See "systemctl status mongod.service" and "journalctl -xe" for details.
==> default: ---- End output of /sbin/service mongod restart ----
==> default: Ran /sbin/service mongod restart returned 1
==> default: [2016-01-18T11:56:40+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

how to boot up mongodb with option?

what is a good way to boot up mongodb with option? default boot up way as following:

/usr/bin/mongod --config /etc/mongod.conf

any idea? thx

mongo 3.4?

I've specified this line on my mongodb.rb recipe:

node.default['mongodb']['package_version'] = '3.4'

include_recipe 'mongodb3::default'

Nevertheless, a 3.2.x version is installed on ghest machine.

Do I need to specify anything more?

Installing Mongo Enterprise edition via the cookbook

I am not sure it is possible to install mongodb enterprise edition with this cookbook (I couldn't get it to work using the configuration instructions provided).

Could you please confirm here or at least acknowledge it on the documentation?

Cookbook not compatible with Chef Client version 13 or 14

Now that Chef Client 12 is EOL, the cookbook needs to be updated to use the newer versions, 13 & 14.

This is the error we are seeing

NoMethodError

undefined method `platform_version' for #Chef::Node::Attribute:0x0000000004d48588

Cookbook Trace:

/var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:26:in from_file' /var/chef/cache/cookbooks/mongodb3/recipes/default.rb:20:in from_file'
/var/chef/cache/cookbooks/dc_dr_mongodb/recipes/install.rb:17:in from_file' /var/chef/cache/cookbooks/dc_dr_mongodb/recipes/default.rb:5:in from_file'

Relevant File Content:

/var/chef/cache/cookbooks/mongodb3/recipes/package_repo.rb:

19:
20: pkg_major_version = node['mongodb3']['version'].to_f # eg. 3.0, 3.2
21:
22: # Setup default package version attribute to install
23: pkg_version = node['mongodb3']['version']
24: case node['platform_family']
25: when 'rhel', 'fedora'
26>> pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
27: if node['platform'] == 'amazon'
28: pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019
29: end
30: end
31:
32: # Setup default package repo url attribute for each platform family or platform
33: case node['platform']
34: when 'redhat', 'oracle','centos', 'fedora' # FC024
35: pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/#{pkg_major_version}/#{node['kernel']['machine'] =
/x86_64/ ? 'x86_64' : 'i686'}"

add ability to pre configure admin user

when enabling authentication , can not login without a user, so allow config from chef the default admin user and password much like mongodb cookbook allow.

MMS api key stored plain text

The MMS api key in the node['mongodb3']['config']['mms']['mmsApiKey'] attribute is stored plain text currently and any chef node has access to this. It poses a potential security risk.

Possible solutions:

  • Encrypted data bag (Solved in #7)
  • Chef Vault

Other thoughts on non-plain text options?

Hardcoded to an unavailable deb version; apt dist should be attribute or computed

distribution "#{node['lsb']['codename']}/mongodb-org/stable"
hardcodes distribution to '/stable' which has moved on to the '3.2'

A resource override like this works around:

include_recipe 'mongodb3'
resources('apt_repository[mongodb]').distribution("#{node['lsb']['codename']}/mongodb-org/3.0")

but it would be better for the dist to just be computer on minor version number (see directory listing at http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/ ), or at least explicitly an attribute of this cookbook

Should run Integration test with kitchen-dokken

Hi Sunggun-yu,

I've been using your cookbook. I like it.

I think it's better that we do the Integration test for it. The community is running Integration test with kitchen-dokken for e.g 'chef-cookbooks/jenkins'.

I can do the PR for it, if you want. 😄

Automatic replica set configuration

Hello,

First, thanks for creating this cookbook! It is evident that you put a lot of effort into making this and it is a tremendous help to the community to have a working cookbook that supports mongo 3 with lots of configuration options being manageable through chef. The only other cookbook I've had similar success with is the original edelight mongodb-cookbook which has now been taken over by chef-brigade: https://github.com/chef-brigade/mongodb-cookbook . They are also working on adding mongo 3 support, but not quite there yet as their cookbook is a bit more complex.

One thing that would be really nice to have is automatic configuration of the replica set using chef search to identify other nodes using the same replica set name and having chef run the appropriate commands to configure the cluster. The cookbook I linked above does this using the mongo ruby gem to connect to mongo during convergence and automatically reconfigures the cluster based on what it finds in chef server's own database.

Currently, with your cookbook, replica set configuration seems to be accomplished by manually running the appropriate rs.initiate() and rs.add() commands. Alternatively since you support MMS automation agent, one can plug in to that system to leverage the features provided by MMS to manage the replica set. However, if one did not wish to use MMS but desired to use mongo 3, the only option seems to be manual configuration.

Are you planning to add automatic replica set configuration in the near future? I would switch to using your cookbook exclusively if this was possible.

What other features are planned?

Great work so far, thanks again.

log directory not created in recipes/default.rb

recipes/mongos.rb has these lines:

# Create the log directory
directory File.dirname(node['mongodb3']['config']['mongos']['systemLog']['path']).to_s do
  owner node['mongodb3']['user']
  action :create
  recursive true
end

recipes/default.rb does not and if the directory does not exist, the service won't start.

ubuntu 14.4 + chef 11.10 (<12) ==> No such file or directory - /etc/init.d/mongod

Launching the service fails, because mongod 3.2.1 in ubuntu is an upstart service, but chef < 12 defaults to init.d for ubuntu 14.4.

Here is the relevant Chef stacktrace part:

================================================================================
Error executing action `restart` on resource 'service[mongod]'
================================================================================


Errno::ENOENT
-------------
No such file or directory - /etc/init.d/mongod


Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/recipes/default.rb

72: service 'mongod' do
73:   supports :start => true, :stop => true, :restart => true, :status => true
74:   action :enable
75:   subscribes :restart, "template[#{node['mongodb3']['mongod']['config_file']}]", :delayed
76:   subscribes :restart, "template[#{node['mongodb3']['config']['mongod']['security']['keyFile']}", :delayed
77: end



Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/recipes/default.rb:72:in `from_file'

service("mongod") do
action [:enable]
supports {:start=>true, :stop=>true, :restart=>true, :status=>true}
retries 0
retry_delay 2
service_name "mongod"
pattern "mongod"
cookbook_name "mongodb3"
recipe_name "default"
end

This is pretty analogous to https://bugs.launchpad.net/openstack-chef/+bug/1313646
Would you consider to fix this here or at least document this incompatibilty?

RuntimeError: File files/default/15update-stamp does not exist for cookbook apt

dev_ops_database/recipes/default.rb

include_recipe 'mongodb3::default'

standard out

root@vagrant:/vagrant/tools/vagrant# ./provision.sh
running as root
Resolving cookbook dependencies...
Fetching 'dev_ops_database' from source at .
Fetching cookbook index from https://supermarket.chef.io...
Using apt (2.7.0)
Using dev_ops_database (0.1.0) from source at .
Installing mongodb3 (1.0.0)
Using packagecloud (0.0.19)
Installing runit (1.6.0)
Installing user (0.4.2)
Using yum (3.6.3)
Resolving cookbook dependencies...
Fetching 'dev_ops_web_app' from source at .
Using dev_ops_web_app (0.1.0) from source at .
Using java (1.31.0)
Starting Chef Client, version 12.3.0
Compiling Cookbooks...
Converging 19 resources
Recipe: mongodb3::package_repo
  * apt_repository[mongodb] action add
    * execute[install-key 7F0CEB10] action run
      - execute apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
    * file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing)
    * execute[apt-cache gencaches] action nothing (skipped due to action :nothing)
    * execute[apt-get update] action nothing (skipped due to action :nothing)
    * file[/etc/apt/sources.list.d/mongodb.list] action create
      - create new file /etc/apt/sources.list.d/mongodb.list
      - update content in file /etc/apt/sources.list.d/mongodb.list from none to 2d7617
      --- /etc/apt/sources.list.d/mongodb.list  2015-07-24 13:36:37.810019537 +0000
      +++ /etc/apt/sources.list.d/.mongodb.list20150724-6698-czngoi     2015-07-24 13:36:37.810019537 +0000
      @@ -1 +1,2 @@
      +deb     http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/stable multiverse
      - change mode from '' to '0644'
      - change owner from '' to 'root'
      - change group from '' to 'root'
    * file[/var/lib/apt/periodic/update-success-stamp] action delete
      - delete file /var/lib/apt/periodic/update-success-stamp
    * execute[apt-get update] action run
      - execute apt-get update -o Dir::Etc::sourcelist='sources.list.d/mongodb.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'
  Recipe: apt::default
    * file[/var/lib/apt/periodic/update-success-stamp] action touch
      - update utime on file /var/lib/apt/periodic/update-success-stamp
    * execute[apt-cache gencaches] action run
      - execute apt-cache gencaches

  * file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing)
  * directory[/etc/apt/apt.conf.d] action create (up to date)
  * cookbook_file[/etc/apt/apt.conf.d/15update-stamp] action create

    ================================================================================
    Error executing action `create` on resource 'cookbook_file[/etc/apt/apt.conf.d/15update-stamp]'
    ================================================================================

    RuntimeError
    ------------
    File files/default/15update-stamp does not exist for cookbook apt

    Resource Declaration:
    ---------------------
    # In /root/.berkshelf/cookbooks/apt-2.7.0/recipes/default.rb

     57: cookbook_file '/etc/apt/apt.conf.d/15update-stamp' do
     58:   source '15update-stamp'
     59: end
     60:

    Compiled Resource:
    ------------------
    # Declared in /root/.berkshelf/cookbooks/apt-2.7.0/recipes/default.rb:57:in `from_file'

    cookbook_file("/etc/apt/apt.conf.d/15update-stamp") do
      provider Chef::Provider::CookbookFile
      action "create"
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      path "/etc/apt/apt.conf.d/15update-stamp"
      backup 5
      atomic_update true
      source "15update-stamp"
      declared_type :cookbook_file
      cookbook_name :apt
      recipe_name "default"
    end

ssl values should be configurable

Can you please add support for configuration of the following attributes:
sslTrustedMMSServerCertificate, sslRequireValidMMSServerCertificates

Thanks,
Mehdi

Chef::Mixin::Template::TemplateError: (Node attributes are read-only when you do not specify which precedence level to set.

Been trying to figure this one out for a while, at no avail. Help please?

Amazon Linux 2015.09
Chef 11.10

I don't have any custom cookbooks and couldn't find anything assigning anything without a proper set or default.

[2016-01-14T00:13:51+00:00] INFO: Processing template[/etc/mongod.conf] action create (mongodb3::default line 53)

================================================================================
Error executing action `create` on resource 'template[/etc/mongod.conf]'
================================================================================


Chef::Mixin::Template::TemplateError
------------------------------------
Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'


Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/recipes/default.rb

53: template node['mongodb3']['mongod']['config_file'] do
54:   source 'mongodb.conf.erb'
55:   mode 0644
56:   variables(
57:       :config => node['mongodb3']['config']['mongod']
58:   )
59:   helpers Mongodb3Helper
60: end
61: 



Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/recipes/default.rb:53:in `from_file'

template("/etc/mongod.conf") do
provider Chef::Provider::Template
action "create"
retries 0
retry_delay 2
path "/etc/mongod.conf"
backup 5
atomic_update true
source "mongodb.conf.erb"
variables {:config=>{"systemLog"=>{"verbosity"=>nil, "quiet"=>nil, "traceAllException"=>nil, "syslogFacility"=>nil, "path"=>"/var/log/mongodb/mongod.log", "logAppend"=>true, "logRotate"=>nil, "destination"=>"file", "timeStampFormat"=>nil, "component"=>{"accessControl"=>{"verbosity"=>nil}, "command"=>{"verbosity"=>nil}, "control"=>{"verbosity"=>nil}, "geo"=>{"verbosity"=>nil}, "index"=>{"verbosity"=>nil}, "network"=>{"verbosity"=>nil}, "query"=>{"verbosity"=>nil}, "replication"=>{"verbosity"=>nil}, "sharding"=>{"verbosity"=>nil}, "storage"=>{"verbosity"=>nil, "journal"=>{"verbosity"=>nil}}, "write"=>{"verbosity"=>nil}}}, "processManagement"=>{"fork"=>true, "pidFilePath"=>"/var/run/mongodb/mongodb.pid"}, "net"=>{"port"=>27017, "bindIp"=>nil, "maxIncomingConnections"=>nil, "wireObjectCheck"=>nil, "ipv6"=>nil, "unixDomainSocket"=>{"enabled"=>nil, "pathPrefix"=>nil, "filePermissions"=>nil}, "http"=>{"enabled"=>nil, "JSONPEnabled"=>nil, "RESTInterfaceEnabled"=>nil}, "ssl"=>{"mode"=>nil, "PEMKeyFile"=>nil, "PEMKeyPassword"=>nil, "clusterFile"=>nil, "clusterPassword"=>nil, "CAFile"=>nil, "CRLFile"=>nil, "allowConnectionsWithoutCertificates"=>nil, "allowInvalidCertificates"=>nil, "allowInvalidHostnames"=>nil, "FIPSMode"=>nil}}, "security"=>{"keyFile"=>nil, "clusterAuthMode"=>nil, "authorization"=>"disabled", "javascriptEnabled"=>nil, "sasl"=>{"hostName"=>nil, "serviceName"=>nil, "saslauthdSocketPath"=>nil}}, "storage"=>{"dbPath"=>"/var/lib/mongo", "indexBuildRetry"=>nil, "repairPath"=>nil, "journal"=>{"enabled"=>true}, "directoryPerDB"=>nil, "syncPeriodSecs"=>nil, "engine"=>"wiredTiger", "mmapv1"=>{"preallocDataFiles"=>nil, "nsSize"=>nil, "quota"=>{"enforced"=>nil, "maxFilesPerDB"=>nil}, "smallFiles"=>nil, "journal"=>{"debugFlags"=>nil, "commitIntervalMs"=>nil}}, "wiredTiger"=>{"engineConfig"=>{"cacheSizeGB"=>nil, "statisticsLogDelaySecs"=>nil, "journalCompressor"=>nil, "directoryForIndexes"=>nil}, "collectionConfig"=>{"blockCompressor"=>nil}, "indexConfig"=>{"prefixCompression"=>nil}}}, "operationProfiling"=>{"slowOpThresholdMs"=>nil, "mode"=>nil}, "replication"=>{"oplogSizeMB"=>nil, "replSetName"=>nil, "secondaryIndexPrefetch"=>nil}, "sharding"=>{"clusterRole"=>nil, "archiveMovedChunks"=>nil}, "auditLog"=>{"destination"=>nil, "format"=>nil, "path"=>nil, "filter"=>nil}, "snmp"=>{"subagent"=>nil, "master"=>nil}}}
helper_modules [Mongodb3Helper]
cookbook_name "mongodb3"
recipe_name "default"
mode 420
end



Template Context:
-----------------
on line #2
1: # THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.
2: <%= mongodb_config @config%>


[2016-01-14T00:13:51+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-01-14T00:13:51+00:00] INFO: template[/etc/redis/6379.conf] sending restart action to service[redis] (delayed)
[2016-01-14T00:13:51+00:00] INFO: Processing service[redis] action restart (redis::default line 86)
[2016-01-14T00:13:53+00:00] INFO: service[redis] restarted
[2016-01-14T00:13:53+00:00] ERROR: Running exception handlers
[2016-01-14T00:13:53+00:00] ERROR: Exception handlers complete
[2016-01-14T00:13:53+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out
[2016-01-14T00:13:53+00:00] ERROR: 

Chef::Mixin::Template::TemplateError (Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"') on line #2:

1: # THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.
2: <%= mongodb_config @config%>

/opt/aws/opsworks/releases/20151222151215_3431-20151222151215/vendor/bundle/ruby/2.0.0/gems/chef-11.10.4/lib/chef/node/immutable_collections.rb:146:in `delete_if'
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/libraries/mongodb3_helper.rb:12:in `compact'
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/libraries/mongodb3_helper.rb:12:in `block in compact'
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/libraries/mongodb3_helper.rb:12:in `delete_if'
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/libraries/mongodb3_helper.rb:12:in `compact'
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/libraries/mongodb3_helper.rb:5:in `mongodb_config'
(erubis):2:in `block in evaluate'

start mongodb immediately

Please (re)start the mongodb process immediately.

in my pattern, mongodb installs correctly and started, afer the rollout of my configuration, the mongodb restarts.
but, at this time, the mongodb handle already connections.

Issue with updates on U14.04

Chef runs fail due to the conffile prompt. I can create an override in /etc/apt/apt.conf.d/local- like what is mentioned here ( https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/ ) -but that seems overkill and potentially troublesome. The Cookbook defaults to 3.0.4 currently but 3.0.7 is the latest as of today. It seems that the Cookbook's apt-get command has the correct parameters:
"apt-get -q -y install mongodb-org-shell=3.0.7"

Any ideas on how to handle this?

Thanks for a great Cookbook!

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.