pinpoint的Hbase数据库的数据优化

pinpoint的Hbase数据库的数据优化

写的原因:
因为是测试服务器,在运行测试项目时,需要日志的打印输出,由于发现磁盘空间不足,想删除些东西,释放空间,然后发现pinpoint服务的Hbase数据库占据了18G空间,其中TraceV2表占据了13G。

解决的方法:
进入Hbase数据库后,使用desc 'TraceV2' 看了TraceV2的表结构,他的一个TTL值默认是60 DAY(这是我按照pinpoint的官方默认表结构),意思是保留60天内的记录,超出后才清理。我就寻思想把这个记录保留时间变为3 DAY。

我写了一个hbase,shell命令文本,是把这里边的表都改为3 day
bin/hbase shell test.hbase

以下是test.habse文本内容。
cat test.hbase

disable 'AgentInfo'
disable 'AgentLifeCycle'
disable 'AgentStatV2'
disable 'ApiMetaData'
disable 'ApplicationIndex'
disable 'ApplicationMapStatisticsCallee_Ver2'
disable 'ApplicationMapStatisticsCaller_Ver2'
disable 'ApplicationMapStatisticsSelf_Ver2'
disable 'ApplicationStatAggre'
disable 'ApplicationTraceIndex'
disable 'HostApplicationMap_Ver2'
disable 'SqlMetaData_Ver2'
disable 'StringMetaData'
disable 'TraceV2'


alter 'AgentEvent',{NAME => 'E',TTL => '259200'}
alter 'AgentInfo',{NAME => 'Info',TTL => '259200'}
alter 'AgentLifeCycle',{NAME => 'S',TTL => '259200'}
alter 'AgentStatV2',{NAME => 'S',TTL => '259200'}
alter 'ApiMetaData',{NAME => 'Api',TTL => '259200'}
alter 'ApplicationIndex',{NAME => 'Agents',TTL => '259200'}
alter 'ApplicationMapStatisticsCallee_Ver2',{NAME => 'C',TTL => '259200'}
alter 'ApplicationMapStatisticsCaller_Ver2',{NAME => 'C',TTL => '259200'}
alter 'ApplicationMapStatisticsSelf_Ver2',{NAME => 'C',TTL => '259200'}
alter 'ApplicationStatAggre',{NAME => 'S',TTL => '259200'}
alter 'ApplicationTraceIndex',{NAME => 'I',TTL => '259200'}
alter 'HostApplicationMap_Ver2',{NAME => 'M',TTL => '259200'}
alter 'SqlMetaData_Ver2',{NAME => 'Sql',TTL => '259200'}
alter 'StringMetaData',{NAME => 'Str',TTL => '259200'}
alter 'TraceV2',{NAME => 'S',TTL => '259200'}



enable 'AgentEvent'
enable 'AgentInfo'
enable 'AgentLifeCycle'
enable 'AgentStatV2'
enable 'ApiMetaData'
enable 'ApplicationIndex'
enable 'ApplicationMapStatisticsCallee_Ver2'
enable 'ApplicationMapStatisticsCaller_Ver2'
enable 'ApplicationMapStatisticsSelf_Ver2'
enable 'ApplicationStatAggre'
enable 'ApplicationTraceIndex'
enable 'HostApplicationMap_Ver2'
enable 'SqlMetaData_Ver2'
enable 'StringMetaData'
enable 'TraceV2'

exit

当执行完后,到hbase数据库目录下看到,使用du -sh *就看到表的大小正在慢慢变小
在这里插入图片描述
这是我的,先前的占用13G变4.1G了。
过一会再看df -h 就能看到磁盘空间被释放

df -h 这个可能等的时间有点点长,因为,它在删除的时候,释放的比较慢,一般不会超出十分钟,除了你当前服务器上的负载有些高

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值