Permalink
Browse files

add versions support for mongodb

bump pointer of src/{cloud_controller|services}

cloud_controller:

$ git shortlog b8386579..3bddfb30
felixhoo (1):
      [CC] Add default plan in service announcement

services:

$ git shortlog 7f530df67..b33ba3a8
Andrew Liu (3):
      versions support for mongodb lifecycle feature
      versions support for mongodb backup
      Merge "versions support for mongodb backup"

Chunjie (1):
      Update service_broker README doc.

Eagle Chen (1):
      Audit mysql long transactions

Figo Feng (1):
      Merge "Merge branch 'sversions'"

Harshawardhan Gadgil (10):
      Merge branch 'master' into 'sversions' branch
      Add optional version argument to provision      - Add default supported versions to all nodes
      Merge branch 'master' into sversions
      Update git ref pointers for vcap_common and vcap_services_base gems
      Update vcap-services-base gem to remove version check from async gateway
      Merge branch 'master' into sversions
      Multi version support for Mongodb
      Assign default version to existing services on startup
      Add commandline options when starting mongodb
      Merge branch 'sversions'

Yang Yang (1):
      fix Gemfile.lock dependency issue for couchdb

felixhoo (3):
      Keep unprovisioned instances backup for X days
      Merge "Keep unprovisioned instances backup for X days"
      Add default plan in service annoucement.

Change-Id: If635d6de7460ae9c532b62860917a02730d8b64f
  • Loading branch information...
