Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
92278483
Commit
92278483
authored
Nov 22, 2011
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Publish notification based lamp stack.
parent
cc8a16fb
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
131 additions
and
60 deletions
+131
-60
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+6
-5
stack/lamp/instance-backuped.cfg
stack/lamp/instance-backuped.cfg
+18
-9
stack/lamp/instance-mariadb-pbsready-export.cfg
stack/lamp/instance-mariadb-pbsready-export.cfg
+11
-5
stack/lamp/instance-mariadb-pbsready-import.cfg
stack/lamp/instance-mariadb-pbsready-import.cfg
+10
-31
stack/lamp/instance-mariadb-pbsready.cfg
stack/lamp/instance-mariadb-pbsready.cfg
+35
-1
stack/lamp/instance-pull-backup.cfg
stack/lamp/instance-pull-backup.cfg
+51
-9
No files found.
stack/lamp/buildout.cfg
View file @
92278483
...
@@ -90,7 +90,7 @@ mode = 0644
...
@@ -90,7 +90,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-backuped.cfg
url = ${:_profile_base_location_}/instance-backuped.cfg
output = ${buildout:directory}/template-backuped.cfg
output = ${buildout:directory}/template-backuped.cfg
md5sum =
4190baa5e3f87a02e8721aeac3b70942
md5sum =
0fedb9ed84137b2d5518ffbaaa6d76eb
mode = 0644
mode = 0644
[template-use-backup]
[template-use-backup]
...
@@ -111,34 +111,35 @@ mode = 0644
...
@@ -111,34 +111,35 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-mariadb-pbsready.cfg
url = ${:_profile_base_location_}/instance-mariadb-pbsready.cfg
output = ${buildout:directory}/template-mariadb-pbsready.cfg
output = ${buildout:directory}/template-mariadb-pbsready.cfg
md5sum =
cfc87bb3bb1d4aa4ffd11e4b6dfcabe7
md5sum =
d2a580dcd7efdd528be45c5ffadfe760
mode = 0644
mode = 0644
[template-mariadb-pbsready-import]
[template-mariadb-pbsready-import]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-mariadb-pbsready-import.cfg
url = ${:_profile_base_location_}/instance-mariadb-pbsready-import.cfg
output = ${buildout:directory}/template-mariadb-pbsready-import.cfg
output = ${buildout:directory}/template-mariadb-pbsready-import.cfg
md5sum = 4
83796d0e0ebdc86fb6fe6589bb8ed7e
md5sum = 4
a96ff02da3898fef7077fa8baec81ac
mode = 0644
mode = 0644
[template-mariadb-pbsready-export]
[template-mariadb-pbsready-export]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-mariadb-pbsready-export.cfg
url = ${:_profile_base_location_}/instance-mariadb-pbsready-export.cfg
output = ${buildout:directory}/template-mariadb-pbsready-export.cfg
output = ${buildout:directory}/template-mariadb-pbsready-export.cfg
md5sum = 11
2f259b613eefa94f8cc83a0e2aa9f3
md5sum = 11
a9e45e8bc590bc11bfdd304b07a4a5
mode = 0644
mode = 0644
[template-pull-backup]
[template-pull-backup]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-pull-backup.cfg
url = ${:_profile_base_location_}/instance-pull-backup.cfg
output = ${buildout:directory}/template-pull-backup.cfg
output = ${buildout:directory}/template-pull-backup.cfg
md5sum =
46bd46a0b46f39937ab3d604eeb20441
md5sum =
c7099cdf45605da4e9595c6e7b913327
mode = 0644
mode = 0644
[eggs]
[eggs]
recipe = zc.recipe.egg
recipe = zc.recipe.egg
eggs =
eggs =
${lxml-python:egg}
${lxml-python:egg}
slapos.toolbox
[versions]
[versions]
setuptools = 0.6c12dev-r88795
setuptools = 0.6c12dev-r88795
...
...
stack/lamp/instance-backuped.cfg
View file @
92278483
...
@@ -26,14 +26,15 @@ recipe = slapos.cookbook:request
...
@@ -26,14 +26,15 @@ recipe = slapos.cookbook:request
name = PBS (Pull Backup Server)
name = PBS (Pull Backup Server)
software-url = $${slap-connection:software-release-url}
software-url = $${slap-connection:software-release-url}
software-type = pull-backup
software-type = pull-backup
return = ssh-key
return = ssh-key
notification-url feeds-url
slave = false
slave = false
[request-mariadb]
[request-mariadb]
software-type = mariadb-pbsready-export
software-type = mariadb-pbsready-export
config = authorized-key
config = authorized-key
notify
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
return = url ssh-public-key ssh-url
config-notify = $${request-pull-backup-server:connection-notification-url}
return = url ssh-public-key ssh-url notification-id
[request-mariadb-pseudo-replicating]
[request-mariadb-pseudo-replicating]
<= slap-connection
<= slap-connection
...
@@ -41,30 +42,38 @@ recipe = slapos.cookbook:request
...
@@ -41,30 +42,38 @@ recipe = slapos.cookbook:request
name = MariaDB (backup)
name = MariaDB (backup)
software-url = $${slap-connection:software-release-url}
software-url = $${slap-connection:software-release-url}
software-type = mariadb-pbsready-import
software-type = mariadb-pbsready-import
return = url ssh-public-key ssh-url
return = url ssh-public-key ssh-url
notification-url
config = authorized-key
config = authorized-key
on-notification
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
pbs-notification-id = $${slap-connection:computer-id}-$${slap-connection:partition-id}-mariadb-push
config-on-notification = $${request-pull-backup-server:connection-feeds-url}$${:pbs-notification-id}
[request-pull-backup-server-mariadb]
[request-pull-backup-server-mariadb]
<= request-pull-backup-server
<= request-pull-backup-server
slap-connection
slap-connection
name = PBS pulling from MariaDB (backuped)
name = PBS pulling from MariaDB (backuped)
config = url name type server-key
frequency
config = url name type server-key
on-notification notify notification-id title
config-url = $${request-mariadb:connection-ssh-url}
config-url = $${request-mariadb:connection-ssh-url}
config-name = $${slap-connection:computer-id}-$${slap-connection:partition-id}-mariadb
config-name = $${slap-connection:computer-id}-$${slap-connection:partition-id}-mariadb
config-type = pull
config-type = pull
config-server-key = $${request-mariadb:connection-ssh-public-key}
config-server-key = $${request-mariadb:connection-ssh-public-key}
config-frequency = 15 0 * * *
config-on-notification = $${request-mariadb:connection-notification-id}
config-notify = $${request-pull-backup-server:connection-notification-url}
config-notification-id = $${slap-connection:computer-id}-$${slap-connection:partition-id}-mariadb-pull
config-title = Pulling from MariaDB
slave = true
slave = true
[request-pull-backup-server-mariadb-backup]
[request-pull-backup-server-mariadb-backup]
<= request-pull-backup-server
<= request-pull-backup-server
slap-connection
slap-connection
name = PBS pushing on MariaDB (ready to use backup)
name = PBS pushing on MariaDB (ready to use backup)
config = url name type server-key
frequency
config = url name type server-key
on-notification notify notification-id title
config-url = $${request-mariadb-pseudo-replicating:connection-ssh-url}
config-url = $${request-mariadb-pseudo-replicating:connection-ssh-url}
config-name = $${slap-connection:computer-id}-$${slap-connection:partition-id}-mariadb
config-name = $${slap-connection:computer-id}-$${slap-connection:partition-id}-mariadb
config-type = push
config-type = push
config-server-key = $${request-mariadb-pseudo-replicating:connection-ssh-public-key}
config-server-key = $${request-mariadb-pseudo-replicating:connection-ssh-public-key}
config-frequency = 45 0 * * *
config-on-notification = $${request-pull-backup-server:connection-feeds-url}$${request-pull-backup-server-mariadb:config-notification-id}
config-notify = $${request-mariadb-pseudo-replicating:connection-notification-url}
config-notification-id = $${request-mariadb-pseudo-replicating:pbs-notification-id}
config-title = Pushing to MariaDB backup
slave = true
slave = true
stack/lamp/instance-mariadb-pbsready-export.cfg
View file @
92278483
...
@@ -3,6 +3,9 @@ extends = ${template-mariadb-pbsready:output}
...
@@ -3,6 +3,9 @@ extends = ${template-mariadb-pbsready:output}
parts += cron-entry-mariadb-backup
parts += cron-entry-mariadb-backup
[urls]
notification-id = http://[$${notifier:host}]:$${notifier:port}/get/$${notifier-mydumper:name}
[mydumper]
[mydumper]
recipe = slapos.cookbook:mydumper
recipe = slapos.cookbook:mydumper
wrapper = $${rootdirectory:bin}/raw_mydumper
wrapper = $${rootdirectory:bin}/raw_mydumper
...
@@ -13,15 +16,18 @@ mydumper-binary = ${mydumper:location}/bin/mydumper
...
@@ -13,15 +16,18 @@ mydumper-binary = ${mydumper:location}/bin/mydumper
database = $${mariadb:database}
database = $${mariadb:database}
import = false
import = false
[mydumper-locked]
[notifier-mydumper]
recipe = slapos.cookbook:lockfile
<= notifier
lock-file = $${basedirectory:run}/mysql-backup.lock
recipe = slapos.cookbook:notifier.notify
binary = $${mydumper:wrapper}
name = mydumper
title = Dumping MariaDB Database
executable = $${mydumper:wrapper}
wrapper = $${rootdirectory:bin}/mydumper
wrapper = $${rootdirectory:bin}/mydumper
notify = $${slap-parameter:notify}
[cron-entry-mariadb-backup]
[cron-entry-mariadb-backup]
<= cron
<= cron
recipe = slapos.cookbook:cron.d
recipe = slapos.cookbook:cron.d
name = backup
name = backup
frequency = 0 * * * *
frequency = 0 * * * *
command = $${
mydumper-locked
:wrapper}
command = $${
notifier-mydumper
:wrapper}
stack/lamp/instance-mariadb-pbsready-import.cfg
View file @
92278483
...
@@ -2,27 +2,14 @@
...
@@ -2,27 +2,14 @@
extends = ${template-mariadb-pbsready:output}
extends = ${template-mariadb-pbsready:output}
parts =
parts += mariadb-import-on-notification
urls
mariadb
[urls]
stunnel
notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
certificate-authority
ca-stunnel
logrotate
logrotate-entry-mariadb
logrotate-entry-stunnel
logrotate-entry-cron
cron
cron-entry-logrotate
sshkeys-authority
dropbear-server
sshkeys-dropbear
dropbear-server-pbs-authorized-key
cron-entry-mariadb-import
[mydumper-import]
[mydumper-import]
recipe = slapos.cookbook:mydumper
recipe = slapos.cookbook:mydumper
wrapper = $${rootdirectory:bin}/
raw_
myloader
wrapper = $${rootdirectory:bin}/myloader
backup-directory = $${directory:mariadb-backup}
backup-directory = $${directory:mariadb-backup}
socket = $${mariadb:socket}
socket = $${mariadb:socket}
user = root
user = root
...
@@ -30,16 +17,8 @@ myloader-binary = ${mydumper:location}/bin/myloader
...
@@ -30,16 +17,8 @@ myloader-binary = ${mydumper:location}/bin/myloader
database = $${mariadb:database}
database = $${mariadb:database}
import = true
import = true
[mydumper-import-locked]
[mariadb-import-on-notification]
recipe = slapos.cookbook:lockfile
<= notifier
lock-file = $${basedirectory:run}/import.lock
recipe = slapos.cookbook:notifier.callback
wrapper = $${rootdirectory:bin}/myloader
on-notification-id = $${slap-parameter:on-notification}
binary = $${mydumper-import:wrapper}
callback = $${mydumper-import:wrapper}
wait = true
[cron-entry-mariadb-import]
<= cron
recipe = slapos.cookbook:cron.d
name = mariadb_import
frequency = 0 * * * *
command = $${mydumper-import-locked:wrapper}
stack/lamp/instance-mariadb-pbsready.cfg
View file @
92278483
...
@@ -12,12 +12,14 @@ parts =
...
@@ -12,12 +12,14 @@ parts =
logrotate-entry-mariadb
logrotate-entry-mariadb
logrotate-entry-stunnel
logrotate-entry-stunnel
logrotate-entry-cron
logrotate-entry-cron
logrotate-entry-equeue
cron
cron
cron-entry-logrotate
cron-entry-logrotate
sshkeys-authority
sshkeys-authority
dropbear-server
dropbear-server
sshkeys-dropbear
sshkeys-dropbear
dropbear-server-pbs-authorized-key
dropbear-server-pbs-authorized-key
notifier
[urls]
[urls]
ssh-public-key = $${sshkeys-dropbear:public-key-value}
ssh-public-key = $${sshkeys-dropbear:public-key-value}
...
@@ -61,16 +63,48 @@ recipe = slapos.cookbook:dropbear.add_authorized_key
...
@@ -61,16 +63,48 @@ recipe = slapos.cookbook:dropbear.add_authorized_key
key = $${slap-parameter:authorized-key}
key = $${slap-parameter:authorized-key}
[rdiff-backup-server]
[rdiff-backup-server]
recipe = slapos.cookbook:
rdiffbackup
recipe = slapos.cookbook:
pbs
client = false
client = false
path = $${directory:mariadb-backup}
path = $${directory:mariadb-backup}
wrapper = $${rootdirectory:bin}/rdiffbackup-server
wrapper = $${rootdirectory:bin}/rdiffbackup-server
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
[logrotate-entry-equeue]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = equeue
log = $${equeue:log}
frequency = daily
rotate-num = 30
[equeue]
recipe = slapos.cookbook:equeue
socket = $${basedirectory:run}/equeue.sock
log = $${basedirectory:log}/equeue.log
database = $${rootdirectory:srv}/equeue.db
wrapper = $${basedirectory:services}/equeue
equeue-binary = ${buildout:bin-directory}/equeue
[notifier]
recipe = slapos.cookbook:notifier
feeds = $${directory:notifier-feeds}
callbacks = $${directory:notifier-callbacks}
id-file = $${rootdirectory:etc}/notifier.id
equeue-socket = $${equeue:socket}
host = $${slap-network-information:global-ipv6}
port = 8080
wrapper = $${basedirectory:services}/notifier
server-binary = ${buildout:bin-directory}/pubsubserver
notifier-binary = ${buildout:bin-directory}/pubsubnotifier
[basedirectory]
[basedirectory]
cache = $${rootdirectory:var}/cache/
cache = $${rootdirectory:var}/cache/
notifier = $${rootdirectory:etc}/notifier/
[directory]
[directory]
mariadb-backup = $${basedirectory:backup}/mariadb/
mariadb-backup = $${basedirectory:backup}/mariadb/
ssh = $${rootdirectory:etc}/ssh/
ssh = $${rootdirectory:etc}/ssh/
sshkeys = $${rootdirectory:srv}/sshkeys
sshkeys = $${rootdirectory:srv}/sshkeys
notifier-feeds = $${basedirectory:notifier}/feeds/
notifier-callbacks = $${basedirectory:notifier}/callbacks/
stack/lamp/instance-pull-backup.cfg
View file @
92278483
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
parts =
parts =
connection-dict
connection-dict
rdiff-backup
pbs
cron
cron
cron-entry-logrotate
cron-entry-logrotate
logrotate
logrotate
...
@@ -16,6 +16,28 @@ offline = true
...
@@ -16,6 +16,28 @@ offline = true
[connection-dict]
[connection-dict]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
ssh-key = $${sshkeys-dropbear:public-key-value}
ssh-key = $${sshkeys-dropbear:public-key-value}
notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
feeds-url = http://[$${notifier:host}]:$${notifier:port}/get/
[equeue]
recipe = slapos.cookbook:equeue
socket = $${basedirectory:run}/equeue.sock
log = $${basedirectory:log}/equeue.log
database = $${rootdirectory:srv}/equeue.db
wrapper = $${basedirectory:services}/equeue
equeue-binary = ${buildout:bin-directory}/equeue
[notifier]
recipe = slapos.cookbook:notifier
feeds = $${directory:notifier-feeds}
callbacks = $${directory:notifier-callbacks}
id-file = $${rootdirectory:etc}/notifier.id
equeue-socket = $${equeue:socket}
host = $${slap-network-information:global-ipv6}
port = 8080
wrapper = $${basedirectory:services}/notifier
server-binary = ${buildout:bin-directory}/pubsubserver
notifier-binary = ${buildout:bin-directory}/pubsubnotifier
[dropbear-client]
[dropbear-client]
recipe = slapos.cookbook:dropbear.client
recipe = slapos.cookbook:dropbear.client
...
@@ -39,23 +61,25 @@ wrapper = $${basedirectory:services}/sshkeys_authority
...
@@ -39,23 +61,25 @@ wrapper = $${basedirectory:services}/sshkeys_authority
[sshkeys-dropbear]
[sshkeys-dropbear]
<= sshkeys-authority
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
recipe = slapos.cookbook:sshkeys_authority.request
name =
rdiff-backup
name =
pbs
type = rsa
type = rsa
executable = $${dropbear-client:wrapper}
executable = $${dropbear-client:wrapper}
public-key = $${dropbear-client:identity-file}.pub
public-key = $${dropbear-client:identity-file}.pub
private-key = $${dropbear-client:identity-file}
private-key = $${dropbear-client:identity-file}
wrapper = $${rootdirectory:bin}/do_backup
wrapper = $${rootdirectory:bin}/do_backup
[rdiff-backup]
[pbs]
recipe = slapos.cookbook:rdiffbackup
<= notifier
recipe = slapos.cookbook:pbs
client = true
client = true
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
sshclient-binary = $${dropbear-client:wrapper}
sshclient-binary = $${dropbear-client:wrapper}
known-hosts = $${directory:dot-ssh}/known_hosts
known-hosts = $${directory:dot-ssh}/known_hosts
promises-directory = $${basedirectory:promises}
promises-directory = $${basedirectory:promises}
directory = $${directory:
backups
}
directory = $${directory:
pbs-backup
}
cron-entries = $${cron:cron-entries}
cron-entries = $${cron:cron-entries}
wrappers-directory = $${directory:pbs-wrappers}
wrappers-directory = $${directory:pbs-wrappers}
notifier-url = http://[$${notifier:host}]:$${notifier:port}/
[cron-simplelogger]
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
recipe = slapos.cookbook:simplelogger
...
@@ -91,6 +115,23 @@ logrotate-entries = $${directory:logrotate-entries}
...
@@ -91,6 +115,23 @@ logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
backup = $${directory:logrotate-backup}
state-file = $${rootdirectory:srv}/logrotate.status
state-file = $${rootdirectory:srv}/logrotate.status
[logrotate-entry-equeue]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = equeue
log = $${equeue:log}
frequency = daily
rotate-num = 30
[logrotate-entry-equeue]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = cron
log = $${cron-simplelogger:log}
frequency = daily
rotate-num = 30
[rootdirectory]
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
etc = $${buildout:directory}/etc/
...
@@ -113,17 +154,18 @@ cronstamps = $${rootdirectory:etc}/cronstamps/
...
@@ -113,17 +154,18 @@ cronstamps = $${rootdirectory:etc}/cronstamps/
cron-entries = $${rootdirectory:etc}/cron.d/
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
crontabs = $${rootdirectory:etc}/crontabs/
cronoutput = $${basedirectory:log}/cron-ouput/
cronoutput = $${basedirectory:log}/cron-ouput/
rdiff-backup-backup = $${basedirectory:backup}/rdiff-backup
/
pbs-backup = $${basedirectory:backup}/pbs
/
logrotate-entries = $${rootdirectory:etc}/logrotate.d/
logrotate-entries = $${rootdirectory:etc}/logrotate.d/
logrotate-backup = $${basedirectory:backup}/logrotate/
logrotate-backup = $${basedirectory:backup}/logrotate/
rdiff-backup = $${rootdirectory:etc}/rdiff-backup/
sshkeys = $${rootdirectory:srv}/sshkeys
sshkeys = $${rootdirectory:srv}/sshkeys
backups = $${basedirectory:backup}/backups/
pbs-wrappers = $${rootdirectory:bin}/pbs/
pbs-wrappers = $${rootdirectory:bin}/rdiff-backup/
dot-ssh = $${basedirectory:ssh-home}/.ssh/
dot-ssh = $${basedirectory:ssh-home}/.ssh/
notifier-feeds = $${basedirectory:notifier}/feeds/
notifier-callbacks = $${basedirectory:notifier}/callbacks/
[basedirectory]
[basedirectory]
ssh-home = $${rootdirectory:home}/ssh
ssh-home = $${rootdirectory:home}/ssh
notifier = $${rootdirectory:etc}/notifier/
[rootdirectory]
[rootdirectory]
home = $${buildout:directory}/home/
home = $${buildout:directory}/home/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment