HBase 1.1.2.2.6.0.3-8 TTL设置过之后,无法显示重置为FOREVER

参考:https://www.cnblogs.com/zpb2016/p/12649831.html

一个解决办法见如上链接。

1.如果想重置TTL为'FOREVER'怎么做?
答:HBase TTL 最大值为INT最大值 2147483647,只需将TTL设为该整数即可。

==========================问题=======================================================

1.在HBase 1.1.2  hdp2.6.0.3-8 版本上,安装opentsdb时出现如下问题:

env COMPRESSION=NONE HBASE_HOME=/usr/hdp/2.6.0.3-8/hbase ./src/create_table.sh

TTL输入字符串:“FOREVER”错误

2.查看opentsdb的create_table.sh脚本,发现如下:

HBase 1.1.2.2.6.0.3-8 TTL设置过之后,无法显示重置为FOREVER_第1张图片

此时安装的是官方的最新的opentsdb2.4,不确定是否是hbase版本过低的问题引起的(手里也没有HBASE2.x的环境) 

3.尝试建表后,手动修改ttl:

hbase(main):004:0> alter   'wkz:test',{NAME => 'f', TTL => "FOREVER"}

ERROR: For input string: "FOREVER"

hbase(main):005:0> alter   'wkz:test',{NAME => 'f', TTL => 1111}
Updating all regions with the new schema...
0/1 regions updated.
1/1 regions updated.
Done.
0 row(s) in 3.6420 seconds

hbase(main):003:0> describe 'wkz:test'
Table wkz:test is ENABLED                                                                                                           
wkz:test                                                                                                                            
COLUMN FAMILIES DESCRIPTION                                                                                                         
{NAME => 'f', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NO
NE', TTL => '11111 SECONDS (3 HOURS 5 MINUTES 11 SECONDS)', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKS
IZE => '65536', REPLICATION_SCOPE => '0'}                     
1 row(s) in 0.0340 seconds

发现直接指定TTL => "FOREVER"还是不行

4.最后按照链接方法尝试后,成功

hbase(main):006:0> alter   'wkz:test',{NAME => 'f', TTL => 2147483647}
Updating all regions with the new schema...
0/1 regions updated.
1/1 regions updated.
Done.
0 row(s) in 3.8240 seconds


hbase(main):007:0> describe 'wkz:test'
Table wkz:test is ENABLED                                                                                                           
wkz:test                                                                                                                            
COLUMN FAMILIES DESCRIPTION                                                                                                         
{NAME => 'f', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NO
NE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                          
1 row(s) in 0.0530 seconds

5.遗留问题,hbase ttl在高版本是否可以直接 指定TTL => "FOREVER",不然为啥opentsdb官网的脚本是这样写的。。

 

 

你可能感兴趣的:(大数据运维之hbase日常)