1 parent 6b598b2 commit 097f00388e562cc94dd58ba529a456154701e308 @andl andl committed Jul 2, 2012
@@ -6,6 +6,10 @@ acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+# backward compatible, fallback to 1.8 if old manifest file can't supply supported versions
+supported_versions = properties.mongodb_gateway.supported_versions || ["1.8"]
+version_aliases = properties.mongodb_gateway.version_aliases
+version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases
nats = "nats://#{properties.nats.user}:#{properties.nats.password}@#{properties.nats.address}:#{properties.nats.port}"
lifecycle = properties.service_lifecycle
%>
@@ -44,6 +48,13 @@ service:
<% end %>
<% end %>
<% end %>
+ supported_versions: <%= "['#{supported_versions.join("' , '")}']" %>
+<% if version_aliases && !version_aliases.fields.empty? %>
+ version_aliases:
+ <% for version_alias in version_aliases.fields.each %>
+ <%= "'#{version_alias}': '#{version_aliases.send(version_alias.to_sym)}'" %>
+ <% end %>
+<% end %>
<% if gateway.ip_route %>
ip_route: <%= gateway.ip_route %>
View
@@ -19,7 +19,7 @@ templates:
packages:
- common
- mongodb_node
- - mongodb
+ - mongodb18
- ruby
- sqlite
- syslog_aggregator
@@ -5,11 +5,19 @@ plan_enabled = properties.service_plans && properties.service_plans.send(service
plan = properties.plan || "free"
plan_conf = plan_enabled && properties.service_plans.send(service.to_sym).send(plan.to_sym).configuration
backup_enabled = plan_enabled && plan_conf.backup && plan_conf.backup.enable
+# backward compatible, fallback to 1.8 if old manifest file can't supply supported versions
+supported_versions = properties.mongodb_node.supported_versions || ["1.8"]
+packages = {}
+# convention, package contains mongodb 1.8 is mongodb18
+supported_versions.each{|v| packages[v] = v.sub(".","")}
%>
service_name: mongodb
backup_base_dir: <%= properties.service_backup && properties.service_backup.mount_point || "/var/vcap/services_backup" %>
service_base_dir: /var/vcap/store/mongodb/instances
-mongodump_path: /var/vcap/packages/mongodb/bin/mongodump
+mongodump_path:
+<% for version in supported_versions %>
+ <%= "'#{version}': /var/vcap/packages/mongodb#{packages[version]}/bin/mongodump" %>
+<% end %>
logging:
level: debug
file: /var/vcap/sys/log/mongodb_node/mongodb_backup.log
@@ -4,6 +4,12 @@ service = "mongodb"
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan = properties.plan || "free"
plan_conf = plan_enabled && properties.service_plans.send(service.to_sym).send(plan.to_sym).configuration
+# backward compatible, fallback to 1.8 if old manifest file can't supply supported versions
+supported_versions = properties.mongodb_node.supported_versions || ["1.8"]
+default_version = properties.mongodb_node.default_version || "1.8"
+packages = {}
+# convention, package contains mongodb 1.8 is mongodb18
+supported_versions.each{|v| packages[v] = v.sub(".","")}
node = properties.mongodb_node
%>
capacity: <%= plan_enabled && plan_conf.capacity || 200 %>
@@ -22,12 +28,24 @@ pid: /var/vcap/sys/run/mongodb_node/mongodb_node.pid
node_id: <%= "#{service}_node#{'_' + plan if plan != 'free'}_#{spec.index.to_i + 1}" %>
max_clients: <%= plan_enabled && plan_conf.max_clients || 500 %>
quota_files: <%= plan_enabled && plan_conf.quota_files || 4 %>
-mongod_path: /var/vcap/packages/mongodb/bin/mongod
+supported_versions: <%= "['#{supported_versions.join("' , '")}']" %>
+default_version: <%= "'#{default_version}'"%>
+
+mongod_path:
+<% for version in supported_versions %>
+ <%= "'#{version}': /var/vcap/packages/mongodb#{packages[version]}/bin/mongod" %>
+<% end %>
+
+mongod_options:
+ "1.8": ""
port_range:
first: 25001
last: 45000
migration_nfs: <%= properties.service_migration && properties.service_migration.mount_point ? properties.service_migration.mount_point : "/var/vcap/services_migration" %>
-mongorestore_path: /var/vcap/packages/mongodb/bin/mongorestore
+mongorestore_path:
+<% for version in supported_versions %>
+ <%= "'#{version}': /var/vcap/packages/mongodb#{packages[version]}/bin/mongorestore" %>
+<% end %>
<% if node.ip_route %>
ip_route: <%= node.ip_route %>
<% end %>
@@ -5,6 +5,12 @@ plan_enabled = properties.service_plans && properties.service_plans.send(service
plan = properties.plan || "free"
plan_conf = plan_enabled && properties.service_plans.send(service.to_sym).send(plan.to_sym).configuration
lifecycle = properties.service_lifecycle
+# backward compatible, fallback to version 1.8 if old manifest file can't supply supported versions
+supported_versions = properties.mongodb_node.supported_versions || ["1.8"]
+default_version = properties.mongodb_node.default_version || "1.8"
+packages = {}
+# convention, package contains mongodb 1.8 is mongodb18
+supported_versions.each{|v| packages[v] = v.sub(".","")}
%>
<% if lifecycle and lifecycle.resque %>
<% snapshot_dir = lifecycle.mount_point || "/var/vcap/services_snapshot" %>
@@ -28,7 +34,14 @@ index: <%= spec.index %>
node_id: <%= "#{service}_node#{'_' + plan if plan != 'free'}_#{spec.index.to_i + 1}" %>
download_url_template: "http://<%= lifecycle.download_url %>/serialized/%{service}/%{name}/snapshots/%{snapshot_id}?token=%{token}"
snapshot_quota: <%= plan_enabled && plan_conf.lifecycle && plan_conf.lifecycle.snapshot && plan_conf.lifecycle.snapshot.quota || 0 %>
-mongodump_path: /var/vcap/packages/mongodb/bin/mongodump
-mongorestore_path: /var/vcap/packages/mongodb/bin/mongorestore
+default_version: <%= "'#{default_version}'"%>
+mongodump_path:
+<% for version in supported_versions %>
+ <%= "'#{version}': /var/vcap/packages/mongodb#{packages[version]}/bin/mongodump" %>
+<% end %>
+mongorestore_path:
+<% for version in supported_versions %>
+ <%= "'#{version}': /var/vcap/packages/mongodb#{packages[version]}/bin/mongorestore" %>
+<% end %>
tar_path: /bin/tar
<% end %>
@@ -1,28 +1,31 @@
# abort script on any command that exit with a non zero value
set -e
+version="1.8.5"
+echo "Package mongodb version: $version"
+
if [[ `uname -a` =~ "x86_64" ]] ; then
- name="mongodb-linux-x86_64-1.8.5"
+ name="mongodb-linux-x86_64-$version"
echo "Using 64-bit version"
else
- name="mongodb-linux-i686-1.8.5"
+ name="mongodb-linux-i686-$version"
echo "Using 32-bit version"
fi
archive=mongodb/$name.tgz
if [[ -f $archive ]] ; then
- echo "Archive found"
+ echo "Archive: $archive found"
else
- echo "Archive not found"
+ echo "Archive: $archive not found"
exit 1
fi
echo "Extracting archive..."
tar xzf $archive
if [[ $? != 0 ]] ; then
- echo "Cannot unpack mongodb"
+ echo "Cannot unpack mongodb: $archive"
exit 1
fi
@@ -1,5 +1,5 @@
---
-name: mongodb
+name: mongodb18
files:
- mongodb/mongodb-linux-x86_64-1.8.5.tgz
- mongodb/mongodb-linux-i686-1.8.5.tgz

0 comments on commit 097f003

Please sign in to comment.