You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (Commented) (JIRA)" <ji...@apache.org> on 2012/04/09 10:45:21 UTC
[jira] [Commented] (BOOKKEEPER-211) Bookie fails to to start
[ https://issues.apache.org/jira/browse/BOOKKEEPER-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249738#comment-13249738 ]
Sijie Guo commented on BOOKKEEPER-211:
--------------------------------------
oh, this issue seems that we don't create *current* directory on ledger directories.
{code}
try {
checkDirectoryStructure(journalDirectory);
Cookie journalCookie = Cookie.readFromDirectory(journalDirectory);
journalCookie.verify(masterCookie);
for (File dir : ledgerDirectories) {
checkDirectoryStructure(dir);
Cookie c = Cookie.readFromDirectory(dir);
c.verify(masterCookie);
}
} catch (FileNotFoundException fnf) {
if (!newEnv){
LOG.error("Cookie exists in zookeeper, but not in all local directories", fnf);
throw new BookieException.InvalidCookieException();
}
masterCookie.writeToDirectory(journalDirectory);
for (File dir : ledgerDirectories) {
masterCookie.writeToDirectory(dir);
}
masterCookie.writeToZooKeeper(zk, conf);
}
{code}
in a clean state, the FileNotFoundException is thrown when checking cookie file in journal directory. so there is no chance to checkDirectory on ledger directories, the *current* directory would not be created.
the fix would be simple, would attach a patch later.
> Bookie fails to to start
> ------------------------
>
> Key: BOOKKEEPER-211
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-211
> Project: Bookkeeper
> Issue Type: Bug
> Reporter: Flavio Junqueira
> Priority: Blocker
> Fix For: 4.1.0
>
>
> A number of times when I start a bookie with a clean state, it fails to start and I get the following exceptions:
> {noformat}
> 2012-04-06 10:54:42,201 - ERROR [main:Bookie@348] - Error accessing cookie on disks
> java.io.FileNotFoundException: *path*/current/VERSION (No such file or directory)
> at java.io.FileOutputStream.open(Native Method)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
> at org.apache.bookkeeper.bookie.Cookie.writeToDirectory(Cookie.java:114)
> at org.apache.bookkeeper.bookie.Bookie.checkEnvironment(Bookie.java:337)
> at org.apache.bookkeeper.bookie.Bookie.<init>(Bookie.java:401)
> at org.apache.bookkeeper.proto.BookieServer.<init>(BookieServer.java:75)
> at org.apache.bookkeeper.proto.BookieServer.main(BookieServer.java:294)
> 2012-04-06 10:54:42,203 - ERROR [main:BookieServer@308] - Exception running bookie server :
> org.apache.bookkeeper.bookie.BookieException$InvalidCookieException: java.io.FileNotFoundException: *path*/current/VERSION (No such file or directory)
> at org.apache.bookkeeper.bookie.Bookie.checkEnvironment(Bookie.java:349)
> at org.apache.bookkeeper.bookie.Bookie.<init>(Bookie.java:401)
> at org.apache.bookkeeper.proto.BookieServer.<init>(BookieServer.java:75)
> at org.apache.bookkeeper.proto.BookieServer.main(BookieServer.java:294)
> Caused by: java.io.FileNotFoundException: *path*/current/VERSION (No such file or directory)
> at java.io.FileOutputStream.open(Native Method)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
> at org.apache.bookkeeper.bookie.Cookie.writeToDirectory(Cookie.java:114)
> at org.apache.bookkeeper.bookie.Bookie.checkEnvironment(Bookie.java:337)
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira