Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zookeeper setup using offical tarball (also) on debian/ubuntu #34

Conversation

lhoss
Copy link

@lhoss lhoss commented Aug 8, 2016

final PR to fix: #26

thx for review @ernestas-poskus

Update: We could also extract the 2 'configure' tasks from tarball.yml, and re-use the same include file also in the old Debian.yml installation, to further reduce code duplication. Should I do in this PR?

@@ -4,7 +4,9 @@ zookeeper_playbook_version: "0.9.2"
zookeeper_version: 3.4.6
zookeeper_url: http://www.us.apache.org/dist/zookeeper/zookeeper-{{zookeeper_version}}/zookeeper-{{zookeeper_version}}.tar.gz

zookeeper_debian_apt_install: false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: 2 things we could change here:

  • set default to 'true' (assuming we want to keep offering also the original debian apt install)
  • rename variable to zookeeper_tarball_install and set 'true' (with the idea we could later also provide a zookeeper yum/rpm setup on redhat)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to prefer apt but since 3.4.6 is not available and released - lets leave priority to tarball install

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.
ps: I suggest to update the documentation a bit (explaining this new setting)
In general I like to have each role variable have a 1-line documentation

@lhoss
Copy link
Author

lhoss commented Aug 9, 2016

@ernestas-poskus checks passed! happy to get this merged (so I can resolve my 2 other issues, even today) 👍

@@ -4,6 +4,9 @@ zookeeper_playbook_version: "0.9.2"
zookeeper_version: 3.4.6
zookeeper_url: http://www.us.apache.org/dist/zookeeper/zookeeper-{{zookeeper_version}}/zookeeper-{{zookeeper_version}}.tar.gz

# Flag that selects if systemd or upstart will be used for the init service:
# Note: by default Ubuntu 15.04 and later use systemd (but support switch to upstart)
zookeeper_debian_systemd_enabled: "{{ ansible_distribution_version|version_compare(15.04, '>=') }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah 'version_compare' is a useful filter 👍
Note that it's only supported since ansible v1.6 (not sure if you mention anywhere a minimal ansible version requirement for the role).
Finally, when running a later test in the provided 'trusty' Vagrant-file/box, that check failed, because ansible was only 1.5.4 (installed by apt)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@lhoss lhoss Aug 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do!
ps: I'ld also add more supported Ubuntu versions (not sure about the existing old(est) ones in that list !)

  - name: Ubuntu
    versions:
      - all
...
      - utopic
      - vivid
      - wily
      - xenial

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just change to 1.6, I will cleanup unused versions

@ernestas-poskus
Copy link
Member

Looks good, I will test this this evening and merge if everything is 🆗. Thank you for contribution !

@lhoss
Copy link
Author

lhoss commented Aug 10, 2016

Looks good, I will test this this evening and merge if everything is 🆗.

Note, with the current state (of the PR), you will notice that there is no zookeeper (log4j) log file 'zookeeper.log' written (as was the case when using the .deb pkg).
There's however a log written ('init-zookeeper.log') which is the redirected stdout&stderr from (upstart) service script running zkServer.sh (which is current re-created after each service restart)
Anyway the proper fix (I already implemented & tested) is to enable the 'ROLLINGFILE' log4j appender, which is best done by writing following ENV vars to conf/zookeeper_env.sh.
I've implemented this is using a simple template and a new optional dictionary variable, where you can define your custom ENV settings:

zookeeper_env:
  ZOO_LOG_DIR: "/var/log/zookeeper"
  ZOO_LOG4J_PROP: "INFO,ROLLINGFILE"

Notes:

  • this also applies for redhat/centos (meaning that till now there was no proper log written here either)
  • IMO it would be a reasonable default to enable ROLLINGFILE (we could do this by setting above env values as a default), except that it would change (improve) also the behavior for the redhat setup
  • I would do a separate PR for this (once again waiting for Zookeeper setup using offical tarball (also) on debian/ubuntu #34 merge) OR we could add the feature to the current PR ?

@ernestas-poskus
Copy link
Member

Good finding !

I would do a separate PR for this

yes this is better option

@@ -4,7 +4,7 @@ galaxy_info:
description: Ansible Zookeeper Role
company: http://michaelhamrah.com
license: Apache 2
min_ansible_version: 1.2
min_ansible_version: 1.6
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ernestas-poskus done the last change request

@ernestas-poskus ernestas-poskus merged commit 5106db3 into AnsibleShipyard:master Aug 10, 2016
@lhoss lhoss deleted the zookeeper_debian_tarball_install branch August 12, 2016 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debian/Ubuntu tasks setup outdated zookeeper (ubuntu 14.04 repos latest version is 3.4.5)
2 participants