未验证 提交 edf25d38 编写于 作者: R Rongfeng Fu 提交者: GitHub

migrate check (#33)

上级 d7aca3cb
...@@ -352,7 +352,7 @@ class ClusterDeployCommand(ClusterMirrorCommand): ...@@ -352,7 +352,7 @@ class ClusterDeployCommand(ClusterMirrorCommand):
self.parser.add_option('-c', '--config', type='string', help="Path to the configuration yaml file.") self.parser.add_option('-c', '--config', type='string', help="Path to the configuration yaml file.")
self.parser.add_option('-f', '--force', action='store_true', help="Force deploy, overwrite the home_path.", default=False) self.parser.add_option('-f', '--force', action='store_true', help="Force deploy, overwrite the home_path.", default=False)
self.parser.add_option('-U', '--unuselibrepo', '--ulp', action='store_true', help="Disable OBD from installing the libs mirror automatically.") self.parser.add_option('-U', '--unuselibrepo', '--ulp', action='store_true', help="Disable OBD from installing the libs mirror automatically.")
self.parser.add_option('-A', '--auto-create-tenant', '--act', action='store_false', help="Disable OBD from creating a tenant named `test` by using all the available resource of the cluster.") self.parser.add_option('-A', '--auto-create-tenant', '--act', action='store_true', help="Disable OBD from creating a tenant named `test` by using all the available resource of the cluster.")
# self.parser.add_option('-F', '--fuzzymatch', action='store_true', help="enable fuzzy match when search package") # self.parser.add_option('-F', '--fuzzymatch', action='store_true', help="enable fuzzy match when search package")
def _do_command(self, obd): def _do_command(self, obd):
......
create resource unit box1 max_cpu 2, max_memory 1073741824, max_iops 128, max_disk_size '5G', max_session_num 64, MIN_CPU=1, MIN_MEMORY=1073741824, MIN_IOPS=128;
create resource pool pool1 unit = 'box1', unit_num = 1;
create tenant ora_tt replica_num = 1, resource_pool_list=('pool1') set ob_tcp_invited_nodes='%', ob_compatibility_mode='oracle';
alter tenant ora_tt set variables autocommit='on';
alter tenant ora_tt set variables nls_date_format='YYYY-MM-DD HH24:MI:SS';
alter tenant ora_tt set variables nls_timestamp_format='YYYY-MM-DD HH24:MI:SS.FF';
alter tenant ora_tt set variables nls_timestamp_tz_format='YYYY-MM-DD HH24:MI:SS.FF TZR TZD';
\ No newline at end of file
system sleep 5;
alter system set balancer_idle_time = '60s';
create user 'admin' IDENTIFIED BY 'admin';
use oceanbase;
create database if not exists test;
use test;
grant all on *.* to 'admin' WITH GRANT OPTION;
set global ob_enable_jit='OFF';
alter system set large_query_threshold='1s';
alter system set syslog_level='info';
alter system set syslog_io_bandwidth_limit='30M';
alter system set trx_try_wait_lock_timeout='0';
alter system set zone_merge_concurrency=0;
alter system set merger_completion_percentage=100;
alter system set trace_log_slow_query_watermark='500ms';
alter system set minor_freeze_times=30;
alter system set clog_sync_time_warn_threshold = '1000ms';
alter system set trace_log_slow_query_watermark = '10s';
alter system set enable_sql_operator_dump = 'false';
alter system set rpc_timeout=1000000000;
create resource unit tpch_box1 min_memory '100g', max_memory '100g', max_disk_size '1000g', max_session_num 64, min_cpu=9, max_cpu=9, max_iops 128, min_iops=128;
create resource pool tpch_pool1 unit = 'tpch_box1', unit_num = 1, zone_list = ('z1', 'z2', 'z3');
create tenant oracle replica_num = 3, resource_pool_list=('tpch_pool1') set ob_tcp_invited_nodes='%', ob_compatibility_mode='oracle';
alter tenant oracle set variables autocommit='on';
alter tenant oracle set variables nls_date_format='yyyy-mm-dd hh24:mi:ss';
alter tenant oracle set variables nls_timestamp_format='yyyy-mm-dd hh24:mi:ss.ff';
alter tenant oracle set variables nls_timestamp_tz_format='yyyy-mm-dd hh24:mi:ss.ff tzr tzd';
alter tenant oracle set variables ob_query_timeout=7200000000;
alter tenant oracle set variables ob_trx_timeout=7200000000;
alter tenant oracle set variables max_allowed_packet=67108864;
alter tenant oracle set variables ob_enable_jit='OFF';
alter tenant oracle set variables ob_sql_work_area_percentage=80;
alter tenant oracle set variables parallel_max_servers=512;
alter tenant oracle set variables parallel_servers_target=512;
select count(*) from oceanbase.__all_server group by zone limit 1 into @num;
set @sql_text = concat('alter resource pool tpch_pool1', ' unit_num = ', @num);
prepare stmt from @sql_text;
execute stmt;
deallocate prepare stmt;
alter session set current_schema = SYS;
create user root IDENTIFIED BY root;
grant all on *.* to root WITH GRANT OPTION;
grant dba to root;
create user test IDENTIFIED BY test;
grant all on *.* to test WITH GRANT OPTION;
grant dba to test;
grant all privileges to test;
create user admin IDENTIFIED BY admin;
grant all on *.* to admin WITH GRANT OPTION;
grant dba to admin;
grant all privileges to admin;
alter user LBACSYS account unlock;
grant all on *.* to LBACSYS WITH GRANT OPTION;
grant dba to LBACSYS;
alter user ORAAUDITOR account unlock;
grant all on *.* to ORAAUDITOR WITH GRANT OPTION;
grant dba to ORAAUDITOR;
alter system set "_enable_split_partition" = 'true';
grant read on directory dd to TEST;
set global secure_file_priv = '';
case 1: commit
show variables like 'autocommit';
Variable_name Value
autocommit ON
drop table if exists t1;
create table t1 (c1 int primary key, c2 varchar(1024));
set autocommit=0;
insert into t1 values (1, '中国');
select * from t1 where c1 = 1 for update;
c1 c2
1 中国
commit;
set autocommit=1;
select * from t1;
c1 c2
1 中国
...@@ -22,6 +22,7 @@ from __future__ import absolute_import, division, print_function ...@@ -22,6 +22,7 @@ from __future__ import absolute_import, division, print_function
import re import re
import time
def parse_size(size): def parse_size(size):
...@@ -108,6 +109,24 @@ def create_tenant(plugin_context, cursor, *args, **kwargs): ...@@ -108,6 +109,24 @@ def create_tenant(plugin_context, cursor, *args, **kwargs):
if unit_num > min_unit_num: if unit_num > min_unit_num:
return error('resource pool unit num is bigger than zone server count') return error('resource pool unit num is bigger than zone server count')
sql = "select count(*) num from oceanbase.__all_server where status = 'active' and start_service_time > 0"
try:
count = 30
while count:
stdio.verbose('execute sql: %s' % sql)
cursor.execute(sql)
num = cursor.fetchone()['num']
if num >= unit_num:
break
count -= 1
time.sleep(1)
if count == 0:
stdio.error('server can not migrate in')
return
except:
exception('execute sql exception: %s' % sql)
return
cpu_total = 0 cpu_total = 0
mem_total = 0 mem_total = 0
disk_total = 0 disk_total = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册