您现在的位置: 首页 > 网站导航收录 > 百科知识百科知识
(panick)-panick是什么意思
参数,操作,文件(panick)-panick是什么意思
发布时间:2016-12-08加入收藏来源:互联网点击:
–stack:添加错误堆栈追踪。
–switch-to-rbr:让gh-ost自动将从库的binlog_format转换为ROW格式。
–table string:表名
–test-on-replica:在从库上测试gh-ost,包括在从库上数据迁移(migration),数据迁移完成后stop slave,原表和ghost表立刻交换而后立刻交换回来。继续保持stop slave,使你可以对比两张表。
–test-on-replica-skip-replica-stop:当-test-on-replica执行时,该参数表示该过程中不用stop slave。
–throttle-additional-flag-file string:当该文件被创建后,gh-ost操作立即停止。该参数可以用在多个gh-ost同时操作的时候,创建一个文件,让所有的gh-ost操作停止,或者删除这个文件,让所有的gh-ost操作恢复。
–throttle-control-replicas string:列出所有需要被检查主从复制延迟的从库。
–throttle-flag-file string:当该文件被创建后,gh-ost操作立即停止。该参数适合控制单个gh-ost操作。-throttle-additional-flag-file string适合控制多个gh-ost操作。
–throttle-http string
–throttle-query string:节流查询。每秒钟执行一次。当返回值=0时不需要节流,当返回值0时,需要执行节流操作。该查询会在数据迁移(migrated)服务器上操作,所以请确保该查询是轻量级的。
–timestamp-old-table:在旧表名中使用时间戳。 这会使旧表名称具有唯一且无冲突的交叉迁移
–tungsten:告诉gh-ost你正在运行的是一个tungsten-replication拓扑结构。
–user string :MYSQL用户
–verbose
–version
二、主库模式1、常用命令
gh-ost \--max-load=Threads_running=20 \--critical-load=Threads_running=50 \--critical-load-interval-millis=5000 \--chunk-size=1000 \--user="root" \--password="qcloud@2018" \--host='127.0.0.1' \--port=3306 \--database="wjq" \--table="employees" \--verbose \--alter="engine=innodb" \--assume-rbr \--cut-over=default \--cut-over-lock-timeout-seconds=1 \--dml-batch-size=10 \--allow-on-master \--concurrent-rowcount \--default-retries=10 \--heartbeat-interval-millis=2000 \--panic-flag-file=/tmp/ghost.panic.flag \--postpone-cut-over-flag-file=/tmp/ghost.postpone.flag \--timestamp-old-table \--execute 2&1 | tee /tmp/rebuild_employees.log2、输出日志分析
GH-OST会输出一些关键详细信息,让你了解整个迁移过程。当然,你可以控制输出级别。
–verbose:常用,有用的输出,而不是一切。
–debug:输出所有一切。
日志信息如下:
2019-12-07 22:43:58 INFO starting gh-ost 1.0.482019-12-07 22:43:58 INFO Migrating `wjq`.`employees`2019-12-07 22:43:58 INFO connection validated on 127.0.0.1:33062019-12-07 22:43:58 INFO User has ALL privileges2019-12-07 22:43:58 INFO binary logs validated on 127.0.0.1:33062019-12-07 22:43:58 INFO Inspector initiated on wjq:3306, version 5.7.19-log2019-12-07 22:43:58 INFO Table found. Engine=InnoDB2019-12-07 22:44:01 INFO Estimated number of rows via EXPLAIN: 2993872019-12-07 22:44:01 INFO Recursively searching for replication master2019-12-07 22:44:01 INFO Master found to be wjq:33062019-12-07 22:44:01 INFO log_slave_updates validated on 127.0.0.1:33062019-12-07 22:44:01 INFO connection validated on 127.0.0.1:33062019-12-07 22:44:01 INFO Connecting binlog streamer at mysql3306.000064:8255879[2019/12/07 22:44:01] [info] binlogsyncer.go:133 create BinlogSyncer with config {99999 mysql 127.0.0.1 3306 root false false false UTC true 0 0s 0s 0 false}[2019/12/07 22:44:01] [info] binlogsyncer.go:354 begin to sync binlog from position (mysql3306.000064, 8255879)[2019/12/07 22:44:01] [info] binlogsyncer.go:203 register slave for master server 127.0.0.1:33062019-12-07 22:44:01 INFO connection validated on 127.0.0.1:33062019-12-07 22:44:01 INFO connection validated on 127.0.0.1:33062019-12-07 22:44:01 INFO will use time_zone='SYSTEM' on applier2019-12-07 22:44:01 INFO Examining table structure on applier2019-12-07 22:44:01 INFO Applier initiated on wjq:3306, version 5.7.19-log2019-12-07 22:44:01 INFO Dropping table `wjq`.`_employees_ghc`2019-12-07 22:44:01 INFO Table dropped2019-12-07 22:44:01 INFO Creating changelog table `wjq`.`_employees_ghc`2019-12-07 22:44:01 INFO rotate to next log from mysql3306.000064:0 to mysql3306.000064[2019/12/07 22:44:01] [info] binlogsyncer.go:723 rotate to (mysql3306.000064, 8255879)2019-12-07 22:44:01 INFO Changelog table created2019-12-07 22:44:01 INFO Creating ghost table `wjq`.`_employees_gho`2019-12-07 22:44:01 INFO Ghost table created2019-12-07 22:44:01 INFO Altering ghost table `wjq`.`_employees_gho`2019-12-07 22:44:01 INFO Ghost table altered2019-12-07 22:44:01 INFO Intercepted changelog state GhostTableMigrated2019-12-07 22:44:01 INFO Created postpone-cut-over-flag-file: /tmp/ghost.postpone.flag2019-12-07 22:44:01 INFO Waiting for ghost table to be migrated. Current lag is 0s2019-12-07 22:44:01 INFO Handled changelog state GhostTableMigrated2019-12-07 22:44:01 INFO Chosen shared unique key is PRIMARY2019-12-07 22:44:01 INFO Shared columns are emp_no,birth_date,first_name,last_name,gender,hire_date,testcol1,count2019-12-07 22:44:01 INFO Listening on unix socket file: /tmp/gh-ost.wjq.employees.sock2019-12-07 22:44:01 INFO Migration min values: [10001]2019-12-07 22:44:01 INFO Migration max values: [499999]2019-12-07 22:44:01 INFO Waiting for first throttle metrics to be collected2019-12-07 22:44:01 ERROR parsing time "" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "" as "2006"2019-12-07 22:44:01 INFO First throttle metrics collected# Migrating `wjq`.`employees`; Ghost table is `wjq`.`_employees_gho`# Migrating wjq:3306; inspecting wjq:3306; executing on wjq# Migration started at Sat Dec 07 22:43:58 +0800 2019# chunk-size: 1000; max-lag-millis: 1500ms; dml-batch-size: 10; max-load: Threads_running=20; critical-load: Threads_running=50; nice-ratio: 0.000000# throttle-additional-flag-file: /tmp/gh-ost.throttle # postpone-cut-over-flag-file: /tmp/ghost.postpone.flag [set]# panic-flag-file: /tmp/ghost.panic.flag# Serving on unix socket: /tmp/gh-ost.wjq.employees.sock这些信息是GH-OST相对自我解释,他们大多表示一切顺利。你将主要关注迁移并了解其是否顺利进行。一旦迁移实际开始,你将看到如下输出。
Copy: 0/299387 0.0%; Applied: 0; Backlog: 0/1000; Time: 3s(total), 0s(copy); streamer: mysql3306.000064:8257599; State: migrating; ETA: N/ACopy: 0/299387 0.0%; Applied: 0; Backlog: 0/1000; Time: 4s(total), 1s(copy); streamer: mysql3306.000064:8258392; State: migrating; ETA: N/ACopy: 7000/299387 2.3%; Applied: 0; Backlog: 0/1000; Time: 5s(total), 2s(copy); streamer: mysql3306.000064:8454005; State: migrating; ETA: 1m25sCopy: 16000/299387 5.3%; Applied: 0; Backlog: 0/1000; Time: 6s(total), 3s(copy); streamer: mysql3306.000064:8704252; State: migrating; ETA: 53sCopy: 32000/299387 10.7%; Applied: 0; Backlog: 0/1000; Time: 7s(total), 4s(copy); streamer: mysql3306.000064:9149375; State: migrating; ETA: 33sCopy: 48000/299387 16.0%; Applied: 0; Backlog: 0/1000; Time: 8s(total), 5s(copy); streamer: mysql3306.000064:9593805; State: migrating; ETA: 26sCopy: 64000/299387 21.4%; Applied: 0; Backlog: 0/1000; Time: 9s(total), 6s(copy); streamer: mysql3306.000064:10038647; State: migrating; ETA: 22sCopy: 79000/299387 26.4%; Applied: 0; Backlog: 0/1000; Time: 10s(total), 7s(copy); streamer: mysql3306.000064:10455500; State: migrating; ETA: 19sCopy: 95000/299387 31.7%; Applied: 0; Backlog: 0/1000; Time: 11s(total), 8s(copy); streamer: mysql3306.000064:10900454; State: migrating; ETA: 17sCopy: 113000/299387 37.7%; Applied: 0; Backlog: 0/1000; Time: 12s(total), 9s(copy); streamer: mysql3306.000064:11400683; State: migrating; ETA: 14sCopy: 128000/299387 42.8%; Applied: 0; Backlog: 0/1000; Time: 13s(total), 10s(copy); streamer: mysql3306.000064:11817995; State: migrating; ETA: 13sCopy: 143000/299387 47.8%; Applied: 0; Backlog: 0/1000; Time: 14s(total), 11s(copy); streamer: mysql3306.000064:12262961; State: migrating; ETA: 12sCopy: 157000/299387 52.4%; Applied: 0; Backlog: 0/1000; Time: 15s(total), 12s(copy); streamer: mysql3306.000064:12624284; State: migrating; ETA: 10sCopy: 174000/299387 58.1%; Applied: 0; Backlog: 0/1000; Time: 16s(total), 13s(copy); streamer: mysql3306.000064:13096505; State: migrating; ETA: 9sCopy: 189000/299387 63.1%; Applied: 0; Backlog: 0/1000; Time: 17s(total), 14s(copy); streamer: mysql3306.000064:13513590; State: migrating; ETA: 8sCopy: 204000/299387 68.1%; Applied: 0; Backlog: 0/1000; Time: 18s(total), 15s(copy); streamer: mysql3306.000064:13931136; State: migrating; ETA: 7sCopy: 214000/299387 71.5%; Applied: 0; Backlog: 0/1000; Time: 19s(total), 16s(copy); streamer: mysql3306.000064:14209235; State: migrating; ETA: 6sCopy: 229000/299387 76.5%; Applied: 0; Backlog: 0/1000; Time: 20s(total), 17s(copy); streamer: mysql3306.000064:14626242; State: migrating; ETA: 5sCopy: 246000/299387 82.2%; Applied: 0; Backlog: 0/1000; Time: 21s(total), 18s(copy); streamer: mysql3306.000064:15098735; State: migrating; ETA: 3sCopy: 259000/299387 86.5%; Applied: 0; Backlog: 0/1000; Time: 22s(total), 19s(copy); streamer: mysql3306.000064:15460181; State: migrating; ETA: 2sCopy: 277000/299387 92.5%; Applied: 0; Backlog: 0/1000; Time: 23s(total), 20s(copy); streamer: mysql3306.000064:15960640; State: migrating; ETA: 1sCopy: 292000/299387 97.5%; Applied: 0; Backlog: 0/1000; Time: 24s(total), 21s(copy); streamer: mysql3306.000064:16377900; State: migrating; ETA: 0s2019-12-07 22:44:23 INFO Row copy complete下一篇:返回列表
相关链接 |
||
网友回复(共有 0 条回复) |