deploy yugabytedb
This commit is contained in:
parent
5699d71c47
commit
5dead9cf4c
2 changed files with 208 additions and 0 deletions
202
app/yugabyte/deploy/yugabyte.hcl
Normal file
202
app/yugabyte/deploy/yugabyte.hcl
Normal file
|
@ -0,0 +1,202 @@
|
|||
job "yugabytedb" {
|
||||
type = "service"
|
||||
datacenters = [ "neptune", "pluton" ]
|
||||
|
||||
priority = 80
|
||||
|
||||
constraint {
|
||||
attribute = "${attr.cpu.arch}"
|
||||
value = "amd64"
|
||||
}
|
||||
|
||||
group "master" {
|
||||
count = 3
|
||||
|
||||
constraint {
|
||||
attribute = "${attr.unique.hostname}"
|
||||
operator = "regexp"
|
||||
value = "(caribou|cariacou|carcajou)"
|
||||
}
|
||||
|
||||
network {
|
||||
port "admin" { static = 7000 }
|
||||
port "master-rpc" { static = 7100 }
|
||||
}
|
||||
|
||||
update {
|
||||
max_parallel = 1
|
||||
min_healthy_time = "30s"
|
||||
healthy_deadline = "5m"
|
||||
}
|
||||
|
||||
task "master" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "yugabytedb/yugabyte:2.11.1.0-b305"
|
||||
command = "/home/yugabyte/bin/yb-master"
|
||||
args = [
|
||||
"--fs_data_dirs=/mnt/master",
|
||||
"--replication_factor=3",
|
||||
"--master_addresses=10.42.0.21:7100,10.42.0.22:7100,10.42.0.23:7100",
|
||||
"--rpc_bind_addresses=0.0.0.0:7100",
|
||||
"--placement_cloud=deuxfleurs",
|
||||
"--placement_region=staging",
|
||||
"--placement_zone=neptune",
|
||||
]
|
||||
volumes = [
|
||||
"/mnt/ssd/yugabyte/master:/mnt/master",
|
||||
]
|
||||
network_mode = "host"
|
||||
logging {
|
||||
type = "journald"
|
||||
}
|
||||
}
|
||||
|
||||
resources {
|
||||
memory = 1000
|
||||
cpu = 1000
|
||||
}
|
||||
|
||||
kill_signal = "SIGINT"
|
||||
kill_timeout = "20s"
|
||||
|
||||
service {
|
||||
tags = ["yugabyte-master-rpc"]
|
||||
port = 7100
|
||||
address_mode = "driver"
|
||||
name = "yugabyte-master-rpc"
|
||||
check {
|
||||
type = "tcp"
|
||||
port = 7100
|
||||
address_mode = "driver"
|
||||
interval = "60s"
|
||||
timeout = "5s"
|
||||
check_restart {
|
||||
limit = 3
|
||||
grace = "90s"
|
||||
ignore_warnings = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
tags = ["yugabyte-admin"]
|
||||
port = 7000
|
||||
address_mode = "driver"
|
||||
name = "yugabyte-admin"
|
||||
check {
|
||||
type = "tcp"
|
||||
port = 7000
|
||||
address_mode = "driver"
|
||||
interval = "60s"
|
||||
timeout = "5s"
|
||||
check_restart {
|
||||
limit = 3
|
||||
grace = "90s"
|
||||
ignore_warnings = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
restart {
|
||||
interval = "30m"
|
||||
attempts = 10
|
||||
delay = "15s"
|
||||
mode = "delay"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group "tserver" {
|
||||
count = 3
|
||||
|
||||
constraint {
|
||||
attribute = "${attr.unique.hostname}"
|
||||
operator = "!="
|
||||
value = "spoutnik"
|
||||
}
|
||||
|
||||
network {
|
||||
port "ysql" { static = 5433 }
|
||||
port "tserver-rpc" { static = 9100 }
|
||||
}
|
||||
|
||||
update {
|
||||
max_parallel = 1
|
||||
min_healthy_time = "30s"
|
||||
healthy_deadline = "5m"
|
||||
}
|
||||
|
||||
task "tserver" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "yugabytedb/yugabyte:2.11.1.0-b305"
|
||||
command = "/home/yugabyte/bin/yb-tserver"
|
||||
args = [
|
||||
"--fs_data_dirs=/mnt/tserver",
|
||||
"--start_pgsql_proxy",
|
||||
"--tserver_master_addrs=10.42.0.21:7100,10.42.0.22:7100,10.42.0.23:7100",
|
||||
"--rpc_bind_addresses=0.0.0.0:9100",
|
||||
"--placement_cloud=deuxfleurs",
|
||||
"--placement_region=staging",
|
||||
"--placement_zone=neptune",
|
||||
]
|
||||
volumes = [
|
||||
"/mnt/ssd/yugabyte/tserver:/mnt/tserver",
|
||||
]
|
||||
network_mode = "host"
|
||||
logging {
|
||||
type = "journald"
|
||||
}
|
||||
}
|
||||
|
||||
resources {
|
||||
memory = 1000
|
||||
cpu = 1000
|
||||
}
|
||||
|
||||
kill_signal = "SIGINT"
|
||||
kill_timeout = "20s"
|
||||
|
||||
service {
|
||||
tags = ["yugabyte-tserver-rpc"]
|
||||
port = 9100
|
||||
address_mode = "driver"
|
||||
name = "yugabyte-tserver-rpc"
|
||||
check {
|
||||
type = "tcp"
|
||||
port = 9100
|
||||
address_mode = "driver"
|
||||
interval = "60s"
|
||||
timeout = "5s"
|
||||
check_restart {
|
||||
limit = 3
|
||||
grace = "90s"
|
||||
ignore_warnings = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
tags = [ "yugabyte-ysql" ]
|
||||
port = 5433
|
||||
address_mode = "driver"
|
||||
name = "yugabyte-ysql"
|
||||
check {
|
||||
type = "tcp"
|
||||
port = 5433
|
||||
address_mode = "driver"
|
||||
interval = "60s"
|
||||
timeout = "5s"
|
||||
check_restart {
|
||||
limit = 3
|
||||
grace = "90s"
|
||||
ignore_warnings = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -302,6 +302,12 @@ in
|
|||
iptables -A VPN -p tcp --dport 3991 -j ACCEPT
|
||||
iptables -A VPN -p tcp --dport 3992 -j ACCEPT
|
||||
|
||||
# Yugabyte DB
|
||||
iptables -A VPN -p tcp --dport 5433 -j ACCEPT
|
||||
iptables -A VPN -p tcp --dport 7000 -j ACCEPT
|
||||
iptables -A VPN -p tcp --dport 7100 -j ACCEPT
|
||||
iptables -A VPN -p tcp --dport 9100 -j ACCEPT
|
||||
|
||||
# Netdata monitoring
|
||||
iptables -A VPN -p tcp --dport 19999 -j ACCEPT
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue