https://bugzilla.redhat.com/show_bug.cgi?id=1272694
Bug ID: 1272694
Summary: Zookeeper service file requires myid file despite the
default install being standalone mode
Product: Fedora
Version: 22
Component: zookeeper
Assignee: tstclair(a)redhat.com
Reporter: KevinFarshaw(a)mailinator.com
QA Contact: extras-qa(a)fedoraproject.org
CC: ctubbsii-fedora(a)apache.org, ethan(a)ethantuttle.com,
java-sig-commits(a)lists.fedoraproject.org, s(a)shk.io,
tstclair(a)redhat.com
Split off from #1261458
https://bugzilla.redhat.com/show_bug.cgi?id=1261458
Starting the service with systemctl complains about missing precondition of
file at /var/lib/zookeeper/data/myid.
After creating the file (with a single line containing an id such as the digit
'1'), zookeeper starts.
(In reply to KevinFarshaw from comment #9)
> Thanks. I'll test and leave karma when you push. Did you get rid of the myid
> precondition in the service file too?
Christopher Tubbs Wrote:
I did not. I'd rather investigate that separately from the classpath issue,
because I'm not too sure about why that precondition was added. Like, is that > to
ensure ZK doesn't accidentally join the wrong quorum?
(In reply to Christopher Tubbs from comment #10)
(In reply to KevinFarshaw from comment #9)
> Thanks. I'll test and leave karma when you push. Did you get rid of the myid
> precondition in the service file too?
I did not. I'd rather investigate that separately from the classpath issue,
because I'm not too sure about why that precondition was added. Like, is
that to ensure ZK doesn't accidentally join the wrong quorum?
That means the server will still be unrunnable in the default install.
I've looked at the SRPM repo.
http://pkgs.fedoraproject.org/git/zookeeper.git
There's nothing in the spec file or git log that indicates this was a specific
fix for a problem/race/danger. The commits adding the service files was
94aec27 Jul 18 2013 Add a server subpackage. Jeffrey C. Ollie
commited by tstclair. The relevent hunk in the diff for the service file was:
--- a/zookeeper.service
+++ b/zookeeper.service
@@ -1,14 +1,20 @@
[Unit]
-Description=Zookeeper
+Description=Apache ZooKeeper
+After=network.target
+ConditionPathExists=/etc/zookeeper/zoo.cfg
+ConditionPathExists=/etc/zookeeper/log4j.properties
+ConditionPathExists=/var/lib/zookeeper/data/myid
I am not an authority on zookeeper but, as I read the manual
https://zookeeper.apache.org/doc/trunk/zookeeperStarted.html#sc_RunningRe...
the myid file is only required when zookeeper is explicitly
configured for quorum operation, in which case it should match
one of the quorum member entries added to /etc/zookeeper/zoo.cfg.
on fedora (22):
$ rpm -qlv zookeeper
0 Feb 16 2015 /etc/zookeeper
2161 Mar 12 2014 /etc/zookeeper/log4j.properties
0 Feb 16 2015 /etc/zookeeper/zoo.cfg
965 Feb 16 2015 /etc/zookeeper/zoo_sample.cfg
neither the empty default config, nor the sample config provided alongside
it define a quorum, they are both geared for standalone operation. Since
1. myid is not needed in standalone operation.
2. the default install will always come up in standalone operation
unless someone manually edits the configuration and adds quorum entries.
I think it is reasonable to remove that precondition and require that
a person switching the daemon from standalone mode to quorum mode
do that properly, following the procedure described in the zk documentation.
Christopher Tubbs 2015-10-17 08:44:57 EDT wrote:
I agree with your reasoning and will modify or remove that
precondition.
Let's proceed in a separate issue, only so we can track the history better > later
if we need to.
This is a new issue to track this.
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug
https://bugzilla.redhat.com/token.cgi?t=K4LqYh0IM2&a=cc_unsubscribe