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 always get the same myID #18

Open
3h4x opened this issue Apr 10, 2015 · 4 comments
Open

Zookeeper always get the same myID #18

3h4x opened this issue Apr 10, 2015 · 4 comments
Milestone

Comments

@3h4x
Copy link

3h4x commented Apr 10, 2015

all of them get myID = 1

  class { '::zookeeper':
    servers       => ['x', 'y', 'z''],
    client_ip     => $::ipaddress_eth0,
    election_port => 2889,
    leader_port   => 3889,
    require       => Class['java'],
  }

shouldn't this be automated? instead I need to create hierarchy which is for me not needed, or am I doing sth wrong?

@deric
Copy link
Owner

deric commented Apr 10, 2015

Right, it an ideal automated world, it should be working. An easy workaround is to use Hiera:

hiera/host/zk1.example.com.yaml:

zookeeper::id: '1'

hiera/host/zk2.example.com.yaml:

zookeeper::id: '2'

hiera/host/zk3.example.com.yaml:

zookeeper::id: '3'

Typically you deploy 3 or 5 ZooKeepers, so it ain't that much work. But, I can almost hear you, "it's not automated!". I've tried an approach with concat module, another one with datacat which is still part of the code. But it wasn't working as expected, so I end up with the "static" fallback. By the way, I'm open to pull requests :)

Another solution would require PuppetDB, as it is mentioned here. Which is makes deployment dependent on another component.

ZooKeeper should be a consistent (and reliable) storage, mine experience with automated configuration was, that it lost the reliability, thus I removed the datacat integration. That was a year ago, I can give it a try and add some flag for automatic myID configuration. Until the approach is properly tested I don't want to release as the default configuration.

@3h4x
Copy link
Author

3h4x commented Apr 10, 2015

Hiya,
thanks for your reply. This is actually what I did - static myid in hiera. It isn't painfull but I'm configuring sth that should be automated.
I'm not saying this module is unusable because of it but it would be great feature to have working cluster out of the box. So for the record it should be at least mentioned in the part where cluster of zookeeper is configured (have your static myID in hiera if you want cluster) and I've created this bug for the future, when puppet will have mechanisms which will provide us that really simple but yet unreachable feature :)
I might look in to it deeper in spare time, concat/datacat should theoretically work here

deric added a commit that referenced this issue Apr 15, 2015
@deric
Copy link
Owner

deric commented Apr 15, 2015

I agree, it would be great to have a working cluster out of the box. Another problem is, that it might not be possible to setup all ZooKeepers in a single Puppet run (we don't know all IP addresses of nodes with ZooKeeper during first run). This could be a problem during provisioning, so having static fallback it's quite necessary.

Even if we implement this feature, it's hard to test it with a simple rspec. Using beaker for proper testing might be good idea.

@isotopp
Copy link

isotopp commented Aug 26, 2015

See also bug #27 for more ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants