Commit 44a20bdf authored by Marco Mariani's avatar Marco Mariani

comments

parent 9e118e67
...@@ -97,7 +97,7 @@ context = key templateapache instance-apache-php:output ...@@ -97,7 +97,7 @@ context = key templateapache instance-apache-php:output
import-list = file parts template-parts:destination import-list = file parts template-parts:destination
file replicated template-replicated:destination file replicated template-replicated:destination
md5sum = d96890f5cde5a6db3a71926002000082 md5sum = 5151295af3994499e2be6d68938787d3
mode = 0644 mode = 0644
......
...@@ -44,8 +44,8 @@ slave = false ...@@ -44,8 +44,8 @@ slave = false
[sshkeys-directory] [sshkeys-directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
requests = ${directory:sshkeys}/requests/ requests = ${directory:sshkeys}/requests
keys = ${directory:sshkeys}/keys/ keys = ${directory:sshkeys}/keys
[sshkeys-authority] [sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority recipe = slapos.cookbook:sshkeys_authority
...@@ -168,5 +168,5 @@ sla-instance_guid = ${request-pull-backup-server:instance_guid} ...@@ -168,5 +168,5 @@ sla-instance_guid = ${request-pull-backup-server:instance_guid}
[directory] [directory]
ssh = ${rootdirectory:etc}/ssh/ ssh = ${rootdirectory:etc}/ssh
sshkeys = ${rootdirectory:srv}/sshkeys sshkeys = ${rootdirectory:srv}/sshkeys
[buildout] [buildout]
parts = parts =
#Templates needed to setup automatic backup
pbsready pbsready
pbsready-import pbsready-import
pbsready-export pbsready-export
template-replicated template-replicated
template-parts template-parts
#Frozen is the state used to not destroy a broken instance's content
instance-frozen instance-frozen
template-resilient template-resilient
#----------------
#--
#-- Profiles needed to setup automated backup and recovery.
#--
[pbsready] [pbsready]
# Common parts for pbsready-import and pbsready-export.
# Provides rdiff-backup, notification queue, ssh authentication,
# dropbear server, and the bully script.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready.cfg.in url = ${:_profile_base_location_}/pbsready.cfg.in
output = ${buildout:directory}/pbsready.cfg output = ${buildout:directory}/pbsready.cfg
md5sum = d001110c9860b31ca8b01d9a37b8ecfa md5sum = 0e6a383849840419ce767325f5a368a4
mode = 0644 mode = 0644
[pbsready-import] [pbsready-import]
# An import instance has an importer script, which is called
# by the parent PBS instance when the dump content is propagated.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready-import.cfg.in url = ${:_profile_base_location_}/pbsready-import.cfg.in
output = ${buildout:directory}/pbsready-import.cfg output = ${buildout:directory}/pbsready-import.cfg
md5sum = 0c63d9202426c257576c14113614942d md5sum = eda0c1574d8991f4f9e08e3707c2b04b
mode = 0644 mode = 0644
[pbsready-export] [pbsready-export]
# An export instance has an exporter script, and communicates
# to parent PBS instances to deliver the exported dump.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready-export.cfg.in url = ${:_profile_base_location_}/pbsready-export.cfg.in
output = ${buildout:directory}/pbsready-export.cfg output = ${buildout:directory}/pbsready-export.cfg
md5sum = a82c4551efdb000dc1db18adb5b64754 md5sum = dd56f9c74e580475a17a9afb1d220390
mode = 0644 mode = 0644
[template-pull-backup] [template-pull-backup]
...@@ -45,7 +53,7 @@ mode = 0644 ...@@ -45,7 +53,7 @@ mode = 0644
[template-replicated] [template-replicated]
recipe = slapos.recipe.download recipe = slapos.recipe.download
url = ${:_profile_base_location_}/template-replicated.cfg.in url = ${:_profile_base_location_}/template-replicated.cfg.in
md5sum = 140beeb9193e0580e42a6004b9e3821f md5sum = 1017d919dbf41904f04f5c17dcb574fa
mode = 0644 mode = 0644
destination = ${buildout:directory}/template-replicated.cfg.in destination = ${buildout:directory}/template-replicated.cfg.in
...@@ -57,6 +65,9 @@ mode = 0644 ...@@ -57,6 +65,9 @@ mode = 0644
destination = ${buildout:directory}/template-parts.cfg.in destination = ${buildout:directory}/template-parts.cfg.in
[instance-frozen] [instance-frozen]
# When an instance is detected as broken, its software type is changed to "frozen".
# On the next run of slapgrid-cp, the buildout profile is replaced by instance-frozen.cfg,
# which will run without removing any content because it raises an error.
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-frozen.cfg.in url = ${:_profile_base_location_}/instance-frozen.cfg.in
output = ${buildout:directory}/instance-frozen.cfg output = ${buildout:directory}/instance-frozen.cfg
......
...@@ -7,8 +7,9 @@ parts += cron-entry-backup ...@@ -7,8 +7,9 @@ parts += cron-entry-backup
[urls] [urls]
notification-id = http://[$${notifier:host}]:$${notifier:port}/get/$${notifier-exporter:name} notification-id = http://[$${notifier:host}]:$${notifier:port}/get/$${notifier-exporter:name}
#notify launches executable, and once it's done, notifies the pull-backup-servers.
[notifier-exporter] [notifier-exporter]
# notifier.notify launches an (exporter) executable, and when finished,
# notifies the the pull-backup-servers.
<= notifier <= notifier
recipe = slapos.cookbook:notifier.notify recipe = slapos.cookbook:notifier.notify
name = exporter name = exporter
...@@ -17,8 +18,9 @@ executable = $${exporter:wrapper} ...@@ -17,8 +18,9 @@ executable = $${exporter:wrapper}
wrapper = $${rootdirectory:bin}/exporter wrapper = $${rootdirectory:bin}/exporter
notify = $${slap-parameter:notify} notify = $${slap-parameter:notify}
#adds the exporter to cron
[cron-entry-backup] [cron-entry-backup]
# Schedule the periodic database dump.
# Through notifications, this triggers (one or more) incremental backups on PBS instances.
<= cron <= cron
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
name = backup name = backup
......
...@@ -7,8 +7,9 @@ parts += import-on-notification ...@@ -7,8 +7,9 @@ parts += import-on-notification
[urls] [urls]
notification-url = http://[$${notifier:host}]:$${notifier:port}/notify notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
#Launches callback, when a notification is received
[import-on-notification] [import-on-notification]
# notifier.callback runs a script when a notification (sent by a parent PBS)
# is received
<= notifier <= notifier
recipe = slapos.cookbook:notifier.callback recipe = slapos.cookbook:notifier.callback
on-notification-id = $${slap-parameter:on-notification} on-notification-id = $${slap-parameter:on-notification}
......
...@@ -24,17 +24,17 @@ parts = ...@@ -24,17 +24,17 @@ parts =
#-- Creation of all needed directories. #-- Creation of all needed directories.
[basedirectory] [basedirectory]
script = $${rootdirectory:etc}/script/ script = $${rootdirectory:etc}/script
services = $${rootdirectory:etc}/run/ services = $${rootdirectory:etc}/run
cache = $${rootdirectory:var}/cache/ cache = $${rootdirectory:var}/cache
notifier = $${rootdirectory:etc}/notifier/ notifier = $${rootdirectory:etc}/notifier
[directory] [directory]
backup = $${basedirectory:backup}/$${slap-parameter:namebase} backup = $${basedirectory:backup}/$${slap-parameter:namebase}
ssh = $${rootdirectory:etc}/ssh/ ssh = $${rootdirectory:etc}/ssh/
sshkeys = $${rootdirectory:srv}/sshkeys sshkeys = $${rootdirectory:srv}/sshkeys
notifier-feeds = $${basedirectory:notifier}/feeds/ notifier-feeds = $${basedirectory:notifier}/feeds
notifier-callbacks = $${basedirectory:notifier}/callbacks/ notifier-callbacks = $${basedirectory:notifier}/callbacks
script = $${basedirectory:script} script = $${basedirectory:script}
...@@ -43,11 +43,13 @@ script = $${basedirectory:script} ...@@ -43,11 +43,13 @@ script = $${basedirectory:script}
#-- resiliency script for the bully algorithm #-- resiliency script for the bully algorithm
[resiliency] [resiliency]
# XXX The bully script is not run automatically, at the moment.
# For testing, run bin/bully for all the PBSReady instances.
# To enable automatic running, change the recipe and create the wrapper under "script" instead of "bin"
recipe = slapos.cookbook:addresiliency recipe = slapos.cookbook:addresiliency
script = $${basedirectory:script} script = $${basedirectory:script}
run = $${basedirectory:services} run = $${basedirectory:services}
bin = $${rootdirectory:bin} bin = $${rootdirectory:bin}
# XXX don't run bully automatically, yet
#---------------- #----------------
......
...@@ -16,13 +16,10 @@ name = {{namebase}}0 ...@@ -16,13 +16,10 @@ name = {{namebase}}0
return = url ssh-public-key ssh-url notification-id ip return = url ssh-public-key ssh-url notification-id ip
config = number script wrapper authorized-key notify ip-list namebase config = number script wrapper authorized-key notify ip-list namebase
config-number = 0
config-authorized-key = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}{% endfor %} config-authorized-key = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}{% endfor %}
config-notify = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-notification-url}{% endfor %} config-notify = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-notification-url}{% endfor %}
config-ip-list = config-ip-list =
config-number = 0
{% for id in range(1,nbbackup|int) %} {% for id in range(1,nbbackup|int) %}
...@@ -37,14 +34,13 @@ software-url = ${slap-connection:software-release-url} ...@@ -37,14 +34,13 @@ software-url = ${slap-connection:software-release-url}
software-type = {{typeimport}} software-type = {{typeimport}}
return = url ssh-public-key ssh-url notification-url ip return = url ssh-public-key ssh-url notification-url ip
config = number script wrapper authorized-key on-notification ip-list namebase pbs-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-{{namebase}}-push
config = number script wrapper authorized-key on-notification ip-list namebase
config-number = {{id}}
config-authorized-key = ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key} config-authorized-key = ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}
config-on-notification = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${:pbs-notification-id} config-on-notification = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${:pbs-notification-id}
pbs-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-{{namebase}}-push
config-ip-list = config-ip-list =
config-number = {{id}}
{% endfor %} {% endfor %}
...@@ -60,19 +56,15 @@ config-ip-list = ${request-{{namebase}}:connection-ip}{% for j in range(1,nbback ...@@ -60,19 +56,15 @@ config-ip-list = ${request-{{namebase}}:connection-ip}{% for j in range(1,nbback
recipe = slapos.cookbook:request recipe = slapos.cookbook:request
name = {{namebase}}0 name = {{namebase}}0
config = number script wrapper authorized-key notify ip-list namebase
software-url = ${slap-connection:software-release-url} software-url = ${slap-connection:software-release-url}
software-type = {{typeexport}} software-type = {{typeexport}}
return = url ssh-public-key ssh-url notification-id ip return = url ssh-public-key ssh-url notification-id ip
config = number script wrapper authorized-key notify ip-list namebase
config-number = 0
config-authorized-key = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}{% endfor %} config-authorized-key = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}{% endfor %}
config-notify = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-notification-url}{% endfor %} config-notify = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-notification-url}{% endfor %}
config-number=0
{% for id in range(1,nbbackup|int) %} {% for id in range(1,nbbackup|int) %}
[request-{{namebase}}-pseudo-replicating-{{id}}-2] [request-{{namebase}}-pseudo-replicating-{{id}}-2]
<= slap-connection <= slap-connection
...@@ -87,14 +79,13 @@ software-url = ${slap-connection:software-release-url} ...@@ -87,14 +79,13 @@ software-url = ${slap-connection:software-release-url}
software-type = {{typeimport}} software-type = {{typeimport}}
return = url ssh-public-key ssh-url notification-url return = url ssh-public-key ssh-url notification-url
config = number script wrapper authorized-key on-notification ip-list namebase pbs-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-{{namebase}}-push
config = number script wrapper authorized-key on-notification ip-list namebase
config-number = {{id}}
config-authorized-key = ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key} config-authorized-key = ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}
config-on-notification = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${:pbs-notification-id} config-on-notification = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${:pbs-notification-id}
pbs-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-{{namebase}}-push
config-number = {{id}}
{% endfor %} {% endfor %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment