You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`gh-ost` is a Go project; it is built with Go `1.9` and above. To build on your own, use either:
97
+
`gh-ost` is a Go project; it is built with Go `1.12` and above. To build on your own, use either:
98
98
-[script/build](https://github.com/github/gh-ost/blob/master/script/build) - this is the same build script used by CI hence the authoritative; artifact is `./bin/gh-ost` binary.
99
99
-[build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost`
Copy file name to clipboardExpand all lines: doc/command-line-flags.md
+50-2Lines changed: 50 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ If, for some reason, you do not wish `gh-ost` to connect to a replica, you may c
18
18
19
19
### approve-renamed-columns
20
20
21
-
When your migration issues a column rename (`change column old_name new_name ...`) `gh-ost` analyzes the statement to try an associate the old column name with new column name. Otherwise the new structure may also look like some column was dropped and another was added.
21
+
When your migration issues a column rename (`change column old_name new_name ...`) `gh-ost` analyzes the statement to try and associate the old column name with new column name. Otherwise the new structure may also look like some column was dropped and another was added.
22
22
23
23
`gh-ost` will print out what it thinks the _rename_ implied, but will not issue the migration unless you provide with `--approve-renamed-columns`.
24
24
@@ -69,6 +69,10 @@ This is somewhat similar to a Nagios `n`-times test, where `n` in our case is al
69
69
70
70
Optional. Default is `safe`. See more discussion in [`cut-over`](cut-over.md)
71
71
72
+
### cut-over-lock-timeout-seconds
73
+
74
+
Default `3`. Max number of seconds to hold locks on tables while attempting to cut-over (retry attempted when lock exceeds timeout).
75
+
72
76
### discard-foreign-keys
73
77
74
78
**Danger**: this flag will _silently_ discard any foreign keys existing on your table.
@@ -107,6 +111,18 @@ While the ongoing estimated number of rows is still heuristic, it's almost exact
107
111
108
112
Without this parameter, migration is a _noop_: testing table creation and validity of migration, but not touching data.
109
113
114
+
### force-named-cut-over
115
+
116
+
If given, a `cut-over` command must name the migrated table, or else ignored.
117
+
118
+
### force-named-panic
119
+
120
+
If given, a `panic` command must name the migrated table, or else ignored.
121
+
122
+
### force-table-names
123
+
124
+
Table name prefix to be used on the temporary tables.
125
+
110
126
### gcp
111
127
112
128
Add this flag when executing on a 1st generation Google Cloud Platform (GCP).
@@ -125,6 +141,10 @@ We think `gh-ost` should not take chances or make assumptions about the user's t
125
141
126
142
See [`initially-drop-ghost-table`](#initially-drop-ghost-table)
127
143
144
+
### initially-drop-socket-file
145
+
146
+
Default False. Should `gh-ost` forcibly delete an existing socket file. Be careful: this might drop the socket file of a running migration!
147
+
128
148
### max-lag-millis
129
149
130
150
On a replication topology, this is perhaps the most important migration throttling factor: the maximum lag allowed for migration to work. If lag exceeds this value, migration throttles.
@@ -141,7 +161,7 @@ List of metrics and threshold values; topping the threshold of any will cause th
141
161
142
162
### migrate-on-replica
143
163
144
-
Typically `gh-ost` is used to migrate tables on a master. If you wish to only perform the migration in full on a replica, connect `gh-ost` to said replica and pass `--migrate-on-replica`. `gh-ost` will briefly connect to the master but other issue no changes on the master. Migration will be fully executed on the replica, while making sure to maintain a small replication lag.
164
+
Typically `gh-ost` is used to migrate tables on a master. If you wish to only perform the migration in full on a replica, connect `gh-ost` to said replica and pass `--migrate-on-replica`. `gh-ost` will briefly connect to the master but otherwise will make no changes on the master. Migration will be fully executed on the replica, while making sure to maintain a small replication lag.
145
165
146
166
### postpone-cut-over-flag-file
147
167
@@ -161,14 +181,42 @@ See also: [`concurrent-migrations`](cheatsheet.md#concurrent-migrations) on the
161
181
162
182
By default `gh-ost` verifies no foreign keys exist on the migrated table. On servers with large number of tables this check can take a long time. If you're absolutely certain no foreign keys exist (table does not reference other table nor is referenced by other tables) and wish to save the check time, provide with `--skip-foreign-key-checks`.
163
183
184
+
### skip-strict-mode
185
+
186
+
By default `gh-ost` enforces STRICT_ALL_TABLES sql_mode as a safety measure. In some cases this changes the behaviour of other modes (namely ERROR_FOR_DIVISION_BY_ZERO, NO_ZERO_DATE, and NO_ZERO_IN_DATE) which may lead to errors during migration. Use `--skip-strict-mode` to explicitly tell `gh-ost` not to enforce this. **Danger** This may have some unexpected disastrous side effects.
187
+
164
188
### skip-renamed-columns
165
189
166
190
See [`approve-renamed-columns`](#approve-renamed-columns)
167
191
192
+
### ssl
193
+
194
+
By default `gh-ost` does not use ssl/tls connections to the database servers when performing migrations. This flag instructs `gh-ost` to use encrypted connections. If enabled, `gh-ost` will use the system's ca certificate pool for server certificate verification. If a different certificate is needed for server verification, see `--ssl-ca`. If you wish to skip server verification, but still use encrypted connections, use with `--ssl-allow-insecure`.
195
+
196
+
### ssl-allow-insecure
197
+
198
+
Allows `gh-ost` to connect to the MySQL servers using encrypted connections, but without verifying the validity of the certificate provided by the server during the connection. Requires `--ssl`.
199
+
200
+
### ssl-ca
201
+
202
+
`--ssl-ca=/path/to/ca-cert.pem`: ca certificate file (in PEM format) to use for server certificate verification. If specified, the default system ca cert pool will not be used for verification, only the ca cert provided here. Requires `--ssl`.
203
+
204
+
### ssl-cert
205
+
206
+
`--ssl-cert=/path/to/ssl-cert.crt`: SSL public key certificate file (in PEM format).
207
+
208
+
### ssl-key
209
+
210
+
`--ssl-key=/path/to/ssl-key.key`: SSL private key file (in PEM format).
211
+
168
212
### test-on-replica
169
213
170
214
Issue the migration on a replica; do not modify data on master. Useful for validating, testing and benchmarking. See [`testing-on-replica`](testing-on-replica.md)
171
215
216
+
### test-on-replica-skip-replica-stop
217
+
218
+
Default `False`. When `--test-on-replica` is enabled, do not issue commands stop replication (requires `--test-on-replica`).
219
+
172
220
### throttle-control-replicas
173
221
174
222
Provide a command delimited list of replicas; `gh-ost` will throttle when any of the given replicas lag beyond [`--max-lag-millis`](#max-lag-millis). The list can be queried and updated dynamically via [interactive commands](interactive-commands.md)
0 commit comments