Skip to content

Commit

Permalink
Merge pull request #112 from Teingi/master
Browse files Browse the repository at this point in the history
release 1.6.1
  • Loading branch information
Teingi authored Mar 8, 2024
2 parents db32c94 + 99eedec commit a633c67
Show file tree
Hide file tree
Showing 21 changed files with 456 additions and 23 deletions.
4 changes: 2 additions & 2 deletions handler/analyzer/analyze_flt_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def handle_from_node(node):
for node in self.nodes:
handle_from_node(node)
else:
local_ip = get_localhost_inner_ip()
local_ip = '127.0.0.1'
node = self.nodes[0]
node["ip"] = local_ip
handle_from_node(node)
Expand All @@ -93,7 +93,7 @@ def __handle_from_node(self, node, old_files, local_store_parent_dir):
"skip": False,
"error": ""
}
remote_ip = node.get("ip") if self.is_ssh else get_localhost_inner_ip()
remote_ip = node.get("ip") if self.is_ssh else '127.0.0.1'
remote_user = node.get("user")
remote_password = node.get("password")
remote_port = node.get("port")
Expand Down
4 changes: 2 additions & 2 deletions handler/analyzer/analyze_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def handle_from_node(node):
for node in self.nodes:
handle_from_node(node)
else:
local_ip = get_localhost_inner_ip()
local_ip = '127.0.0.1'
node = self.nodes[0]
node["ip"] = local_ip
handle_from_node(node)
Expand All @@ -108,7 +108,7 @@ def __handle_from_node(self, node, local_store_parent_dir):
"error": ""
}
node_results = []
remote_ip = node.get("ip") if self.is_ssh else get_localhost_inner_ip()
remote_ip = node.get("ip") if self.is_ssh else '127.0.0.1'
remote_user = node.get("user")
remote_password = node.get("password")
remote_port = node.get("port")
Expand Down
2 changes: 1 addition & 1 deletion handler/gather/scenes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __execute_yaml_mode(self, nodes):
return "Unadapted by version.SKIP"
logger.info("filter_by_version is return {0}".format(steps_nu))
if len(nodes)==0:
logger.error("node is not exist")
logger.warn("node is not exist")
return
node_number = 0
for node in nodes:
Expand Down
3 changes: 1 addition & 2 deletions handler/gather/step/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def execute(self):
columns, data = self.ob_connector.execute_sql_return_columns_and_data(sql)
if data is None or len(data) == 0:
logger.warning("excute sql: {0}, result is None".format(sql))
else:
self.report(sql, columns, data)
self.report(sql, columns, data)
except Exception as e:
logger.error("StepSQLHandler execute Exception: {0}".format(e).strip())

