当前位置:网站首页>QianBase Operation and Maintenance Practical Commands

QianBase Operation and Maintenance Practical Commands

2022-08-06 07:52:50post_yuan

  1. Count all startupsESP的MXOSRVR进程及ESP个数
sqps | grep esp| awk '{print $7}' | sort | uniq -c | sort -nk1

示例输出:

      4 $Z000C000EQQ
     10 $Z0007005FFT
     10 $Z000P00035N
     10 $Z000P0020DJ
     12 $Z000P002LWR
     12 $Z000P0046JZ
     16 $Z000800487E
     20 $Z0000004J6N
     20 $Z0000005VTS
     20 $Z0001000QCJ
     20 $Z0001000SMD
     20 $Z0001001NRV
     20 $Z0001002DJW
     20 $Z0001004M98
     20 $Z0001004QB8
     20 $Z0001005LR1
     20 $Z0001006YLX
     20 $Z00020030GX
     20 $Z0002005HJH
     20 $Z0003000DMH
     20 $Z0003000TNS
  1. 统计当前有多少个MXOSRVR启动ESP进程
sqps | grep esp| awk '{print $7}' | sort | uniq | wc -l
  1. 统计当前有多少个ESP进程
sqps | grep esp| awk '{print $6}' | sort | uniq | wc -l
  1. 通过REST API获取连接信息
curl  -X GET -H "Accept: application/json" https://xx.xx.xx.xx:4201/v1/servers/dcs/connections -k
  1. 查看哪些ESP所在的MXOSRVR处于连接状态
curl  -X GET -H "Accept: application/json" https://xx.xx.xx.xx:4201/v1/servers/dcs/connections -k > connections.log
sed 's/,{/,\n{/g' connections.log > connections1.log
sed -n 's/.*"STATE":"\(.*\)","NID".*"PROCESS_NAME":"\(.*\)","IP_ADDRESS".*/\1 \2/p' connections1.log | grep CONNECTED | awk '{print $2}' | sort | uniq > connected_mxosrvr.log
sqps | grep esp| awk '{print $7}' | sort | uniq > hasesps_mxosrvr.log
sort hasesps_mxosrvr.log connected_mxosrvr.log | uniq -d > hasesps_connected_mxosrvr.log
  1. 查看各个节点RegionServer的线程数
edb_pdsh -a "ps -ef | grep 'RegionServer start' | grep -v 'grep' | awk -F ' ' '{print \$2}' | xargs top -b -n 1 -Hp | grep 'Threads'"
  1. Specifies the connection to fixedMXOSRVR
方法一:
export _JAVA_OPTIONS="-Dt4jdbc.specifiedServer=qianbase1.esgyn.cn:23402" 

方法二:
trafci.sh -h qianbase1:23400/:specifiedServer=qianbase1.esgyn.cn:23402 -u trafodion -p traf123
  1. 查看数据库启动时间
grep monitor monitor.map.nodename| grep BEGIN
  1. Collect all logs and HBase日志
cds
./getlogs.sh --hbaselogs
  1. 使用HBase ExportSnapshotInterface backup and recovery table
//备份
snapshot 'TRAF_RSRVD_5:TRAFODION._DTM_.TRAFODION_BINLOG', '36_BINLOG_20220707'
hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot 36_BINLOG_20220707 -copy-from hdfs://10.15.40.39:8020/hbase -copy-to hdfs://xx.xx.xx.xx:8020/hbase -mappers 32 -bandwidth 16384
//恢复
disable 'TRAF_RSRVD_5:TRAFODION._DTM_.TRAFODION_BINLOG'
drop 'TRAF_RSRVD_5:TRAFODION._DTM_.TRAFODION_BINLOG'
restore_snapshot '36_BINLOG_20220707'

  1. View the creation and modification time of the table
SELECT  converttimestamp(create_time)+interval '8' HOUR AS create_time , 
        converttimestamp(redef_time)+interval '8' HOUR AS redef_time
FROM "_MD_".objects AS a WHERE a.object_name=<object_name>;
  1. 修改表的memstore flush size大小
alter table <tablename>  alter hbase_options (MEMSTORE_FLUSH_SIZE='268435456');
  1. View what happens in the database8102table androwkey信息
edb_pdsh -a "cd /var/log/hbase; grep -e 'checkAndPut EXIT - returns' -e 'checkAndPutRegionTx EXIT - returns' *" > /tmp/all.log
sed -n 's/.*in region \(.*TRAFODION.AFA.*\),.*,.*,skey.*/\1/p' /tmp/all.log | sort | uniq
  1. 清除mxosrvr内的querycache及NATable cache
//清除QueryCache
cqd query_cache ‘0;

//清除NATable Cache
方法1:cqd metadata_cache_size ‘0;
方法2delete all from table(natablecache('remove'));
  1. 导出QueryCache
generate user querycache export '/opt/trafodion/cachefile.sql';
  1. 统计所有ESPstart-up time and continuous operation time
edb_pdsh -a "ps -ef | grep tdm_arkesp | grep -v grep | awk '{print \$2}' | xargs ps -o lstart,etime -p"
原网站

版权声明
本文为[post_yuan]所创,转载请带上原文链接,感谢
https://chowdera.com/2022/218/202208060748092518.html

随机推荐