forked from Deuxfleurs/infrastructure
Migrate postgres
This commit is contained in:
parent
4f23adfbb9
commit
48db0185a4
1 changed files with 11 additions and 24 deletions
|
@ -9,6 +9,11 @@ job "postgres" {
|
|||
}
|
||||
|
||||
group "postgres" {
|
||||
network {
|
||||
port "psql_proxy_port" { static = 5432 }
|
||||
port "psql_port" { static = 5433 }
|
||||
}
|
||||
|
||||
task "sentinel" {
|
||||
driver = "docker"
|
||||
|
||||
|
@ -40,21 +45,14 @@ job "postgres" {
|
|||
"--cluster-name", "pissenlit",
|
||||
"--store-backend", "consul",
|
||||
"--store-endpoints", "http://consul.service.2.cluster.deuxfleurs.fr:8500",
|
||||
"--port", "5432",
|
||||
"--port", "${NOMAD_PORT_psql_proxy_port}",
|
||||
"--listen-address", "0.0.0.0"
|
||||
]
|
||||
port_map {
|
||||
psql_proxy_port = 5432
|
||||
}
|
||||
ports = [ "psql_proxy_port" ]
|
||||
}
|
||||
|
||||
resources {
|
||||
memory = 100
|
||||
network {
|
||||
port "psql_proxy_port" {
|
||||
static = 5432
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
|
@ -93,34 +91,23 @@ job "postgres" {
|
|||
"--pg-repl-username", "${PG_REPL_USER}",
|
||||
"--pg-repl-password", "${PG_REPL_PWD}",
|
||||
"--pg-listen-address", "${attr.unique.network.ip-address}",
|
||||
"--pg-port", "5433",
|
||||
"--pg-port", "${NOMAD_PORT_psql_port}",
|
||||
"--pg-bin-path", "/usr/lib/postgresql/9.6/bin/"
|
||||
]
|
||||
port_map {
|
||||
psql_port = 5433
|
||||
}
|
||||
ports = [ "psql_port" ]
|
||||
volumes = [
|
||||
"/mnt/ssd/postgres:/mnt/persist"
|
||||
]
|
||||
}
|
||||
artifact {
|
||||
source = "http://127.0.0.1:8500/v1/kv/configuration/postgres/keeper/env.tpl?raw"
|
||||
destination = "secrets/env.tpl"
|
||||
mode = "file"
|
||||
}
|
||||
|
||||
template {
|
||||
source = "secrets/env.tpl"
|
||||
data = file("../config/configuration/postgres/keeper/env.tpl")
|
||||
destination = "secrets/env"
|
||||
env = true
|
||||
}
|
||||
|
||||
resources {
|
||||
memory = 500
|
||||
network {
|
||||
port "psql_port" {
|
||||
static = "5433"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
|
|
Loading…
Reference in a new issue