select * from information_schema.innodb_trx
关于MySQL InnoDB存储引擎中的锁
https://www.linuxidc.com/Linux/2014-11/108860.htm
select * from information_schema.innodb_trx
https://www.linuxidc.com/Linux/2014-11/108860.htm
pt-online-schema-change \
--user username \
--password 123456 \
--host x.x.x.x D=db,t=table \
--execute --alter "ADD COLUMN vip_version TINYINT NOT NULL DEFAULT 0" \
--charset utf8mb4 \
--no-version-check \
--nocheck-replication-filters \
--max-load Threads_running=10 \
--critical-load Threads_running=200 \
--chunk-time=0.5
–charset utf8mb4 设置下编码
–max-load Threads_running=10 低负载才运行,设置尽量小点
–critical-load Threads_running=200 终止条件 设置大点防止容易失败
–no-version-check 阿里云rds可能需要此参数
–chunk-time=0.5 这个优于设置chunk-size
–nocheck-replication-filters 有主从配置的时候需要 阿里云rds可能不需要这个参数
public static function runSleep($sec = 10, $echo = null) {
while (true) {
$result = NoThingModel::getInstance()->db->select("show status like 'Threads_running'", [], false);
$result = reset($result);
if ($result) {
if ($result->Variable_name == 'Threads_running') {
if ($result->Value > 10) {
if ($echo) {
echo "sleep 10\n";
}
sleep($sec);
} else {
break;
}
} else {
break;
}
} else {
break;
}
}
}
JDK bin 路径加到PATH环境变量