Question

I want to assign the initial_token value in cassandra.yaml file using puppet automation. Can any one please tell me how to do it.

I cannot use virtual nodes because vnodes are not supported for hadoop and solr nodes.

Example: If I had an array of:

['-9223372036854775808', '-3074457345618258603', '3074457345618258602']

I need to assign each value to each node.

Was it helpful?

Solution

You could store that array in a variable in the manifest.

EDIT: if using Cassandra =< 1.2 most Puppet Cassandra modules should have a parameter to set this option. So you could then pass a value from the array into there. For example: https://forge.puppetlabs.com/gini/cassandra

If you're not using a module to set up Cassandra already with this as a parameter, you could create a template of the Cassandra.yaml and just use ERB to input a value from that array into the template.

http://docs.puppetlabs.com/guides/templating.html

EDIT:

Now I am back at a PC I can think a bit more. The instant solution I can think of is to define the tokens in a hash of either node IP address or node hostname => token - '127.0.0.1' => '-9223372036854775808'. This could be created in the manifest or you can do it via Hiera. If in Hiera, you'll need to extract it into a variable anyway in the manifest.

Then in the template you should be able to reference it with <%= variableName[@::ipaddress_eth0] %> for example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top