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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ophélie Gagnard
slapos
Commits
8bac671a
Commit
8bac671a
authored
Jan 19, 2012
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt lamp stack to p2p agents.
parent
0775766e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
321 additions
and
130 deletions
+321
-130
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+8
-6
stack/lamp/instance-apache-backup.cfg
stack/lamp/instance-apache-backup.cfg
+78
-3
stack/lamp/instance-backuped.cfg
stack/lamp/instance-backuped.cfg
+97
-67
stack/lamp/instance-mariadb-pbsready-export.cfg
stack/lamp/instance-mariadb-pbsready-export.cfg
+22
-11
stack/lamp/instance-mariadb-pbsready-import.cfg
stack/lamp/instance-mariadb-pbsready-import.cfg
+13
-9
stack/lamp/instance-mariadb-pbsready.cfg
stack/lamp/instance-mariadb-pbsready.cfg
+57
-18
stack/lamp/instance-pull-backup.cfg
stack/lamp/instance-pull-backup.cfg
+46
-16
No files found.
stack/lamp/buildout.cfg
View file @
8bac671a
...
@@ -51,6 +51,7 @@ extends =
...
@@ -51,6 +51,7 @@ extends =
../../component/mydumper/buildout.cfg
../../component/mydumper/buildout.cfg
../../component/mysql-python/buildout.cfg
../../component/mysql-python/buildout.cfg
../../component/dropbear/buildout.cfg
../../component/dropbear/buildout.cfg
../../component/gunicorn/buildout.cfg
versions = versions
versions = versions
...
@@ -90,14 +91,14 @@ mode = 0644
...
@@ -90,14 +91,14 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apache-backup.cfg
url = ${:_profile_base_location_}/instance-apache-backup.cfg
output = ${buildout:directory}/template-apache-backup.cfg
output = ${buildout:directory}/template-apache-backup.cfg
md5sum =
cfb77ac8785e0d125a785f69a5339014
md5sum =
2dca50fc8cd9548f8971d1675315d7ab
mode = 0644
mode = 0644
[template-backuped]
[template-backuped]
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 =
f43d1c6412ea8dc83b75573dc00daf9e
md5sum =
4ffb75f5c040cb0e1a1c02b89ee801a1
mode = 0644
mode = 0644
[template-mariadb]
[template-mariadb]
...
@@ -111,32 +112,33 @@ mode = 0644
...
@@ -111,32 +112,33 @@ 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 =
d2a580dcd7efdd528be45c5ffadfe760
md5sum =
a55976b334cf2042b9182634a20fa25a
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 =
4a96ff02da3898fef7077fa8baec81ac
md5sum =
693745df17f339eadf8ada55ae0b88fb
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 =
11a9e45e8bc590bc11bfdd304b07a4a5
md5sum =
a3426f38c1e327a8d7d76d151e5d978d
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 = 9a
ab30ba5aa23a37d4b507e7c414be00
md5sum = 9a
f6bb88c876d3920da1c1c30cea171f
mode = 0644
mode = 0644
[eggs]
[eggs]
recipe = zc.recipe.egg
recipe = zc.recipe.egg
eggs =
eggs =
${gunicorn:eggs}
${lxml-python:egg}
${lxml-python:egg}
slapos.toolbox
slapos.toolbox
stack/lamp/instance-apache-backup.cfg
View file @
8bac671a
...
@@ -11,6 +11,11 @@ parts =
...
@@ -11,6 +11,11 @@ parts =
sshkeys-dropbear
sshkeys-dropbear
dropbear-server
dropbear-server
dropbear-server-pbs-authorized-key
dropbear-server-pbs-authorized-key
request-pull-backup-server-apache-backup
agent
agent-wrapper
watchdog
logrotate-entry-equeue
eggs-directory = ${buildout:eggs-directory}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
...
@@ -19,8 +24,7 @@ offline = true
...
@@ -19,8 +24,7 @@ offline = true
[urls]
[urls]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
url = http://[$${apache-proxy:ip}]:$${apache-proxy:port}/
url = http://[$${apache-proxy:ip}]:$${apache-proxy:port}/
ssh-public-key = $${sshkeys-dropbear:public-key-value}
agent-url = $${agent-data:url}
ssh-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
[apache-proxy]
[apache-proxy]
recipe = slapos.cookbook:apacheproxy
recipe = slapos.cookbook:apacheproxy
...
@@ -127,6 +131,75 @@ name = logrotate
...
@@ -127,6 +131,75 @@ name = logrotate
frequency = 0 0 * * *
frequency = 0 0 * * *
command = $${logrotate:wrapper}
command = $${logrotate:wrapper}
[request-pull-backup-server-apache-backup]
<= slap-connection
recipe = slapos.cookbook:request
name = Pull Backup Server pushing to backup Apache
software-url = $${slap-connection:software-release-url}
software-type = pull-backup
slave = true
config = url id type request-agent-url authorized-key
config-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
config-id = $${slap-parameter:pbs-id}
config-type = push
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
config-authorized-key = $${sshkeys-dropbear:public-key-value}
return = feed-url agent-url
[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
[agent-data]
host = $${slap-network-information:global-ipv6}
port = 8081
url = http://[$${:host}]:$${:port}/
[agent]
<= agent-data
slap-connection
recipe = slapos.cookbook:agent
database = $${rootdirectory:srv}/agent.db
equeue-socket = $${equeue:socket}
callbacks-directory = $${directory:agent-callbacks}
wrapper = $${rootdirectory:bin}/agent
gunicorn = ${buildout:bin-directory}/gunicorn
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
config-file = $${rootdirectory:etc}/agent.py
peers =
$${slap-parameter:request-agent-url}
$${request-pull-backup-server-apache-backup:connection-agent-url}
[agent-wrapper]
recipe = slapos.cookbook:submanager
subcommand = $${agent:wrapper}
wrapper = $${basedirectory:services}/agent
pid-file = $${basedirectory:run}/agent.pid
binary = ${buildout:bin-directory}/submanager
config-files =
$${agent:config-file}
[watchdog]
recipe = slapos.cookbook:watchdog
agent-url = $${agent-data:url}
wrapper = $${basedirectory:services}/watchdog
binary = ${buildout:bin-directory}/wp-watchdog
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
[rootdirectory]
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
etc = $${buildout:directory}/etc/
...
@@ -142,6 +215,7 @@ services = $${rootdirectory:etc}/run/
...
@@ -142,6 +215,7 @@ services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
promises = $${rootdirectory:etc}/promise/
agent = $${rootdirectory:etc}/agent/
[directory]
[directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
...
@@ -152,5 +226,6 @@ cronstamps = $${rootdirectory:etc}/cronstamps/
...
@@ -152,5 +226,6 @@ cronstamps = $${rootdirectory:etc}/cronstamps/
cron-entries = $${rootdirectory:etc}/cron.d/
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
crontabs = $${rootdirectory:etc}/crontabs/
ssh = $${rootdirectory:etc}/ssh/
ssh = $${rootdirectory:etc}/ssh/
sshkeys = $${rootdirectory:srv}/sshkeys
sshkeys = $${rootdirectory:srv}/sshkeys
/
httpd-log = $${basedirectory:log}/apache/
httpd-log = $${basedirectory:log}/apache/
agent-callbacks = $${basedirectory:agent}/callbacks/
stack/lamp/instance-backuped.cfg
View file @
8bac671a
...
@@ -8,10 +8,7 @@ parts =
...
@@ -8,10 +8,7 @@ parts =
request-mariadb-pseudo-replicating
request-mariadb-pseudo-replicating
request-apache-backup
request-apache-backup
request-pull-backup-server
request-pull-backup-server
request-pull-backup-server-mariadb
request-pull-backup-server-mariadb-backup
request-pull-backup-server-apache
request-pull-backup-server-apache
request-pull-backup-server-apache-backup
url
url
apache-php
apache-php
stunnel
stunnel
...
@@ -25,6 +22,15 @@ parts =
...
@@ -25,6 +22,15 @@ parts =
dropbear-server
dropbear-server
sshkeys-authority
sshkeys-authority
dropbear-server-pbs-authorized-key
dropbear-server-pbs-authorized-key
logrotate-entry-equeue
agent
agent-wrapper
watchdog
[uuid-generator]
recipe = slapos.cookbook:uuid
database = $${buildout:directory}/.uuid.db
uuids = mariadb-backup apache-backup
[sshkeys-directory]
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
...
@@ -70,21 +76,81 @@ path = $${directory:htdocs}
...
@@ -70,21 +76,81 @@ path = $${directory:htdocs}
wrapper = $${rootdirectory:bin}/rdiffbackup-server
wrapper = $${rootdirectory:bin}/rdiffbackup-server
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
[agent-data]
host = $${slap-network-information:global-ipv6}
port = 8081
url = http://[$${:host}]:$${:port}/
[agent]
<= agent-data
slap-connection
recipe = slapos.cookbook:agent
database = $${rootdirectory:srv}/agent.db
equeue-socket = $${equeue:socket}
callbacks-directory = $${directory:agent-callbacks}
wrapper = $${rootdirectory:bin}/agent
gunicorn = ${buildout:bin-directory}/gunicorn
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
config-file = $${rootdirectory:etc}/agent.py
peers =
$${request-pull-backup-server:connection-agent-url}
$${request-mariadb:connection-agent-url}
$${request-mariadb-pseudo-replicating:connection-agent-url}
$${request-apache-backup:connection-agent-url}
[agent-wrapper]
recipe = slapos.cookbook:submanager
subcommand = $${agent:wrapper}
wrapper = $${basedirectory:services}/agent
pid-file = $${basedirectory:run}/agent.pid
binary = ${buildout:bin-directory}/submanager
config-files =
$${agent:config-file}
[watchdog]
recipe = slapos.cookbook:watchdog
agent-url = $${agent-data:url}
wrapper = $${basedirectory:services}/watchdog
binary = ${buildout:bin-directory}/wp-watchdog
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
[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
[request-pull-backup-server]
[request-pull-backup-server]
<= slap-connection
<= slap-connection
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
name = P
BS (Pull Backup Server)
name = P
ull 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 notification-url feeds-url
config = request-agent-url
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
return = ssh-key agent-url
slave = false
slave = false
[request-mariadb]
[request-mariadb]
software-type = mariadb-pbsready-export
software-type = mariadb-pbsready-export
config = authorized-key
notify
config = authorized-key
pbs-id request-agent-url
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-notify = $${request-pull-backup-server:connection-notification-url}
config-pbs-id = $${uuid-generator:uuid-mariadb-backup}
return = url ssh-public-key ssh-url notification-id
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
return = url agent-url
[request-mariadb-pseudo-replicating]
[request-mariadb-pseudo-replicating]
<= slap-connection
<= slap-connection
...
@@ -92,11 +158,12 @@ recipe = slapos.cookbook:request
...
@@ -92,11 +158,12 @@ 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 notification-url
config = authorized-key pbs-id request-agent-url
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-pbs-id = $${uuid-generator:uuid-mariadb-backup}
config-on-notification = $${request-pull-backup-server:connection-feeds-url}$${:pbs-notification-id}
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
return = url agent-url
slave = false
[request-apache-backup]
[request-apache-backup]
<= slap-connection
<= slap-connection
...
@@ -104,71 +171,34 @@ recipe = slapos.cookbook:request
...
@@ -104,71 +171,34 @@ recipe = slapos.cookbook:request
name = Apache Backup
name = Apache Backup
software-url = $${slap-connection:software-release-url}
software-url = $${slap-connection:software-release-url}
software-type = apache-backup
software-type = apache-backup
return = url
ssh-url ssh-public-key
return = url
agent-url
config = authorized-key proxy-url
config = authorized-key p
bs-id request-agent-url p
roxy-url
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-pbs-id = $${uuid-generator:uuid-apache-backup}
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
config-proxy-url = $${url:url}
config-proxy-url = $${url:url}
return = url agent-url
[request-pull-backup-server-apache]
[request-pull-backup-server-apache]
<= request-pull-backup-server
<= slap-connection
slap-connection
recipe = slapos.cookbook:request
name = PBS pulling from Apache
software-url = $${slap-connection:software-release-url}
config = url name type server-key notify notification-id frequency
config-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
config-name = $${slap-connection:computer-id}-$${slap-connection:partition-id}-apache
config-type = pull
config-server-key = $${sshkeys-dropbear:public-key-value}
config-notify = $${request-pull-backup-server:connection-notification-url}
config-notification-id = $${slap-connection:computer-id}-$${slap-connection:partition-id}-apache-pull
config-frequency = 30 * * * *
slave = true
[request-pull-backup-server-apache-backup]
<= request-pull-backup-server
slap-connection
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
name = P
BS pushing to $${request-apache-backup:name}
name = P
ull Backup Server pulling from main Apache
software-url = $${slap-connection:software-release-url}
software-url = $${slap-connection:software-release-url}
config = url name type server-key on-notification
software-type = pull-backup
config-url = $${request-apache-backup:connection-ssh-url}
config-name = $${request-pull-backup-server-apache:config-name}
config-type = push
config-server-key = $${request-apache-backup:connection-ssh-public-key}
config-on-notification = $${request-pull-backup-server:connection-feeds-url}$${request-pull-backup-server-apache:config-notification-id}
slave = true
slave = true
config = url id type request-agent-url authorized-key frequency
[request-pull-backup-server-mariadb]
config-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
<= request-pull-backup-server
config-id = $${uuid-generator:uuid-apache-backup}
slap-connection
name = PBS pulling from $${request-mariadb:name}
config = url name type server-key on-notification notify notification-id title
config-url = $${request-mariadb:connection-ssh-url}
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-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
config-on-notification = $${request-mariadb:connection-notification-id}
config-authorized-key = $${sshkeys-dropbear:public-key-value}
config-notify = $${request-pull-backup-server:connection-notification-url}
config-frequency = 0 * * * *
config-notification-id = $${slap-connection:computer-id}-$${slap-connection:partition-id}-mariadb-pull
return = feed-url agent-url
config-title = Pulling from MariaDB
slave = true
[request-pull-backup-server-mariadb-backup]
[basedirectory]
<= request-pull-backup-server
agent = $${rootdirectory:etc}/agent/
slap-connection
name = PBS pushing on $${request-mariadb-pseudo-replicating:name}
config = url name type server-key on-notification notify notification-id title
config-url = $${request-mariadb-pseudo-replicating:connection-ssh-url}
config-name = $${request-pull-backup-server-mariadb:config-name}
config-type = push
config-server-key = $${request-mariadb-pseudo-replicating:connection-ssh-public-key}
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
[directory]
[directory]
ssh = $${rootdirectory:etc}/ssh/
ssh = $${rootdirectory:etc}/ssh/
sshkeys = $${rootdirectory:srv}/sshkeys
sshkeys = $${rootdirectory:srv}/sshkeys
agent-callbacks = $${basedirectory:agent}/callbacks/
stack/lamp/instance-mariadb-pbsready-export.cfg
View file @
8bac671a
[buildout]
[buildout]
extends = ${template-mariadb-pbsready:output}
extends = ${template-mariadb-pbsready:output}
parts +=
cron-entry-mariadb-backup
parts +=
cron-entry-mariadb-backup
[urls]
notifier-mydumper
notification-id = http://[$${notifier:host}]:$${notifier:port}/get/$${notifier-mydumper:name}
mydumper
[mydumper]
[mydumper]
recipe = slapos.cookbook:mydumper
recipe = slapos.cookbook:mydumper
wrapper = $${rootdirectory:bin}/
raw_mydumper
wrapper = $${rootdirectory:bin}/
mydumper_raw
backup-directory = $${directory:mariadb-backup}
backup-directory = $${directory:mariadb-backup}
socket = $${mariadb:socket}
socket = $${mariadb:socket}
user = root
user = root
mydumper-binary = ${mydumper:location}/bin/mydumper
mydumper-binary = ${mydumper:location}/bin/mydumper
database = $${mariadb:database}
database = $${mariadb:database}
import = false
import = false
compression = true
[notifier-mydumper-data]
write-url = $${urls:agent-url}log/mydumper
[notifier-mydumper]
[notifier-mydumper]
<= notifier
<= notifier-mydumper-data
recipe = slapos.cookbook:notifier.notify
recipe = slapos.cookbook:agent.notifier
name = mydumper
title = Dumping MariaDB Database
executable = $${mydumper:wrapper}
wrapper = $${rootdirectory:bin}/mydumper
wrapper = $${rootdirectory:bin}/mydumper
notify = $${slap-parameter:notify}
command-line = $${mydumper:wrapper}
notifier-binary = ${buildout:bin-directory}/wp-agent-notifier
title = Dumping MariaDB
notify-url =
$${request-pull-backup-server:connection-notify-url}
[cron-entry-mariadb-backup]
[cron-entry-mariadb-backup]
<= cron
<= cron
...
@@ -31,3 +36,9 @@ recipe = slapos.cookbook:cron.d
...
@@ -31,3 +36,9 @@ recipe = slapos.cookbook:cron.d
name = backup
name = backup
frequency = 0 * * * *
frequency = 0 * * * *
command = $${notifier-mydumper:wrapper}
command = $${notifier-mydumper:wrapper}
[request-pull-backup-server]
name = Pull Backup Server pulling from main MariaDB
config-type = pull
config += trigger-feed
config-trigger-feed = $${notifier-mydumper-data:write-url}
stack/lamp/instance-mariadb-pbsready-import.cfg
View file @
8bac671a
[buildout]
[buildout]
extends = ${template-mariadb-pbsready:output}
extends = ${template-mariadb-pbsready:output}
parts += mariadb-import-on-notification
parts +=
trigger-mydumper-import
mydumper-import
[urls]
[trigger-mydumper-import]
notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
<= agent
recipe = slapos.cookbook:agent.trigger
on-feed = $${request-pull-backup-server:connection-feed-url}
executable = $${mydumper-import:wrapper}
[mydumper-import]
[mydumper-import]
recipe = slapos.cookbook:mydumper
recipe = slapos.cookbook:mydumper
...
@@ -17,8 +21,8 @@ myloader-binary = ${mydumper:location}/bin/myloader
...
@@ -17,8 +21,8 @@ myloader-binary = ${mydumper:location}/bin/myloader
database = $${mariadb:database}
database = $${mariadb:database}
import = true
import = true
[
mariadb-import-on-notification
]
[
request-pull-backup-server
]
<= notifier
name = Pull Backup Server pushing on backup MariaDB
recipe = slapos.cookbook:notifier.callback
config-type = push
on-notification-id = $${slap-parameter:on-notification}
config += notify
c
allback = $${mydumper-import:wrapper
}
c
onfig-notify = $${urls:notify-url
}
stack/lamp/instance-mariadb-pbsready.cfg
View file @
8bac671a
...
@@ -11,19 +11,20 @@ parts =
...
@@ -11,19 +11,20 @@ parts =
logrotate
logrotate
logrotate-entry-mariadb
logrotate-entry-mariadb
logrotate-entry-stunnel
logrotate-entry-stunnel
logrotate-entry-cron
logrotate-entry-cron logrotate-entry-equeue
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
agent
agent-wrapper
watchdog
[urls]
[urls]
ssh-public-key = $${sshkeys-dropbear:public-key-value}
agent-url = http://[$${agent:host}]:$${agent:port}/
ssh-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
notify-url = $${:agent-url}notify
[sshkeys-directory]
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
...
@@ -85,26 +86,64 @@ database = $${rootdirectory:srv}/equeue.db
...
@@ -85,26 +86,64 @@ database = $${rootdirectory:srv}/equeue.db
wrapper = $${basedirectory:services}/equeue
wrapper = $${basedirectory:services}/equeue
equeue-binary = ${buildout:bin-directory}/equeue
equeue-binary = ${buildout:bin-directory}/equeue
[notifier]
[agent-data]
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}
host = $${slap-network-information:global-ipv6}
port = 8080
port = 8080
wrapper = $${basedirectory:services}/notifier
url = http://[$${:host}]:$${:port}/
server-binary = ${buildout:bin-directory}/pubsubserver
notifier-binary = ${buildout:bin-directory}/pubsubnotifier
[agent]
<= agent-data
slap-connection
recipe = slapos.cookbook:agent
database = $${rootdirectory:srv}/agent.db
equeue-socket = $${equeue:socket}
callbacks-directory = $${directory:agent-callbacks}
config-file = $${rootdirectory:etc}/agent.py
wrapper = $${rootdirectory:bin}/agent
gunicorn = ${buildout:bin-directory}/gunicorn
config-file = $${rootdirectory:etc}/agent.py
peers =
$${slap-parameter:request-agent-url}
$${request-pull-backup-server:connection-agent-url}
[agent-wrapper]
recipe = slapos.cookbook:submanager
subcommand = $${agent:wrapper}
wrapper = $${basedirectory:services}/agent
pid-file = $${basedirectory:run}/agent.pid
binary = ${buildout:bin-directory}/submanager
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
config-files =
$${agent:config-file}
[watchdog]
recipe = slapos.cookbook:watchdog
agent-url = $${agent-data:url}
wrapper = $${basedirectory:services}/watchdog
binary = ${buildout:bin-directory}/wp-watchdog
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
[request-pull-backup-server]
<= slap-connection
recipe = slapos.cookbook:request
software-url = $${slap-connection:software-release-url}
software-type = pull-backup
config = url id type authorized-key request-agent-url name
config-url = ssh://nobody@[$${dropbear-server:host}]:$${dropbear-server:port}/$${rdiff-backup-server:path}
config-id = $${slap-parameter:pbs-id}
config-authorized-key = $${sshkeys-dropbear:public-key-value}
config-request-agent-url = http://[$${agent-data:host}]:$${agent-data:port}/
config-name = $${:name}
return = feed-url agent-url notify-url
slave = true
[basedirectory]
[basedirectory]
cache = $${rootdirectory:var}/cache/
agent = $${rootdirectory:etc}/agent/
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/
agent-callbacks = $${basedirectory:agent}/callbacks/
notifier-callbacks = $${basedirectory:notifier}/callbacks/
stack/lamp/instance-pull-backup.cfg
View file @
8bac671a
...
@@ -8,6 +8,9 @@ parts =
...
@@ -8,6 +8,9 @@ parts =
logrotate
logrotate
sshkeys-authority
sshkeys-authority
sshkeys-dropbear
sshkeys-dropbear
agent
agent-wrapper
watchdog
eggs-directory = ${buildout:eggs-directory}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
...
@@ -16,8 +19,7 @@ offline = true
...
@@ -16,8 +19,7 @@ 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
agent-url = http://[$${agent:host}]:$${agent:port}/
feeds-url = http://[$${notifier:host}]:$${notifier:port}/get/
[equeue]
[equeue]
recipe = slapos.cookbook:equeue
recipe = slapos.cookbook:equeue
...
@@ -27,17 +29,43 @@ database = $${rootdirectory:srv}/equeue.db
...
@@ -27,17 +29,43 @@ database = $${rootdirectory:srv}/equeue.db
wrapper = $${basedirectory:services}/equeue
wrapper = $${basedirectory:services}/equeue
equeue-binary = ${buildout:bin-directory}/equeue
equeue-binary = ${buildout:bin-directory}/equeue
[notifier]
[agent-data]
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}
host = $${slap-network-information:global-ipv6}
port = 8080
port = 8080
wrapper = $${basedirectory:services}/notifier
url = http://[$${:host}]:$${:port}/
server-binary = ${buildout:bin-directory}/pubsubserver
notifier-binary = ${buildout:bin-directory}/pubsubnotifier
[agent]
<= agent-data
slap-connection
recipe = slapos.cookbook:agent
database = $${rootdirectory:srv}/agent.db
equeue-socket = $${equeue:socket}
callbacks-directory = $${directory:agent-callbacks}
wrapper = $${rootdirectory:bin}/agent
gunicorn = ${buildout:bin-directory}/gunicorn
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
config-file = $${rootdirectory:etc}/agent.py
peers =
$${pbs:peers}
$${slap-parameter:request-agent-url}
[agent-wrapper]
recipe = slapos.cookbook:submanager
subcommand = $${agent:wrapper}
wrapper = $${basedirectory:services}/agent
pid-file = $${basedirectory:run}/agent.pid
binary = ${buildout:bin-directory}/submanager
config-files =
$${agent:config-file}
[watchdog]
recipe = slapos.cookbook:watchdog
agent-url = $${agent-data:url}
wrapper = $${basedirectory:services}/watchdog
binary = ${buildout:bin-directory}/wp-watchdog
partition-id = $${slap-connection:partition-id}
computer-id = $${slap-connection:computer-id}
[dropbear-client]
[dropbear-client]
recipe = slapos.cookbook:dropbear.client
recipe = slapos.cookbook:dropbear.client
...
@@ -69,7 +97,6 @@ private-key = $${dropbear-client:identity-file}
...
@@ -69,7 +97,6 @@ private-key = $${dropbear-client:identity-file}
wrapper = $${rootdirectory:bin}/do_backup
wrapper = $${rootdirectory:bin}/do_backup
[pbs]
[pbs]
<= notifier
recipe = slapos.cookbook:pbs
recipe = slapos.cookbook:pbs
client = true
client = true
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
...
@@ -79,8 +106,12 @@ promises-directory = $${basedirectory:promises}
...
@@ -79,8 +106,12 @@ promises-directory = $${basedirectory:promises}
directory = $${directory:pbs-backup}
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}/
agent-url = http://[$${agent-data:host}]:$${agent-data
:port}/
slave-instance-list = $${slap-parameter:slave_instance_list}
slave-instance-list = $${slap-parameter:slave_instance_list}
runafter-binary = ${buildout:bin-directory}/runafter
notifier-binary = ${buildout:bin-directory}/wp-agent-notifier
wrapper-directory = $${directory:pbs-wrappers}
agent-callbacks-directory = $${directory:agent-callbacks}
[cron-simplelogger]
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
recipe = slapos.cookbook:simplelogger
...
@@ -161,12 +192,11 @@ logrotate-backup = $${basedirectory:backup}/logrotate/
...
@@ -161,12 +192,11 @@ logrotate-backup = $${basedirectory:backup}/logrotate/
sshkeys = $${rootdirectory:srv}/sshkeys
sshkeys = $${rootdirectory:srv}/sshkeys
pbs-wrappers = $${rootdirectory:bin}/pbs/
pbs-wrappers = $${rootdirectory:bin}/pbs/
dot-ssh = $${basedirectory:ssh-home}/.ssh/
dot-ssh = $${basedirectory:ssh-home}/.ssh/
notifier-feeds = $${basedirectory:notifier}/feeds/
agent-callbacks = $${basedirectory:agent}/callbacks/
notifier-callbacks = $${basedirectory:notifier}/callbacks/
[basedirectory]
[basedirectory]
ssh-home = $${rootdirectory:home}/ssh
ssh-home = $${rootdirectory:home}/ssh
notifier = $${rootdirectory:etc}/notifier
/
agent = $${rootdirectory:etc}/agent
/
[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