Fix for zookeeper id

zookeeper id should be a value between 1 and 255.
uid can be bigger than 255, so it should be calculated

Change-Id: If1dcecde8f066b1e27b5c2f0331ee5dc0b0c0804
Closes-bug: #1622008
Signed-off-by: Illia Polliul <ipolliul@mirantis.com>
This commit is contained in:
Illia Polliul 2016-09-29 16:54:07 +03:00
parent bec24879ca
commit 92746f72ee
1 changed files with 7 additions and 2 deletions

View File

@ -33,15 +33,20 @@ class contrail::database {
sysctl::value { 'vm.swappiness':
value => '10'
}
if roles_include($contrail::contrail_controller_roles) {
$cassandra_ips = $::contrail::contrail_controller_ips
$cassandra_seeds = $contrail::primary_contrail_controller_ip
$cluster_name = 'Contrail'
$priv_ip = $::contrail::address
# Zookeeper
# Zookeeper
# this is a remanider from dividing by 255
# + 1 is to avoid it being 0 if uid is a multiplicator of 255
$zookeeper_id = $contrail::uid % 255 + 1
package { 'zookeeper': } ->
file { '/etc/zookeeper/conf/myid':
content => $contrail::uid,
content => "${zookeeper_id}\n",
require => Package['zookeeper'],
}