eolivelli commented on a change in pull request #946: ISSUE #945: Enabling
BookieShell for LocalBookKeeper
URL: https://github.com/apache/bookkeeper/pull/946#discussion_r159773633
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/util/LocalBookKeeper.java
##########
@@ -224,13 +237,35 @@ private void runBookies(ServerConfiguration baseConf,
List<File> tempDirs, Strin
+ zooKeeperDefaultPort);
}
-
bsConfs[i].setJournalDirName(journalDirs[i].getPath());
bsConfs[i].setLedgerDirNames(ledgerDirs);
+ // write config into file before start so we can know what's wrong
if start failed
+ String fileName = Bookie.getBookieAddress(bsConfs[i]).toString() +
".conf";
+ serializeLocalBookieConfig(bsConfs[i], fileName);
+
bs[i] = new BookieServer(bsConfs[i]);
bs[i].start();
}
+
+ /*
+ * baseconf.conf is needed because for executing any BookieShell
command
+ * of Metadata/Zookeeper Operation nature we need a valid conf file
+ * having correct zk details and this could be used for running any
such
+ * bookieshell commands if bookieid is not provided as parameter to
+ * bookkeeper shell operation. for eg:
+ * "./bookkeeper shell localbookie listbookies -rw". But for execution
+ * shell command of bookie Operation nature we need to provide
bookieid,
+ * for eg "./bookkeeper shell -localbookie 10.3.27.190:5000 lastmark",
+ * so this shell command would use '10.3.27.190:5000.conf' file
+ */
+ ServerConfiguration baseConfWithCorrectZKServers = new
ServerConfiguration(
+ (ServerConfiguration) baseConf.clone());
Review comment:
Maybe clone is not needed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services