Add ZOOCFGDIR env variable to ZooKeeper to make scripts work#1298
Add ZOOCFGDIR env variable to ZooKeeper to make scripts work#1298
Conversation
| ENV PATH="${PATH}":/stackable/zookeeper/bin | ||
| # This is used by zkEnv.sh and for the shell scripts in bin/ | ||
| # If unset it tries to find the conf directory automatically and that fails | ||
| ENV ZOOCFGDIR=/stackable/config |
There was a problem hiding this comment.
Hmm, we have a rwconfig as well for the real config https://github.com/stackabletech/zookeeper-operator/blob/e370101dfe986e862c0354f6a50471b857d0c078/rust/operator-binary/src/zk_controller.rs#L927.
Its created by the operator though...maybe this should be set in the operator?
There was a problem hiding this comment.
I'm not sure I understand this to be honest. Is /stackable/config the wrong directory then?
There was a problem hiding this comment.
We basically use the config mounted in /stackable/config, copy that to /stackable/rwconfig to replace/extend the myid etc. A quick glance does not show anything else https://github.com/stackabletech/zookeeper-operator/blob/main/rust/operator-binary/src/command.rs#L3. We do more in other operators.
Thats why the tests probably work fine, just wanted to say that the config file stored in /stackable/config is not the one zookeeper runs with, see https://github.com/stackabletech/zookeeper-operator/blob/e370101dfe986e862c0354f6a50471b857d0c078/rust/operator-binary/src/zk_controller.rs#L955.
And the rwconfig is an empty dir created by the operator.
There was a problem hiding this comment.
Okay, if that is the case then this PR is wrong. So....is /stackable/rwconfig the correct directory then?
There was a problem hiding this comment.
Yes but i still would prefer to just set it in the operator.
However, we could point in the docker image to the "default" zookeeper config in the binary folder and overwrite to /stackable/rwconfig in the operator? Then the image is a bit more "standalone".
|
moved to operator stackabletech/zookeeper-operator#988 |
Description
This works around https://issues.apache.org/jira/browse/ZOOKEEPER-4985
If we don't set this variable most of the shell scripts will fail (definitely zkCleanup.sh).
It can be set manually before every call but we do know the location of the config directory so no harm in making it a bit easier.
I didn't think this needed a changelog entry, happy to add if you think otherwise.
Definition of Done Checklist