puppet-zookeeper icon indicating copy to clipboard operation
puppet-zookeeper copied to clipboard

Zookeeper always get the same myID

Open 3h4x opened this issue 10 years ago • 4 comments
trafficstars

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?

3h4x avatar Apr 10 '15 10:04 3h4x

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.

deric avatar Apr 10 '15 12:04 deric

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

3h4x avatar Apr 10 '15 14:04 3h4x

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.

deric avatar Apr 15 '15 06:04 deric

See also bug #27 for more ideas.

isotopp avatar Aug 26 '15 09:08 isotopp