-
Notifications
You must be signed in to change notification settings - Fork 308
Expand file tree
/
Copy pathEnableIt.tsx
More file actions
264 lines (244 loc) · 10.6 KB
/
EnableIt.tsx
File metadata and controls
264 lines (244 loc) · 10.6 KB
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
import React, { useState } from 'react';
import styles from './HADemo.module.css';
type Props = { onNext: () => void };
type Tab = 'create' | 'add' | 'remove';
const TABS: { id: Tab; label: string }[] = [
{ id: 'create', label: 'Create with HA' },
{ id: 'add', label: 'Add replica to existing' },
{ id: 'remove', label: 'Remove replica' },
];
function Cmd({ prompt, cmd }: { prompt: string; cmd: string }) {
return (
<div className={styles.cmdBlock}>
<span className={styles.cmdPrompt}>{prompt} </span>
<span className={styles.cmdText}>{cmd}</span>
</div>
);
}
export default function EnableIt({ onNext }: Props) {
const [tab, setTab] = useState<Tab>('create');
return (
<div className={styles.section}>
<div className={styles.progressBar}>
<div className={styles.progressFill} style={{ width: '71%' }} />
</div>
<h1>Enable High Availability</h1>
<p className={styles.lead}>
You can add a replica when creating a new Namespace or at any time on an existing one.
Both the Web UI and <code>tcld</code> CLI are supported.
</p>
<div className={styles.runTabs}>
{TABS.map((t) => (
<button
key={t.id}
className={`${styles.runTab} ${tab === t.id ? styles.runTabActive : ''}`}
onClick={() => setTab(t.id)}
>
{t.label}
</button>
))}
</div>
{/* ── Create with HA ── */}
{tab === 'create' && (
<>
<div className={styles.card} style={{ marginBottom: 20 }}>
<div className={`${styles.tag} ${styles.tagBlue}`}>New Namespace</div>
<p style={{ fontSize: 13, color: 'var(--hd-muted)', margin: '0 0 0' }}>
Specify both a primary region and a replica region when creating the Namespace.
Temporal Cloud immediately begins replicating all new Workflow history to the replica.
</p>
</div>
<div className={styles.enableSectionLabel}>Via tcld</div>
<Cmd
prompt="$"
cmd={`tcld namespace create \\
--namespace <namespace_id>.<account_id> \\
--region <primary_region> \\
--region <replica_region>`}
/>
<div className={styles.cmdOutput}>
# Example (multi-region, GA):
# --region aws-us-east-1 --region aws-us-west-2
</div>
<div className={styles.enableSectionLabel}>Via Web UI</div>
<div className={styles.failoverSteps}>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>1</div>
<div>
<div className={styles.failoverStepText}>Navigate to Temporal Cloud and click <strong>Create Namespace</strong></div>
</div>
</div>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>2</div>
<div>
<div className={styles.failoverStepText}>Select the <strong>primary region</strong></div>
<div className={styles.failoverStepNote}>e.g. AWS us-east-1</div>
</div>
</div>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>3</div>
<div>
<div className={styles.failoverStepText}>Click <strong>"Add a replica"</strong> and choose the replica region</div>
<div className={styles.failoverStepNote}>
Same-region and multi-cloud are in Public Preview; multi-region is GA.
</div>
</div>
</div>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>4</div>
<div>
<div className={styles.failoverStepText}>Confirm and create</div>
<div className={styles.failoverStepNote}>
Replication begins immediately for all new and existing Workflow Executions.
</div>
</div>
</div>
</div>
</>
)}
{/* ── Add to existing ── */}
{tab === 'add' && (
<>
<div className={styles.card} style={{ marginBottom: 20 }}>
<div className={`${styles.tag} ${styles.tagGreen}`}>Existing Namespace</div>
<p style={{ fontSize: 13, color: 'var(--hd-muted)', margin: 0 }}>
You can add a replica to an existing Namespace at any time. Temporal Cloud begins
asynchronously replicating <strong>all ongoing and historical</strong> Workflow
Executions to the new replica.
</p>
</div>
<div className={styles.enableSectionLabel}>Via tcld</div>
<Cmd
prompt="$"
cmd={`tcld namespace add-region \\
--namespace <namespace_id>.<account_id> \\
--region <replica_region>`}
/>
<div className={styles.enableSectionLabel}>Via Web UI</div>
<div className={styles.failoverSteps}>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>1</div>
<div>
<div className={styles.failoverStepText}>
Go to your Namespace detail page in Temporal Cloud
</div>
</div>
</div>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>2</div>
<div>
<div className={styles.failoverStepText}>
Click <strong>"Add a replica"</strong>
</div>
</div>
</div>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>3</div>
<div>
<div className={styles.failoverStepText}>
Select the desired replica region and confirm
</div>
<div className={styles.failoverStepNote}>
Replication of existing history begins immediately.
</div>
</div>
</div>
</div>
<div className={styles.enableNote}>
<span className={styles.enableNoteIcon}>ℹ️</span>
<span>
<strong>Changing replica location:</strong> Direct migration of a replica to a
different region is not supported. Remove the existing replica first, then add a new
one in the desired location. You must wait <strong>7 days</strong> before re-enabling
HA in the same region after removal.
</span>
</div>
</>
)}
{/* ── Remove replica ── */}
{tab === 'remove' && (
<>
<div className={styles.card} style={{ marginBottom: 20 }}>
<div className={`${styles.tag} ${styles.tagAmber}`}>Disable HA</div>
<p style={{ fontSize: 13, color: 'var(--hd-muted)', margin: 0 }}>
Removing a replica disables replication and reduces the Namespace back to a standard
single-isolation-domain configuration. The 7-day cooldown applies before you can
re-add a replica in the same location.
</p>
</div>
<div className={styles.enableSectionLabel}>Via tcld</div>
<Cmd
prompt="$"
cmd={`tcld namespace delete-region \\
--api-key <api_key> \\
--namespace <namespace_id>.<account_id> \\
--region <replica_region_name>`}
/>
<div className={styles.enableSectionLabel}>Via Web UI</div>
<div className={styles.failoverSteps}>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>1</div>
<div>
<div className={styles.failoverStepText}>
Go to your Namespace detail page
</div>
</div>
</div>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>2</div>
<div>
<div className={styles.failoverStepText}>
Find the replica entry and click <strong>"Remove replica"</strong>
</div>
</div>
</div>
<div className={styles.failoverStep}>
<div className={styles.failoverStepNum}>3</div>
<div>
<div className={styles.failoverStepText}>Confirm the removal</div>
<div className={styles.failoverStepNote}>
The Namespace reverts to standard configuration. SLA reverts to 99.9%.
</div>
</div>
</div>
</div>
<div className={styles.enableNote}>
<span className={styles.enableNoteIcon}>⚠️</span>
<span>
<strong>7-day cooldown:</strong> After removing a replica, you cannot re-enable HA
in the same location for 7 days. Plan replica migrations carefully — remove first,
add the new location, then remove the old one if needed.
</span>
</div>
</>
)}
<h2 className={styles.sectionHeading}>Monitoring Replication Health</h2>
<div className={styles.cardGrid} style={{ gridTemplateColumns: 'repeat(2, 1fr)' }}>
<div className={styles.card}>
<div className={`${styles.tag} ${styles.tagBlue}`}>Cloud UI</div>
<p style={{ fontSize: 13, color: 'var(--ifm-font-color-base)', margin: '0 0 8px', lineHeight: 1.6 }}>
The Temporal Cloud UI displays replica status and health. When a replica becomes
unhealthy, failover options are automatically disabled to prevent cascading issues.
</p>
</div>
<div className={styles.card}>
<div className={`${styles.tag} ${styles.tagPurple}`}>Metrics</div>
<p style={{ fontSize: 13, color: 'var(--ifm-font-color-base)', margin: '0 0 8px', lineHeight: 1.6 }}>
Replication lag is emitted as pre-computed percentiles (p50, p95, p99) on the metric{' '}
<code>temporal_cloud_v0_replication_lag_bucket</code>, labeled with{' '}
<code>temporal_namespace</code>. Target: p95 < 1 minute.
</p>
<p style={{ fontSize: 12, color: 'var(--hd-muted)', margin: 0, lineHeight: 1.5 }}>
Note: <code>temporal_cloud_v1_total_action_count</code> may appear doubled for HA
Namespaces — actions are replicated on both primary and replica.
</p>
</div>
</div>
<div className={styles.nextRow}>
<button className={styles.btn} onClick={onNext}>
Next: Test Yourself →
</button>
</div>
</div>
);
}