Comments (2)
Hi. Glad to hear it's helping you.
Are you able to provide me with what your inventory file looks like? You may be experiencing a similar problem to #26 whereby if the zookeeper_id
isn't provided for each node then it won't configure the cluster correctly.
One example of an inventory file, in ini
format, is below:
zoo1 ansible_host=192.168.1.101
zoo2 ansible_host=192.168.1.102
zoo3 ansible_host=192.168.1.103
[zookeeper-nodes]
zoo1 zookeeper_id=1
zoo2 zookeeper_id=2
zoo3 zookeeper_id=3
I have seen other examples, e.g. https://github.com/AnsibleShipyard/ansible-zookeeper/blob/master/templates/myid.j2 and https://github.com/AnsibleShipyard/ansible-zookeeper/blob/master/templates/zoo.cfg.j2, where people have used the loop index of the hosts to specify the zookeeper id (there are more simple examples out there as well). Those examples remove the need for specifying zookeeper_id
in the inventory, but this could lead to different ids being used and the myid
changing on servers if updated if you add or remove hosts...this may be an edge-case and/or not applicable to you.
Presumably you have a slightly simplistic case and aren't needing dynamic inventory based on AWS EC2 tags for example?
Let me know what your inventory file, /var/lib/zookeeper/myid
, and /etc/zookeeper/zoo.cfg
files look like and I'll see if I can offer any further advice.
from ansible-zookeeper.
I've had the same issue as @cloudman1978
Inventory contains something like:
---
all:
children:
zk_cluster_devel:
hosts:
"zk-cluster-[01:03].example.com":
provider: aws
......................
and I managed to fix it via a pre_tasks
w/ something like:
- name: Install ZK machines for devel
become: true
hosts: zk_cluster_devel
pre_tasks:
- name: Set ZK id
set_fact:
zookeeper_id: "{{ inventory_hostname | replace('.example.com', '') | replace('zk-cluster-0', '') }}"
roles:
- sleighzy.zookeeper
from ansible-zookeeper.
Related Issues (15)
- FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'zookeeper_id'"} HOT 4
- Error Task HOT 4
- sleighzy.zookeeper return AnsibleUndefinedVariable HOT 2
- Incorrect cfg for clustering? HOT 3
- Support zookeeper > 3.4.14 HOT 4
- Custom location for `zoo.cfg.j2` template or change ansible_nodename HOT 1
- Add the ability to template any parameters into the zoo.cfg file
- Role installation failing on Ubuntu Ansible Controller v. 2.9.6 HOT 1
- Add a sample in readme to allow "zookeeper_servers" property from hosts list
- Change hardcoded ports in firewalld.yml file
- Add firewall rule for Debian using ufw
- Error: JAVA_HOME is not set and java could not be found in PATH. HOT 1
- 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'zookeeper_id'"} HOT 7
- Can't install role with custom name HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-zookeeper.