chore: backup infrastructure configurations [skip ci]
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"backup_timestamp": "2025-12-04T02:00:49.445063",
|
"backup_timestamp": "2025-12-05T02:00:49.057253",
|
||||||
"total_keys": 79,
|
"total_keys": 79,
|
||||||
"successful_backups": 74,
|
"successful_backups": 74,
|
||||||
"failed_backups": 5,
|
"failed_backups": 5,
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"conn_url":"postgres://192.168.4.226:5432/postgres","api_url":"http://192.168.4.226:8008/patroni","state":"running","role":"replica","version":"4.0.4","xlog_location":599829803936,"replication_state":"streaming","timeline":248}
|
{"conn_url":"postgres://192.168.4.226:5432/postgres","api_url":"http://192.168.4.226:8008/patroni","state":"running","role":"replica","version":"4.0.4","xlog_location":600968407064,"replication_state":"streaming","timeline":248}
|
||||||
@@ -1 +1 @@
|
|||||||
{"conn_url":"postgres://192.168.4.227:5432/postgres","api_url":"http://192.168.4.227:8008/patroni","state":"running","role":"replica","version":"4.0.4","xlog_location":599841055992,"replication_state":"streaming","timeline":248}
|
{"conn_url":"postgres://192.168.4.227:5432/postgres","api_url":"http://192.168.4.227:8008/patroni","state":"running","role":"replica","version":"4.0.4","xlog_location":600979325184,"replication_state":"streaming","timeline":248}
|
||||||
@@ -1 +1 @@
|
|||||||
{"conn_url":"postgres://192.168.4.228:5432/postgres","api_url":"http://192.168.4.228:8008/patroni","state":"running","role":"primary","version":"4.0.4","xlog_location":599839997952,"timeline":248}
|
{"conn_url":"postgres://192.168.4.228:5432/postgres","api_url":"http://192.168.4.228:8008/patroni","state":"running","role":"primary","version":"4.0.4","xlog_location":600979325184,"timeline":248}
|
||||||
@@ -1 +1 @@
|
|||||||
{"conn_url":"postgres://192.168.4.36:5432/postgres","api_url":"http://192.168.4.36:8008/patroni","state":"running","role":"replica","version":"4.0.4","xlog_location":599829831680,"replication_state":"streaming","timeline":248}
|
{"conn_url":"postgres://192.168.4.36:5432/postgres","api_url":"http://192.168.4.36:8008/patroni","state":"running","role":"replica","version":"4.0.4","xlog_location":600969755376,"replication_state":"streaming","timeline":248}
|
||||||
@@ -1 +1 @@
|
|||||||
{"optime":599839997952,"slots":{"pg_odroid6":599839997952,"pg_odroid7":599839997952,"pg_opti1":599839997952,"pg_odroid8":599839997952},"retain_slots":["pg_odroid6","pg_odroid7","pg_odroid8","pg_opti1"]}
|
{"optime":600979325184,"slots":{"pg_odroid6":600979325184,"pg_odroid7":600979325184,"pg_opti1":600979325184,"pg_odroid8":600979325184},"retain_slots":["pg_odroid6","pg_odroid7","pg_odroid8","pg_opti1"]}
|
||||||
108
nomad_backup/garage-webui.hcl
Normal file
108
nomad_backup/garage-webui.hcl
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
job "garage-webui" {
|
||||||
|
datacenters = ["dc1"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "webui" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "webui" {
|
||||||
|
static = 3909
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "webui" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "khairul169/garage-webui:latest"
|
||||||
|
ports = ["webui"]
|
||||||
|
|
||||||
|
volumes = [
|
||||||
|
"local/garage.toml:/etc/garage.toml:ro"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Copy the garage.toml for read-only access
|
||||||
|
template {
|
||||||
|
data = <<EOF
|
||||||
|
metadata_dir = "/var/lib/garage/meta"
|
||||||
|
data_dir = "/var/lib/garage/data"
|
||||||
|
db_engine = "lmdb"
|
||||||
|
replication_factor = 3
|
||||||
|
consistency_mode = "consistent"
|
||||||
|
compression_level = 1
|
||||||
|
rpc_bind_addr = "[::]:3901"
|
||||||
|
rpc_secret = "{{ key "garage/rpc_secret" }}"
|
||||||
|
|
||||||
|
[consul_discovery]
|
||||||
|
consul_http_addr = "http://consul.service.dc1.consul:8500"
|
||||||
|
service_name = "garage-admin"
|
||||||
|
|
||||||
|
[s3_api]
|
||||||
|
s3_region = "garage"
|
||||||
|
api_bind_addr = "[::]:3900"
|
||||||
|
root_domain = ".s3.garage.dc1.consul"
|
||||||
|
|
||||||
|
[s3_web]
|
||||||
|
bind_addr = "[::]:3903"
|
||||||
|
root_domain = ".web.garage.dc1.consul"
|
||||||
|
|
||||||
|
[k2v_api]
|
||||||
|
api_bind_addr = "[::]:3902"
|
||||||
|
|
||||||
|
[admin]
|
||||||
|
api_bind_addr = "[::]:3904"
|
||||||
|
admin_token = "{{ key "garage/admin_token" }}"
|
||||||
|
metrics_token = "{{ key "garage/metrics_token" }}"
|
||||||
|
EOF
|
||||||
|
destination = "local/garage.toml"
|
||||||
|
change_mode = "restart"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Environment variables - using Consul service discovery
|
||||||
|
env {
|
||||||
|
API_BASE_URL = "http://garage-admin.service.dc1.consul:3904"
|
||||||
|
S3_ENDPOINT_URL = "http://garage-s3.service.dc1.consul:3900"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Resources
|
||||||
|
resources {
|
||||||
|
cpu = 200
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
|
||||||
|
# Service registration
|
||||||
|
service {
|
||||||
|
name = "garage-webui"
|
||||||
|
port = "webui"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"webui",
|
||||||
|
"http",
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.garage-webui.rule=Host(`garage.example.com`)"
|
||||||
|
]
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "http"
|
||||||
|
path = "/"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Kill timeout
|
||||||
|
kill_timeout = "30s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Update strategy
|
||||||
|
update {
|
||||||
|
max_parallel = 1
|
||||||
|
health_check = "checks"
|
||||||
|
min_healthy_time = "10s"
|
||||||
|
healthy_deadline = "3m"
|
||||||
|
auto_revert = true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
job "garage" {
|
job "garage" {
|
||||||
datacenters = ["dc1"]
|
datacenters = ["dc1"]
|
||||||
type = "system"
|
type = "system"
|
||||||
|
|
||||||
group "garage" {
|
group "garage" {
|
||||||
# Network configuration for Garage
|
# Network configuration for Garage
|
||||||
network {
|
network {
|
||||||
@@ -21,53 +21,43 @@ job "garage" {
|
|||||||
static = 3901
|
static = 3901
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task "garage" {
|
task "garage" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
|
|
||||||
# Multi-architecture image selection
|
# Multi-architecture image selection
|
||||||
config {
|
config {
|
||||||
image = "dxflrs/garage:v2.1.0"
|
image = "dxflrs/garage:v2.1.0"
|
||||||
ports = ["s3_api", "k2v_api", "web_api", "admin", "rpc"]
|
ports = ["s3_api", "k2v_api", "web_api", "admin", "rpc"]
|
||||||
|
|
||||||
volumes = [
|
volumes = [
|
||||||
"/mnt/configs/garage_data:/var/lib/garage/data",
|
"/mnt/configs/garage_data:/var/lib/garage/data",
|
||||||
"/mnt/configs/garage_meta:/var/lib/garage/meta",
|
"/mnt/configs/garage_meta:/var/lib/garage/meta",
|
||||||
"local/garage.toml:/etc/garage.toml"
|
"local/garage.toml:/etc/garage.toml"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Configuration template
|
# Configuration template
|
||||||
template {
|
template {
|
||||||
data = <<EOF
|
data = <<EOF
|
||||||
metadata_dir = "/var/lib/garage/meta"
|
metadata_dir = "/var/lib/garage/meta"
|
||||||
data_dir = "/var/lib/garage/data"
|
data_dir = "/var/lib/garage/data"
|
||||||
db_engine = "lmdb"
|
db_engine = "lmdb"
|
||||||
|
|
||||||
replication_factor = 3
|
replication_factor = 3
|
||||||
consistency_mode = "consistent"
|
consistency_mode = "consistent"
|
||||||
|
|
||||||
compression_level = 1
|
compression_level = 1
|
||||||
rpc_bind_addr = "[::]:3901"
|
rpc_bind_addr = "[::]:3901"
|
||||||
rpc_public_addr = "{{ env "NOMAD_IP_rpc" }}:{{ env "NOMAD_PORT_rpc" }}"
|
rpc_public_addr = "{{ env "NOMAD_IP_rpc" }}:{{ env "NOMAD_PORT_rpc" }}"
|
||||||
rpc_secret = "{{ key "garage/rpc_secret" }}"
|
rpc_secret = "{{ key "garage/rpc_secret" }}"
|
||||||
|
|
||||||
[consul_discovery]
|
[consul_discovery]
|
||||||
consul_http_addr = "http://consul.service.dc1.consul:8500"
|
consul_http_addr = "http://consul.service.dc1.consul:8500"
|
||||||
service_name = "garage-admin"
|
service_name = "garage-admin"
|
||||||
|
|
||||||
[s3_api]
|
[s3_api]
|
||||||
s3_region = "garage"
|
s3_region = "garage"
|
||||||
api_bind_addr = "[::]:3900"
|
api_bind_addr = "[::]:3900"
|
||||||
root_domain = ".s3.garage.dc1.consul"
|
root_domain = ".s3.garage.dc1.consul"
|
||||||
|
|
||||||
[s3_web]
|
[s3_web]
|
||||||
bind_addr = "[::]:3903"
|
bind_addr = "[::]:3903"
|
||||||
root_domain = ".web.garage.dc1.consul"
|
root_domain = ".web.garage.dc1.consul"
|
||||||
|
|
||||||
[k2v_api]
|
[k2v_api]
|
||||||
api_bind_addr = "[::]:3902"
|
api_bind_addr = "[::]:3902"
|
||||||
|
|
||||||
[admin]
|
[admin]
|
||||||
api_bind_addr = "[::]:3904"
|
api_bind_addr = "[::]:3904"
|
||||||
admin_token = "{{ key "garage/admin_token" }}"
|
admin_token = "{{ key "garage/admin_token" }}"
|
||||||
@@ -76,88 +66,76 @@ EOF
|
|||||||
destination = "local/garage.toml"
|
destination = "local/garage.toml"
|
||||||
change_mode = "restart"
|
change_mode = "restart"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
env {
|
env {
|
||||||
RUST_LOG = "garage=info"
|
RUST_LOG = "garage=info"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Resources
|
# Resources
|
||||||
resources {
|
resources {
|
||||||
cpu = 500
|
cpu = 500
|
||||||
memory = 128
|
memory = 128
|
||||||
}
|
}
|
||||||
|
|
||||||
# Service registration
|
# Service registration
|
||||||
service {
|
service {
|
||||||
name = "garage-s3"
|
name = "garage-s3"
|
||||||
port = "s3_api"
|
port = "s3_api"
|
||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
"s3",
|
"s3",
|
||||||
"storage"
|
"storage"
|
||||||
]
|
]
|
||||||
|
|
||||||
check {
|
check {
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
interval = "10s"
|
interval = "10s"
|
||||||
timeout = "2s"
|
timeout = "2s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service {
|
service {
|
||||||
name = "garage-admin"
|
name = "garage-admin"
|
||||||
port = "admin"
|
port = "admin"
|
||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
"admin",
|
"admin",
|
||||||
"metrics"
|
"metrics"
|
||||||
]
|
]
|
||||||
|
|
||||||
check {
|
check {
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
interval = "10s"
|
interval = "10s"
|
||||||
timeout = "2s"
|
timeout = "2s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service {
|
service {
|
||||||
name = "garage-web"
|
name = "garage-web"
|
||||||
port = "web_api"
|
port = "web_api"
|
||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
"web",
|
"web",
|
||||||
"http"
|
"http"
|
||||||
]
|
]
|
||||||
|
|
||||||
check {
|
check {
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
interval = "10s"
|
interval = "10s"
|
||||||
timeout = "2s"
|
timeout = "2s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service {
|
service {
|
||||||
name = "garage-k2v"
|
name = "garage-k2v"
|
||||||
port = "k2v_api"
|
port = "k2v_api"
|
||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
"k2v",
|
"k2v",
|
||||||
"storage"
|
"storage"
|
||||||
]
|
]
|
||||||
|
|
||||||
check {
|
check {
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
interval = "10s"
|
interval = "10s"
|
||||||
timeout = "2s"
|
timeout = "2s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Kill timeout
|
# Kill timeout
|
||||||
kill_timeout = "30s"
|
kill_timeout = "30s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update strategy for system jobs
|
# Update strategy for system jobs
|
||||||
update {
|
update {
|
||||||
max_parallel = 1
|
max_parallel = 1
|
||||||
@@ -166,4 +144,4 @@ EOF
|
|||||||
healthy_deadline = "5m"
|
healthy_deadline = "5m"
|
||||||
auto_revert = true
|
auto_revert = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
147
nomad_backup/garage_backup.hcl
Normal file
147
nomad_backup/garage_backup.hcl
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
job "garage_backup" {
|
||||||
|
datacenters = ["dc1"]
|
||||||
|
type = "system"
|
||||||
|
node_pool = "backup"
|
||||||
|
group "garage" {
|
||||||
|
# Network configuration for Garage
|
||||||
|
network {
|
||||||
|
port "s3_api" {
|
||||||
|
static = 3900
|
||||||
|
}
|
||||||
|
port "k2v_api" {
|
||||||
|
static = 3902
|
||||||
|
}
|
||||||
|
port "web_api" {
|
||||||
|
static = 3903
|
||||||
|
}
|
||||||
|
port "admin" {
|
||||||
|
static = 3904
|
||||||
|
}
|
||||||
|
port "rpc" {
|
||||||
|
static = 3901
|
||||||
|
}
|
||||||
|
}
|
||||||
|
task "garage" {
|
||||||
|
driver = "docker"
|
||||||
|
# Multi-architecture image selection
|
||||||
|
config {
|
||||||
|
image = "dxflrs/garage:v2.1.0"
|
||||||
|
ports = ["s3_api", "k2v_api", "web_api", "admin", "rpc"]
|
||||||
|
|
||||||
|
volumes = [
|
||||||
|
"/mnt/Shares/configs/garage_data:/var/lib/garage/data",
|
||||||
|
"/mnt/Shares/configs/garage_meta:/var/lib/garage/meta",
|
||||||
|
"local/garage.toml:/etc/garage.toml"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
# Configuration template
|
||||||
|
template {
|
||||||
|
data = <<EOF
|
||||||
|
metadata_dir = "/var/lib/garage/meta"
|
||||||
|
data_dir = "/var/lib/garage/data"
|
||||||
|
db_engine = "lmdb"
|
||||||
|
replication_factor = 3
|
||||||
|
consistency_mode = "consistent"
|
||||||
|
compression_level = 1
|
||||||
|
rpc_bind_addr = "[::]:3901"
|
||||||
|
rpc_public_addr = "{{ env "NOMAD_IP_rpc" }}:{{ env "NOMAD_PORT_rpc" }}"
|
||||||
|
rpc_secret = "{{ key "garage/rpc_secret" }}"
|
||||||
|
[consul_discovery]
|
||||||
|
consul_http_addr = "http://consul.service.dc1.consul:8500"
|
||||||
|
service_name = "garage-admin"
|
||||||
|
[s3_api]
|
||||||
|
s3_region = "garage"
|
||||||
|
api_bind_addr = "[::]:3900"
|
||||||
|
root_domain = ".s3.garage.dc1.consul"
|
||||||
|
[s3_web]
|
||||||
|
bind_addr = "[::]:3903"
|
||||||
|
root_domain = ".web.garage.dc1.consul"
|
||||||
|
[k2v_api]
|
||||||
|
api_bind_addr = "[::]:3902"
|
||||||
|
[admin]
|
||||||
|
api_bind_addr = "[::]:3904"
|
||||||
|
admin_token = "{{ key "garage/admin_token" }}"
|
||||||
|
metrics_token = "{{ key "garage/metrics_token" }}"
|
||||||
|
EOF
|
||||||
|
destination = "local/garage.toml"
|
||||||
|
change_mode = "restart"
|
||||||
|
}
|
||||||
|
# Environment variables
|
||||||
|
env {
|
||||||
|
RUST_LOG = "garage=info"
|
||||||
|
}
|
||||||
|
# Resources
|
||||||
|
resources {
|
||||||
|
cpu = 500
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
# Service registration
|
||||||
|
service {
|
||||||
|
name = "garage-s3"
|
||||||
|
port = "s3_api"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"s3",
|
||||||
|
"storage"
|
||||||
|
]
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
service {
|
||||||
|
name = "garage-admin"
|
||||||
|
port = "admin"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"admin",
|
||||||
|
"metrics"
|
||||||
|
]
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
service {
|
||||||
|
name = "garage-web"
|
||||||
|
port = "web_api"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"web",
|
||||||
|
"http"
|
||||||
|
]
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
service {
|
||||||
|
name = "garage-k2v"
|
||||||
|
port = "k2v_api"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"k2v",
|
||||||
|
"storage"
|
||||||
|
]
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Kill timeout
|
||||||
|
kill_timeout = "30s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Update strategy for system jobs
|
||||||
|
update {
|
||||||
|
max_parallel = 1
|
||||||
|
health_check = "checks"
|
||||||
|
min_healthy_time = "10s"
|
||||||
|
healthy_deadline = "5m"
|
||||||
|
auto_revert = true
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user