Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
backupCoordinator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
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
kowis-projects
backupCoordinator
Commits
64be7dde
Commit
64be7dde
authored
Jul 29, 2018
by
David
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates to the readme, and build.sbt
parent
04f25194
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
README.md
README.md
+26
-4
build.sbt
build.sbt
+5
-1
No files found.
README.md
View file @
64be7dde
...
...
@@ -6,7 +6,10 @@ I'm sure there are other distributed tools that will do this for me, but I wante
## Design Notes
Akka actor system
Using jssh, bouncycastle, and jzlib for the SSH parts.
### Akka actor system
TimerActor -> tells when to start -> BackupCoordinatorActor
...
...
@@ -15,17 +18,33 @@ BackupCoordinatorActor loads the configuration, which details what hosts to back
Creates a per host actor, that is responsible for that host, and sending the commands.
*
Per host actor will have a list of commands to be run on each host
*
commands are assumed to be in dependency order
*
Hosts are executed in sequence for now
HostActor creates an actor for each SSH command.
*
HostActor is responsible for the state of command execution, and should keep timer metrics and stuff
*
HostActor should maintain the SSH connection and hand it to command actors to use.
*
It's also responsible for fixing the SSH connection if it dies.
*
commands will look something like:
*
Mount network backup location
*
run pre-backup command (mysql and databases or whatever)
*
Run backup command
<This
command
may
loop
up
one
for
many
backups
on
the
same
host
>
*
un mount network backup location
SSHCommandActor Only responsible for running the command on the remote host.
*
Returns the output of the command to the HostActor (probably buffering it right now)
*
Returns the output of the command to the HostActor
*
Would be cool to do live streaming updates of stdout v2
*
will receive an ssh context from the HostActor, since it maintains SSH state
BackupCoordinatorActor needs to run a command when it's all done. Say an rclone up into the cloud.
Need to specify a host for that to run on, or it runs locally. That is also it's own actor
Need to specify a host for that to run on, or it runs locally. That is also it's own actor.
Should always run the command, even if one of the hosts failed.
PostRunActor Only responsible for the post run command, after all hosts have backed up, do this work
PostRunActor Only responsible for the post run command, after all hosts have backed up, do this work.
ReportingActor should then email a report of all the things that have been done.
Data will be in the BackupCoordinatorActor, buffered until it's all finished, and then delivered to the ReportingActor.
Then to be emailed or archived, or whatever.
### Example Configuration
...
...
@@ -41,6 +60,9 @@ PostRunActor Only responsible for the post run command, after all hosts have bac
#### Configuration yaml
TODO: configuration might need something that has a schema. That might be easier to deal with.
JSON is terrible at multiline strings, and XML can be way too verbose. HM
```
yaml
backupTemplate
:
|
borg create \
...
...
build.sbt
View file @
64be7dde
...
...
@@ -9,9 +9,13 @@ val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % akkaV % Test
val
scalaTest
=
"org.scalactic"
%%
"scalactic"
%
scalaTestV
val
scalacticScalaTest
=
"org.scalatest"
%%
"scalatest"
%
scalaTestV
val
sshj
=
"com.hierynomus"
%
"sshj"
%
"0.26.0"
val
bouncycastle
=
"org.bouncycastle"
%
"bcprov-jdk15on"
%
"1.60"
val
jzlib
=
"com.jcraft"
%
"jzlib"
%
"1.1.3"
lazy
val
backupCoordinator
=
(
project
in
file
(
"."
))
.
settings
(
name
:=
"Backup Coordinator"
,
libraryDependencies
++=
Seq
(
akka
,
akkaTestkit
,
scalaTest
,
scalacticScalaTest
)
libraryDependencies
++=
Seq
(
akka
,
akkaTestkit
,
scalaTest
,
scalacticScalaTest
,
sshj
,
bouncycastle
,
jzlib
)
)
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