aboutsummaryrefslogtreecommitdiff
path: root/app/yugabyte/deploy/yugabyte.hcl
blob: e7efa7a0401b9c0a9758fde6517c0f7f50e6796a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
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",
          "--minloglevel=1",
        ]
        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",
          "--minloglevel=1",
        ]
        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
          }
        }
      }
    }
  }
}