Re: How to configure HBase in a HA mode?
Hey Alexandr, In that case, you'd use what you have set in your hdfs-site.xml for the dfs.nameservices property (followed by the HBase directory under HDFS). -Dima On Thu, Aug 4, 2016 at 12:54 PM, Alexandr Porunov < alexandr.poru...@gmail.com> wrote: > Hello, > > I don't understand one parameter from hbase-site.xml : > > > hbase.rootdir > hdfs://hdfsHost:8020/hbase > > > What we have to put in that parameter if we configured HDFS cluster in HA > mode? I mean we have 2 name nodes (nn1, nn2) and 2 data nodes (dn1, dn2) > then which node we have to use in "hbase.rootdir" parameter? > > The most logical answer is the name node which is currently active. But if > we will use active name node and it fails then hbase cluster becomes > unavailable even if our nn2 will change its status to active. Hbase cluster > will not understand that we have changed our active NN. > > Moreover, I have configured HBase cluster with the following parameter: > > > hbase.rootdir > hdfs://nn1:8020/hbase > > > It doesn't work. > 1. HMaster starts > 2. I put "http://nn1:16010; into browser > 3. HMaster disappears > > Here is my logs/hbase-hadoop-master-nn1.log : > http://paste.openstack.org/show/549232/ > > Please, help me to find out how to configure it > > Sincerely, > > Alexandr > -- -Dima
Re: query multiple specified columns using filterlist
I've tried FilterList. But the valueFilter('hello kitty') filters the cells out which value not match 'hello kitty', and only 'hello kitty' in each row returns, other column will not return either. So 'AND' in this way is not essential. Ted Yu于2016年8月4日周四 下午5:13写道: > You can use FilterList to put the filters together: > > public FilterList(final Operator operator) { > > AND -> MUST_PASS_ALL > > On Thu, Aug 4, 2016 at 2:07 AM, 乔彦克 wrote: > > > Thanks for the advice, Ted. > > I have the column prefix and the column value( in fact these two filters > > are are in the same column), but don't have the column name, so I can't > use > > SingleColumnValueFilter. > > *Now I use two qualifierFilters and a ColumnPrefixFilter to specify three > > columns, and a value filter to filter the values. The logical between > these > > Filters are 'OR', but what I want is 'AND'? Is there some ways to help > me > > with that? Below is the filters I used.* > > > > QualifierFilter qfilter = new > > QualifierFilter(CompareFilter.CompareOp.EQUAL, new > > BinaryComparator(Bytes.toBytes("qualifier1"))); > > QualifierFilter qfilter2 = new > > QualifierFilter(CompareFilter.CompareOp.EQUAL, new > > BinaryComparator(Bytes.toBytes("qualifier2"))); > > > > // *'e:cat' is the column prefix, and 'hello kitty' is the value of > > 'e:cat?' column* > > > > ColumnPrefixFilter columnPrefixFilter = new > > ColumnPrefixFilter(Bytes.toBytes("e:cat")); > > > > Filter valueFilter = new ValueFilter(CompareFilter.CompareOp.EQUAL, > > new BinaryComparator( > > Bytes.toBytes("hello kitty"))); > > > > > > > > Ted Yu 于2016年8月4日周四 上午11:56写道: > > > > > For selecting column with same prefix, consider using > ColumnPrefixFilter. > > > > > > For filtering value, consider using SingleColumnValueFilter. > > > > > > On Wed, Aug 3, 2016 at 7:52 PM, 乔彦克 wrote: > > > > > > > Thanks for your reply, Ted. > > > > Addition, if I want to filter another column -- one or many columns > > with > > > > one same column prefix, how can I deal with the filter or filter > list. > > > what > > > > if I have to filter a value from the columns, beside to use > > valueFilter, > > > is > > > > there another filter or filter to query this? > > > > > > > > eg: column prefix :* e:cat*, > > > > specified columns maybe: *e:cat1, e:cat2, e:cat3,* > > > > the value :* 'hello kitty' ,* > > > > > > > > Any advice is appreciated! > > > > QiaoYanke > > > > > > > > > > > > Ted Yu 于2016年8月3日周三 上午3:15写道: > > > > > > > > > You can use the following method of Scan to specify columns to > > > retrieve: > > > > > > > > > > public Scan addColumn(byte [] family, byte [] qualifier) { > > > > > > > > > > w.r.t. value comparison with cf:c3 column, consider using > > > > > SingleColumnValueFilter. > > > > > > > > > > Cheers > > > > > > > > > > On Mon, Aug 1, 2016 at 6:56 PM, 乔彦克 wrote: > > > > > > > > > > > Hi all, > > > > > > > > > > > > Currently I am using HBase client api to fetch data from HBase, > > and I > > > > > want > > > > > > to get 3 columns (cf:c1,cf:c2,cf:c3), and some value equals cf:c3 > > > > column, > > > > > > But I don't know how to construct the filterList to achieve this, > > So > > > > How > > > > > > can I do with that? > > > > > > Any suggestion will be appreciated! > > > > > > > > > > > > > > > > > > Best Regards, > > > > > > QiaoYanke > > > > > > > > > > > > > > > > > > > > >
Re: query multiple specified columns using filterlist
You can use FilterList to put the filters together: public FilterList(final Operator operator) { AND -> MUST_PASS_ALL On Thu, Aug 4, 2016 at 2:07 AM, 乔彦克wrote: > Thanks for the advice, Ted. > I have the column prefix and the column value( in fact these two filters > are are in the same column), but don't have the column name, so I can't use > SingleColumnValueFilter. > *Now I use two qualifierFilters and a ColumnPrefixFilter to specify three > columns, and a value filter to filter the values. The logical between these > Filters are 'OR', but what I want is 'AND'? Is there some ways to help me > with that? Below is the filters I used.* > > QualifierFilter qfilter = new > QualifierFilter(CompareFilter.CompareOp.EQUAL, new > BinaryComparator(Bytes.toBytes("qualifier1"))); > QualifierFilter qfilter2 = new > QualifierFilter(CompareFilter.CompareOp.EQUAL, new > BinaryComparator(Bytes.toBytes("qualifier2"))); > > // *'e:cat' is the column prefix, and 'hello kitty' is the value of > 'e:cat?' column* > > ColumnPrefixFilter columnPrefixFilter = new > ColumnPrefixFilter(Bytes.toBytes("e:cat")); > > Filter valueFilter = new ValueFilter(CompareFilter.CompareOp.EQUAL, > new BinaryComparator( > Bytes.toBytes("hello kitty"))); > > > > Ted Yu 于2016年8月4日周四 上午11:56写道: > > > For selecting column with same prefix, consider using ColumnPrefixFilter. > > > > For filtering value, consider using SingleColumnValueFilter. > > > > On Wed, Aug 3, 2016 at 7:52 PM, 乔彦克 wrote: > > > > > Thanks for your reply, Ted. > > > Addition, if I want to filter another column -- one or many columns > with > > > one same column prefix, how can I deal with the filter or filter list. > > what > > > if I have to filter a value from the columns, beside to use > valueFilter, > > is > > > there another filter or filter to query this? > > > > > > eg: column prefix :* e:cat*, > > > specified columns maybe: *e:cat1, e:cat2, e:cat3,* > > > the value :* 'hello kitty' ,* > > > > > > Any advice is appreciated! > > > QiaoYanke > > > > > > > > > Ted Yu 于2016年8月3日周三 上午3:15写道: > > > > > > > You can use the following method of Scan to specify columns to > > retrieve: > > > > > > > > public Scan addColumn(byte [] family, byte [] qualifier) { > > > > > > > > w.r.t. value comparison with cf:c3 column, consider using > > > > SingleColumnValueFilter. > > > > > > > > Cheers > > > > > > > > On Mon, Aug 1, 2016 at 6:56 PM, 乔彦克 wrote: > > > > > > > > > Hi all, > > > > > > > > > > Currently I am using HBase client api to fetch data from HBase, > and I > > > > want > > > > > to get 3 columns (cf:c1,cf:c2,cf:c3), and some value equals cf:c3 > > > column, > > > > > But I don't know how to construct the filterList to achieve this, > So > > > How > > > > > can I do with that? > > > > > Any suggestion will be appreciated! > > > > > > > > > > > > > > > Best Regards, > > > > > QiaoYanke > > > > > > > > > > > > > > >
Re: query multiple specified columns using filterlist
Thanks for the advice, Ted. I have the column prefix and the column value( in fact these two filters are are in the same column), but don't have the column name, so I can't use SingleColumnValueFilter. *Now I use two qualifierFilters and a ColumnPrefixFilter to specify three columns, and a value filter to filter the values. The logical between these Filters are 'OR', but what I want is 'AND'? Is there some ways to help me with that? Below is the filters I used.* QualifierFilter qfilter = new QualifierFilter(CompareFilter.CompareOp.EQUAL, new BinaryComparator(Bytes.toBytes("qualifier1"))); QualifierFilter qfilter2 = new QualifierFilter(CompareFilter.CompareOp.EQUAL, new BinaryComparator(Bytes.toBytes("qualifier2"))); // *'e:cat' is the column prefix, and 'hello kitty' is the value of 'e:cat?' column* ColumnPrefixFilter columnPrefixFilter = new ColumnPrefixFilter(Bytes.toBytes("e:cat")); Filter valueFilter = new ValueFilter(CompareFilter.CompareOp.EQUAL, new BinaryComparator( Bytes.toBytes("hello kitty"))); Ted Yu于2016年8月4日周四 上午11:56写道: > For selecting column with same prefix, consider using ColumnPrefixFilter. > > For filtering value, consider using SingleColumnValueFilter. > > On Wed, Aug 3, 2016 at 7:52 PM, 乔彦克 wrote: > > > Thanks for your reply, Ted. > > Addition, if I want to filter another column -- one or many columns with > > one same column prefix, how can I deal with the filter or filter list. > what > > if I have to filter a value from the columns, beside to use valueFilter, > is > > there another filter or filter to query this? > > > > eg: column prefix :* e:cat*, > > specified columns maybe: *e:cat1, e:cat2, e:cat3,* > > the value :* 'hello kitty' ,* > > > > Any advice is appreciated! > > QiaoYanke > > > > > > Ted Yu 于2016年8月3日周三 上午3:15写道: > > > > > You can use the following method of Scan to specify columns to > retrieve: > > > > > > public Scan addColumn(byte [] family, byte [] qualifier) { > > > > > > w.r.t. value comparison with cf:c3 column, consider using > > > SingleColumnValueFilter. > > > > > > Cheers > > > > > > On Mon, Aug 1, 2016 at 6:56 PM, 乔彦克 wrote: > > > > > > > Hi all, > > > > > > > > Currently I am using HBase client api to fetch data from HBase, and I > > > want > > > > to get 3 columns (cf:c1,cf:c2,cf:c3), and some value equals cf:c3 > > column, > > > > But I don't know how to construct the filterList to achieve this, So > > How > > > > can I do with that? > > > > Any suggestion will be appreciated! > > > > > > > > > > > > Best Regards, > > > > QiaoYanke > > > > > > > > > >