Expand Down
23 changes: 22 additions & 1 deletion handler/gather/tasks/observer/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,26 @@ task:
sql: "SELECT * FROM oceanbase.__all_zone WHERE name='idc';"
global: true
- type: sql
sql: "SELECT id,svr_ip,svr_port,zone,inner_port,with_rootserver,status,start_service_time,last_offline_time FROM oceanbase.__all_server;"
sql: "select svr_ip,zone,with_rootserver,status,block_migrate_in_time,start_service_time,stop_time,build_version from oceanbase.__all_server order by zone;"
global: true
- type: sql
sql: "SELECT zone, concat(svr_ip, ':', svr_port) observer, cpu_capacity, cpu_total, cpu_assigned, cpu_assigned_percent, mem_capacity, mem_total, mem_assigned, mem_assigned_percent, unit_Num, round(`load`, 2) `load`, round(cpu_weight, 2) cpu_weight, round(memory_weight, 2) mem_weight, leader_count FROM oceanbase.__all_virtual_server_stat ORDER BY zone,svr_ip;"
global: true
- type: sql
sql: "select tenant_id,tenant_name,primary_zone,compatibility_mode from oceanbase.__all_tenant;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "select count(*),tenant_id,zone_list,unit_count from oceanbase.__all_resource_pool group by tenant_id,zone_list,unit_count;"
global: true
- type: sql
sql: "show parameters like '%auto_delete_expired_backup%';"
global: true
- type: sql
sql: "select * from oceanbase.__all_virtual_backup_task;"
global: true
Expand Down Expand Up @@ -75,6 +90,12 @@ task:
- type: sql
sql: "SELECT a.TENANT_NAME,a.TENANT_ID,b.SVR_IP FROM oceanbase.DBA_OB_TENANTS a, oceanbase.GV$OB_UNITS b WHERE a.TENANT_ID=b.TENANT_ID;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "show parameters like '%backup%';"
global: true
Expand Down
20 changes: 19 additions & 1 deletion handler/gather/tasks/observer/backup_clean.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ task:
sql: "SELECT * FROM oceanbase.__all_zone WHERE name='idc';"
global: true
- type: sql
sql: "SELECT id,svr_ip,svr_port,zone,inner_port,with_rootserver,status,start_service_time,last_offline_time FROM oceanbase.__all_server;"
sql: "select svr_ip,zone,with_rootserver,status,block_migrate_in_time,start_service_time,stop_time,build_version from oceanbase.__all_server order by zone;"
global: true
- type: sql
sql: "SELECT zone, concat(svr_ip, ':', svr_port) observer, cpu_capacity, cpu_total, cpu_assigned, cpu_assigned_percent, mem_capacity, mem_total, mem_assigned, mem_assigned_percent, unit_Num, round(`load`, 2) `load`, round(cpu_weight, 2) cpu_weight, round(memory_weight, 2) mem_weight, leader_count FROM oceanbase.__all_virtual_server_stat ORDER BY zone,svr_ip;"
global: true
- type: sql
sql: "select tenant_id,tenant_name,primary_zone,compatibility_mode from oceanbase.__all_tenant;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "select count(*),tenant_id,zone_list,unit_count from oceanbase.__all_resource_pool group by tenant_id,zone_list,unit_count;"
global: true
- type: sql
sql: "show parameters like '%backup_dest%';"
global: true
Expand Down Expand Up @@ -84,6 +96,12 @@ task:
- type: sql
sql: "SELECT a.TENANT_NAME,a.TENANT_ID,b.SVR_IP FROM oceanbase.DBA_OB_TENANTS a, oceanbase.GV$OB_UNITS b WHERE a.TENANT_ID=b.TENANT_ID;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "show parameters like '%backup%';"
global: true
Expand Down
26 changes: 25 additions & 1 deletion handler/gather/tasks/observer/clog_disk_full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ task:
sql: "SELECT * FROM oceanbase.__all_zone WHERE name='idc';"
global: true
- type: sql
sql: "SELECT id,svr_ip,svr_port,zone,inner_port,with_rootserver,status,start_service_time,last_offline_time FROM oceanbase.__all_server;"
sql: "select svr_ip,zone,with_rootserver,status,block_migrate_in_time,start_service_time,stop_time,build_version from oceanbase.__all_server order by zone;"
global: true
- type: sql
sql: "SELECT zone, concat(svr_ip, ':', svr_port) observer, cpu_capacity, cpu_total, cpu_assigned, cpu_assigned_percent, mem_capacity, mem_total, mem_assigned, mem_assigned_percent, unit_Num, round(`load`, 2) `load`, round(cpu_weight, 2) cpu_weight, round(memory_weight, 2) mem_weight, leader_count FROM oceanbase.__all_virtual_server_stat ORDER BY zone,svr_ip;"
global: true
- type: sql
sql: "select tenant_id,tenant_name,primary_zone,compatibility_mode from oceanbase.__all_tenant;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "select count(*),tenant_id,zone_list,unit_count from oceanbase.__all_resource_pool group by tenant_id,zone_list,unit_count;"
global: true
- type: sql
sql: "show parameters like '%clog_disk_usage_limit_percentage%';"
global: true
Expand All @@ -31,6 +43,9 @@ task:
- type: sql
sql: "select * from oceanbase.__all_virtual_tenant_memstore_info where (active_memstore_used > major_freeze_trigger) or (total_memstore_used > memstore_limit);"
global: true
- type: sql
sql: "select t.tenant_name, t1.database_name, round(sum(t2.data_size)/1024/1024/1024,2) as data_size_gb, round(sum(t2.required_size)/1024/1024/1024,2) as required_size_gb from oceanbase.dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2 where t.tenant_id=t1.tenant_id and t1.svr_ip=t2.svr_ip and t1.tenant_id=t2.tenant_id and t1.ls_id=t2.ls_id and t1.tablet_id=t2.tablet_id and t1.role='leader' group by t.tenant_name, t1.database_name order by data_size_gb desc;"
global: true
- type: sql
sql: "select svr_ip,total_size / 1024 / 1024 / 1024 total_G,free_size / 1024 / 1024 / 1024 free_G,(total_size - free_size) / 1024 / 1024 / 1024 used_G,(total_size - free_size) / total_size used_percentage FROM oceanbase.__all_virtual_disk_stat; "
global: true
Expand Down Expand Up @@ -66,6 +81,12 @@ task:
- type: sql
sql: "SELECT a.TENANT_NAME,a.TENANT_ID,b.SVR_IP FROM oceanbase.DBA_OB_TENANTS a, oceanbase.GV$OB_UNITS b WHERE a.TENANT_ID=b.TENANT_ID;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "show parameters like '%clog%';"
global: true
Expand All @@ -84,6 +105,9 @@ task:
- type: sql
sql: "select * from oceanbase.DBA_OB_SERVER_EVENT_HISTORY where event like '%migrat%' and name6 like '%fail%' and value6=1;"
global: true
- type: ssh
ssh: "df -h"
global: false
- type: log
global: false
grep: ""
24 changes: 24 additions & 0 deletions handler/gather/tasks/observer/cluster_down.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
info_en: "[cluster down]"
info_cn: "[集群无法连接]"
command: obdiag gather scene run --scene=observer.cluster_down
task:
- version: "[2.0.0.0, *]"
steps:
- type: ssh
ssh: "ps -ef | grep observer"
global: false
- type: ssh
ssh: "cat /proc/sys/kernel/core_pattern"
global: false
- type: ssh
ssh: "ls -lhrt ${observer_data_dir}"
global: false
- type: ssh
ssh: "df -h"
global: false
- type: log
grep: ""
global: false
- type: sysstat
global: false
sysstat: ""
23 changes: 22 additions & 1 deletion handler/gather/tasks/observer/compaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ task:
sql: "SELECT * FROM oceanbase.__all_zone WHERE name='idc';"
global: true
- type: sql
sql: "SELECT id,svr_ip,svr_port,zone,inner_port,with_rootserver,status,start_service_time,last_offline_time FROM oceanbase.__all_server;"
sql: "select svr_ip,zone,with_rootserver,status,block_migrate_in_time,start_service_time,stop_time,build_version from oceanbase.__all_server order by zone;"
global: true
- type: sql
sql: "SELECT zone, concat(svr_ip, ':', svr_port) observer, cpu_capacity, cpu_total, cpu_assigned, cpu_assigned_percent, mem_capacity, mem_total, mem_assigned, mem_assigned_percent, unit_Num, round(`load`, 2) `load`, round(cpu_weight, 2) cpu_weight, round(memory_weight, 2) mem_weight, leader_count FROM oceanbase.__all_virtual_server_stat ORDER BY zone,svr_ip;"
global: true
- type: sql
sql: "select tenant_id,tenant_name,primary_zone,compatibility_mode from oceanbase.__all_tenant;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "select count(*),tenant_id,zone_list,unit_count from oceanbase.__all_resource_pool group by tenant_id,zone_list,unit_count;"
global: true
- type: sql
sql: "show parameters like '%enable_manual_merge%';"
global: true
Expand Down Expand Up @@ -120,6 +132,12 @@ task:
- type: sql
sql: "SELECT a.TENANT_NAME,a.TENANT_ID,b.SVR_IP FROM oceanbase.DBA_OB_TENANTS a, oceanbase.GV$OB_UNITS b WHERE a.TENANT_ID=b.TENANT_ID;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "show parameters like '%merge%';"
global: true
Expand All @@ -129,6 +147,9 @@ task:
- type: sql
sql: "show parameters like 'freeze_trigger_percentage';"
global: true
- type: sql
sql: "select t.tenant_name, t1.database_name, round(sum(t2.data_size)/1024/1024/1024,2) as data_size_gb, round(sum(t2.required_size)/1024/1024/1024,2) as required_size_gb from oceanbase.dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2 where t.tenant_id=t1.tenant_id and t1.svr_ip=t2.svr_ip and t1.tenant_id=t2.tenant_id and t1.ls_id=t2.ls_id and t1.tablet_id=t2.tablet_id and t1.role='leader' group by t.tenant_name, t1.database_name order by data_size_gb desc;"
global: true
- type: log
global: false
grep: ""
20 changes: 19 additions & 1 deletion handler/gather/tasks/observer/delay_of_primary_and_backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ task:
sql: "SELECT * FROM oceanbase.__all_zone WHERE name='idc';"
global: true
- type: sql
sql: "SELECT id,svr_ip,svr_port,zone,inner_port,with_rootserver,status,start_service_time,last_offline_time FROM oceanbase.__all_server;"
sql: "select svr_ip,zone,with_rootserver,status,block_migrate_in_time,start_service_time,stop_time,build_version from oceanbase.__all_server order by zone;"
global: true
- type: sql
sql: "SELECT zone, concat(svr_ip, ':', svr_port) observer, cpu_capacity, cpu_total, cpu_assigned, cpu_assigned_percent, mem_capacity, mem_total, mem_assigned, mem_assigned_percent, unit_Num, round(`load`, 2) `load`, round(cpu_weight, 2) cpu_weight, round(memory_weight, 2) mem_weight, leader_count FROM oceanbase.__all_virtual_server_stat ORDER BY zone,svr_ip;"
global: true
- type: sql
sql: "select tenant_id,tenant_name,primary_zone,compatibility_mode from oceanbase.__all_tenant;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "select count(*),tenant_id,zone_list,unit_count from oceanbase.__all_resource_pool group by tenant_id,zone_list,unit_count;"
global: true
- type: sql
sql: "select * from oceanbase.__all_failover_info;"
global: true
Expand Down Expand Up @@ -129,6 +141,12 @@ task:
- type: sql
sql: "SELECT a.TENANT_NAME,a.TENANT_ID,b.SVR_IP FROM oceanbase.DBA_OB_TENANTS a, oceanbase.GV$OB_UNITS b WHERE a.TENANT_ID=b.TENANT_ID;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "show parameters like '%backup%';"
global: true
Expand Down
Loading

0 comments on commit a633c67

Please sign in to comment.