Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add commandline options when starting mongodb

Change-Id: I754c11a829ffee5223539588c5077c4f4b473be8
  • Loading branch information...
commit d644e04e27d30daf4b7e7fd1bab2479ce201709b 1 parent fb222c0
Harshawardhan Gadgil authored
View
2  mongodb/bin/mongodb_node
@@ -31,7 +31,7 @@ class VCAP::Services::MongoDB::NodeBin < VCAP::Services::Base::NodeBin
options[:supported_versions] = parse_property(config, "supported_versions", Array)
options[:default_version] = parse_property(config, "default_version", String)
-
+ options[:mongod_options] = parse_property(config, "mongod_options", Hash)
options
end
View
3  mongodb/config/mongodb_node.yml
@@ -20,6 +20,9 @@ mongod_path:
mongorestore_path:
"1.8": "mongorestore"
+mongod_options:
+ "1.8": ""
+
port_range:
first: 25001
last: 45000
View
10 mongodb/lib/mongodb_service/mongodb_node.rb
@@ -95,6 +95,7 @@ def initialize(options)
@base_dir = options[:base_dir]
FileUtils.mkdir_p(@base_dir)
@mongod_path = options[:mongod_path]
+ @mongod_options = options[:mongod_options]
@mongorestore_path = options[:mongorestore_path]
@mongod_log_dir = options[:mongod_log_dir]
@@ -637,6 +638,7 @@ def start_instance(provisioned_service)
config_path = File.join(dir, "mongodb.conf")
executable = mongod_exe_path(get_version(provisioned_service))
+ options = mongod_exe_options(get_version(provisioned_service))
FileUtils.mkdir_p(dir)
FileUtils.mkdir_p(data_dir)
@@ -644,8 +646,8 @@ def start_instance(provisioned_service)
FileUtils.rm_f(config_path)
File.open(config_path, "w") {|f| f.write(config)}
- @logger.debug("Mongo Executable: #{executable}")
- cmd = "#{executable} -f #{config_path}"
+ @logger.debug("Mongo Executable: #{executable}, Options: #{options}")
+ cmd = "#{executable} #{options} -f #{config_path}"
close_fds
@@ -791,6 +793,10 @@ def mongod_exe_path(version)
@mongod_path[version]
end
+ def mongod_exe_options(version)
+ @mongod_options[version]
+ end
+
def mongorestore_exe_path(version)
@mongorestore_path[version]
end
View
1  mongodb/spec/spec_helper.rb
@@ -124,6 +124,7 @@ def get_node_config()
:plan => parse_property(config, "plan", String),
:capacity => parse_property(config, "capacity", Integer),
:mongod_path => parse_property(config, "mongod_path", Hash),
+ :mongod_options => parse_property(config, "mongod_options", Hash),
:mongorestore_path => parse_property(config, "mongorestore_path", Hash),
:ip_route => parse_property(config, "ip_route", String, :optional => true),
:node_id => parse_property(config, "node_id", String),
Please sign in to comment.
Something went wrong with that request. Please try again.