You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bookkeeper.apache.org by ChenWei <sp...@gmail.com> on 2012/11/14 08:21:48 UTC

Password do not work in bookkeeper

Hi everyone,
  I'm using bookkeeper but I meet some problems. When I createLedger by a
password(A) and addEntry into it, everything is OK. And I can open the
ledger with password(A) and read the content. But what's the strange, I can
open the ledger with any password. Can anyone tell me what's the possible
reason? I notice that in the document of Release 4.1, the password argument
is in String, but in the real API, it only accept byte[], so I use
password.getBytes() as the parameters. Is it right?
  Another question, when I administrate a Bookkeeper cluster, is there any
tools to help me clean all the data from one or every bookie?

-- 

Wei Chen, Graduate Student
LIGO Scientific Collaboration Research Group
Tsinghua University, Beijing, P. R. China
http://ligo.org.cn

Re: Password do not work in bookkeeper

Posted by Ivan Kelly <iv...@apache.org>.
This is the case with CRC32 on 4.0 and 4.1.

CRC32 is only there to provide a checksum on the data. In this case,
the password is only used to ensure that users don't accidently
overwrite each others ledgers. 

MAC uses HMAC, and this will give an error if you try to read with the
wrong key.

Regards
Ivan

On Wed, Nov 14, 2012 at 04:25:52PM +0800, ChenWei wrote:
> Thank you,
>   But actually, I can read all the entries, but I'm not sure if  the
> contents are right. When I call entries= ledgerHandler.readEntries, the
> result is not empty and entries.hasMoreElements() is true
> 
> 
> 2012/11/14 Sijie Guo <gu...@gmail.com>
> 
> > Hello ChenWei,
> >
> > > But what's the strange, I can open the ledger with any password.
> >
> > For 4.1, you could open the ledger. It expected that you should not read
> > any entries from the ledger. Could you read any entries using a wrong
> > password?
> >
> > > but in the real API, it only accept byte[], so I use password.getBytes()
> > as the parameters
> >
> > It accepts only bytes. Which document you referred? The javadoc?
> >
> > > when I administrate a Bookkeeper cluster, is there any tools to help me
> > clean all the data from one or every bookie?
> >
> > In 4.2.0 (not released yet), we provided bookieformat and metaformat to
> > help formatting a bookkeeper cluster.
> >
> >
> > On Wed, Nov 14, 2012 at 3:21 PM, ChenWei <sp...@gmail.com> wrote:
> >
> >> Hi everyone,
> >>   I'm using bookkeeper but I meet some problems. When I createLedger by a
> >> password(A) and addEntry into it, everything is OK. And I can open the
> >> ledger with password(A) and read the content. But what's the strange, I can
> >> open the ledger with any password. Can anyone tell me what's the possible
> >> reason? I notice that in the document of Release 4.1, the password argument
> >> is in String, but in the real API, it only accept byte[], so I use
> >> password.getBytes() as the parameters. Is it right?
> >>   Another question, when I administrate a Bookkeeper cluster, is there
> >> any tools to help me clean all the data from one or every bookie?
> >>
> >> --
> >>
> >> Wei Chen, Graduate Student
> >> LIGO Scientific Collaboration Research Group
> >> Tsinghua University, Beijing, P. R. China
> >> http://ligo.org.cn
> >>
> >
> >

Re: Password do not work in bookkeeper

Posted by ChenWei <sp...@gmail.com>.
Thank you,
  But actually, I can read all the entries, but I'm not sure if  the
contents are right. When I call entries= ledgerHandler.readEntries, the
result is not empty and entries.hasMoreElements() is true


2012/11/14 Sijie Guo <gu...@gmail.com>

> Hello ChenWei,
>
> > But what's the strange, I can open the ledger with any password.
>
> For 4.1, you could open the ledger. It expected that you should not read
> any entries from the ledger. Could you read any entries using a wrong
> password?
>
> > but in the real API, it only accept byte[], so I use password.getBytes()
> as the parameters
>
> It accepts only bytes. Which document you referred? The javadoc?
>
> > when I administrate a Bookkeeper cluster, is there any tools to help me
> clean all the data from one or every bookie?
>
> In 4.2.0 (not released yet), we provided bookieformat and metaformat to
> help formatting a bookkeeper cluster.
>
>
> On Wed, Nov 14, 2012 at 3:21 PM, ChenWei <sp...@gmail.com> wrote:
>
>> Hi everyone,
>>   I'm using bookkeeper but I meet some problems. When I createLedger by a
>> password(A) and addEntry into it, everything is OK. And I can open the
>> ledger with password(A) and read the content. But what's the strange, I can
>> open the ledger with any password. Can anyone tell me what's the possible
>> reason? I notice that in the document of Release 4.1, the password argument
>> is in String, but in the real API, it only accept byte[], so I use
>> password.getBytes() as the parameters. Is it right?
>>   Another question, when I administrate a Bookkeeper cluster, is there
>> any tools to help me clean all the data from one or every bookie?
>>
>> --
>>
>> Wei Chen, Graduate Student
>> LIGO Scientific Collaboration Research Group
>> Tsinghua University, Beijing, P. R. China
>> http://ligo.org.cn
>>
>
>


-- 

Wei Chen, Graduate Student
LIGO Scientific Collaboration Research Group
Tsinghua University, Beijing, P. R. China
http://ligo.org.cn

Re: Password do not work in bookkeeper

Posted by Sijie Guo <gu...@gmail.com>.
Hello ChenWei,

> But what's the strange, I can open the ledger with any password.

For 4.1, you could open the ledger. It expected that you should not read
any entries from the ledger. Could you read any entries using a wrong
password?

> but in the real API, it only accept byte[], so I use password.getBytes()
as the parameters

It accepts only bytes. Which document you referred? The javadoc?

> when I administrate a Bookkeeper cluster, is there any tools to help me
clean all the data from one or every bookie?

In 4.2.0 (not released yet), we provided bookieformat and metaformat to
help formatting a bookkeeper cluster.

On Wed, Nov 14, 2012 at 3:21 PM, ChenWei <sp...@gmail.com> wrote:

> Hi everyone,
>   I'm using bookkeeper but I meet some problems. When I createLedger by a
> password(A) and addEntry into it, everything is OK. And I can open the
> ledger with password(A) and read the content. But what's the strange, I can
> open the ledger with any password. Can anyone tell me what's the possible
> reason? I notice that in the document of Release 4.1, the password argument
> is in String, but in the real API, it only accept byte[], so I use
> password.getBytes() as the parameters. Is it right?
>   Another question, when I administrate a Bookkeeper cluster, is there any
> tools to help me clean all the data from one or every bookie?
>
> --
>
> Wei Chen, Graduate Student
> LIGO Scientific Collaboration Research Group
> Tsinghua University, Beijing, P. R. China
> http://ligo.org.cn
>