点击上方“IT那活儿”公众号--专注于企业全栈运维技术分享,不管IT什么活儿,干就完了!!!
前言
重启OBServer是OceanBase数据库的常规运维手段。
黑屏操作方式
2.1 租户zone切主
select zone, svr_ip, count(1) partition_cnt from __all_virtual_meta_table where role =1 group by zone,
svr_ip order by partition_cnt desc; --
检查当前主所在的zone
select * from __all_virtual_rebalance_task_stat; --
检查当前是否还有分区迁移任务,无任务说明切主完成
2.2 重启OBServer
ps -ef | grep observer
kill -9 XXXX
ps -ef | grep observer
su - admin
cd /home/admin/oceanbase
/home/admin/oceanbase/bin/observer
ps -ef | grep observer
select svr_ip,with_rootserver rs,zone,
ORA_DECODE(start_service_time, 0, NULL, CAST(usec_to_time(start_service_time) AS DATETIME)) start_service_time,
ORA_DECODE(stop_time, 0, NULL, CAST(usec_to_time(stop_time) AS DATETIME)) stop_time,
ORA_DECODE(last_offline_time, 0, NULL, CAST(usec_to_time(last_offline_time) AS DATETIME)) last_offline_time,status,
SUBSTR(build_version, 1, INSTR(build_version, '-') - 1) build_version FROM __all_server;--
查看重启observer的主机的start_service_time出现了值后,说明observer重启完成了
select svr_ip, svr_port, table_id, partition_idx from __all_virtual_clog_stat where is_in_sync= 0 and is_offline = 0 and replica_type != 16;
select count(*) from __all_virtual_clog_stat where is_in_sync= 0 and is_offline = 0 and replica_type != 16;
--查看当前clog同步情况,count(*)为0说明clog同步完成
2.3 恢复租户的zone优先级
select zone, svr_ip, count(1) partition_cnt from __all_virtual_meta_table where role =1 group by zone, svr_ip order by partition_cnt desc; --
检查当前主所在的zone
select * from __all_virtual_rebalance_task_stat; --
检查当前是否还有分区迁移任务,无任务说明切主完成

本文作者:温志炜(上海新炬中北团队)
本文来源:“IT那活儿”公众号

文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




