Allow a user to disable MongoDB journaling
authorYanis Guenane <yanis.guenane@enovance.com>
Mon, 13 Jul 2015 07:12:51 +0000 (09:12 +0200)
committerYanis Guenane <yguenane@redhat.com>
Mon, 13 Jul 2015 08:29:38 +0000 (10:29 +0200)
By default MongoDB enables a journaling system that prevents loss of
data in case of an unexpected shut-down. When journaling is enabled,
MongoDB will create the journal files before actually starting the
daemon[1].

The journaling feature is useful in production environment, but not
really on a CI-like system, where we only want to make sure MongoDB is
setup correctly and running, hence here we allow a user to
enable/disable MongoDB journaling.

[1] http://docs.mongodb.org/manual/core/journaling/

Change-Id: I0e4e65af9f650c10fdf5155ff709b4eb984cf4e1
Closes-bug: #1468246

controller.yaml
environments/mongodb-nojournal.yaml [new file with mode: 0644]
overcloud-without-mergepy.yaml
puppet/controller-puppet.yaml
puppet/hieradata/controller.yaml

index a22bb83..3990c0a 100644 (file)
@@ -365,6 +365,10 @@ parameters:
     description: The password for the nova service and db account, used by nova-api.
     type: string
     hidden: true
+  MongoDbNoJournal:
+    default: false
+    description: Should MongoDb journaling be disabled
+    type: boolean
   NtpServer:
     type: string
     default: ''
@@ -673,6 +677,8 @@ resources:
           host: {get_input: controller_virtual_ip}
           metadata-proxy: true
           service-password: {get_input: nova_password}
+        mongodb:
+          nojournal: {get_input: mongodb_no_journal}
         rabbit:
           host: {get_input: controller_virtual_ip}
           username: {get_input: rabbit_username}
@@ -868,6 +874,7 @@ resources:
               - '@'
               - {get_param: VirtualIP}
               - '/keystone'
+        mongodb_no_journal: {get_param: MongoDbNoJournal}
         mysql_innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize}
         mysql_root_password: {get_param: MysqlRootPassword}
         mysql_cluster_name:
diff --git a/environments/mongodb-nojournal.yaml b/environments/mongodb-nojournal.yaml
new file mode 100644 (file)
index 0000000..1e13e45
--- /dev/null
@@ -0,0 +1,5 @@
+# A Heat environment file which can be used to disable journal in MongoDb.
+# Since, when journaling is enabled, MongoDb will create big journal file
+# it can take time. In a CI environment for example journaling is not necessary.
+parameters:
+  MongoDbNoJournal: true
index 4258fe0..8800238 100644 (file)
@@ -174,6 +174,10 @@ parameters:
   NtpServer:
     type: string
     default: ''
+  MongoDbNoJournal:
+    default: false
+    description: Should MongoDb journaling be disabled
+    type: boolean
   PublicVirtualFixedIPs:
     default: []
     description: >
@@ -757,6 +761,7 @@ resources:
           NeutronTunnelTypes: {get_param: NeutronTunnelTypes}
           NovaPassword: {get_param: NovaPassword}
           NtpServer: {get_param: NtpServer}
+          MongoDbNoJournal: {get_param: MongoDbNoJournal}
           PcsdPassword: {get_resource: PcsdPassword}
           PublicVirtualInterface: {get_param: PublicVirtualInterface}
           RabbitPassword: {get_param: RabbitPassword}
index 9f531ef..87880e1 100644 (file)
@@ -374,6 +374,10 @@ parameters:
     description: The password for the nova service and db account, used by nova-api.
     type: string
     hidden: true
+  MongoDbNoJournal:
+    default: false
+    description: Should MongoDb journaling be disabled
+    type: boolean
   NtpServer:
     type: string
     default: ''
@@ -768,6 +772,7 @@ resources:
         rabbit_cookie: {get_param: RabbitCookie}
         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
         rabbit_client_port: {get_param: RabbitClientPort}
+        mongodb_no_journal: {get_param: MongoDbNoJournal}
         ntp_servers:
           str_replace:
             template: '["server"]'
@@ -947,6 +952,7 @@ resources:
                 keystone::debug: {get_input: debug}
                 # MongoDB
                 mongodb::server::bind_ip: {get_input: mongo_db_network}
+                mongodb::server::nojournal: {get_input: mongodb_no_journal}
                 # MySQL
                 admin_password: {get_input: admin_password}
                 enable_galera: {get_input: enable_galera}
index 72c10c2..3cc6497 100644 (file)
@@ -22,6 +22,7 @@ rabbitmq_config_variables:
   cluster_partition_handling: 'pause_minority'
 
 mongodb::server::replset: tripleo
+mongodb::server::journal: false
 
 redis::port: 6379
 redis::sentinel::master_name: "%{hiera('bootstrap_nodeid')}"