Skip to content

Commit 3006987

Browse files
author
Shlomi Noach
committed
cheatsheet text
1 parent 5fb6596 commit 3006987

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

doc/cheatsheet.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,31 @@ If you don't have replicas, or do not wish to use them, you are still able to op
5353
- Your master must produce binary logs in RBR format.
5454
- You must approve this mode via `--allow-on-master`.
5555

56+
```shell
57+
gh-ost \
58+
--max-load=Threads_running=25 \
59+
--critical-load=Threads_running=1000 \
60+
--chunk-size=1000 \
61+
--throttle-control-replicas="myreplica.1.com,myreplica.2.com" \
62+
--max-lag-millis=1500 \
63+
--user="gh-ost" \
64+
--password="123456" \
65+
--host=master.with.rbr.com \
66+
--allow-on-master \
67+
--database="my_schema" \
68+
--table="my_table" \
69+
--verbose \
70+
--alter="engine=innodb" \
71+
--switch-to-rbr \
72+
--allow-master-master \
73+
--cut-over=default \
74+
--exact-rowcount \
75+
--default-retries=120 \
76+
--panic-flag-file=/tmp/ghost.panic.flag \
77+
--postpone-cut-over-flag-file=/tmp/ghost.postpone.flag \
78+
[--execute]
79+
```
80+
5681
##### c. Migrate/test on replica
5782

5883
This will perform a migration on the replica. `gh-ost` will briefly connect to the master but will thereafter perform all operations on the replica without modifying anything on the master.
@@ -61,3 +86,25 @@ Throughout the operation, `gh-ost` will throttle such that the replica is up to
6186
- `--migrate-on-replica` indicates to `gh-ost` that it must migrate the table directly on the replica. It will perform the cut-over phase even while replication is running.
6287
- `--test-on-replica` indicates the migration is for purpose of testing only. Before cut-over takes place, replication is stopped. Tables are swapped and then swapped back: your original table returns to its original place.
6388
Both tables are left with replication stopped. You may examine the two and compare data.
89+
90+
Test on replica cheatsheet:
91+
```shell
92+
gh-ost \
93+
--user="gh-ost" \
94+
--password="123456" \
95+
--test-on-replica \
96+
--database="my_schema" \
97+
--table="my_table" \
98+
--verbose \
99+
--alter="engine=innodb" \
100+
--initially-drop-ghost-table \
101+
--initially-drop-old-table \
102+
--max-load=Threads_running=30 \
103+
--switch-to-rbr \
104+
--chunk-size=2500 \
105+
--cut-over=default \
106+
--exact-rowcount \
107+
--serve-socket-file=/tmp/gh-ost.test.sock \
108+
--panic-flag-file=/tmp/gh-ost.panic.flag \
109+
--execute
110+
```

0 commit comments

Comments
 (0)