evertrue / zookeeper-cookbook

Chef cookbook for installing and managing Zookeeper.
https://supermarket.chef.io/cookbooks/zookeeper
Apache License 2.0
81 stars 117 forks source link

Creating the log directory on install #147

Closed adamb0mb closed 9 years ago

adamb0mb commented 9 years ago

I was getting this error on zk startup:

[adamp@devzk02 ~]$ sudo service zookeeper start
Starting zookeeper Server (zookeeper):                     [  OK  ]
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /var/log/zookeeper/zookeeper.log (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
    at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
    at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
    at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
    at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.<clinit>(QuorumPeerMain.java:64)

This simply just creates that directory (in the model that other directories are being created)

jeffbyrnes commented 9 years ago

@adamb0mb looks like this needs a rebase; would you mind? I’d like to cut a new version w/ the CentOS support etc. sometime today.

adamb0mb commented 9 years ago

Done. Cut away!

jeffbyrnes commented 9 years ago

@adamb0mb hmm, looks like the templates/default/zookeeper.initd.erb template snuck in there (unneeded, we have templates/default/zookeeper.sysv.erb). Would you mind deleting that file? Then we should be good!

adamb0mb commented 9 years ago

Good catch! Thank you.