Closed
Description
I'm trying to operate the cluster.rb
recipe I'm having difficulty getting teh ndoes to cluster. This appears to be a recipe defect, or a defect in what I'm providing however it looks like I'm following available documentation.
RMQ: 3.6.9-1.el7
OS: RedHat 7.4
ERLANG: 19.3.4-1.el7
Cookbook version: 5.6.1
Chef: 13.9.4
Rendered node json attributes (bootstrap):
{
"rabbitmq": {
"clustering": {
"cluster_nodes": [
{
"name": "rabbit@us1a-rmq1-kamehameha.domain.tld",
"type": "disc"
},
{
"name": "rabbit@us1a-rmq2-kamehameha.domain.tld",
"type": "disc"
},
{
"name": "rabbit@us1a-rmq3-kamehameha.domain.tld",
"type": "disc"
}
]
}
}
}
My wrapped recipe segment:
include_recipe 'rabbitmq::default'
include_recipe 'rabbitmq::cluster' if node['ap_rabbitmq']['service']['clustering']['auto']
include_recipe 'ap_rabbitmq::user'
rabbitmq_policy 'ha-all' do
pattern '^ha\.'
parameters 'ha-mode' => 'all'
action :set
end if node['ap_rabbitmq']['service']['clustering']['enable']
include_recipe 'rabbitmq::plugin_management'
include_recipe 'rabbitmq::mgmt_console'
chef client run:
Recipe: rabbitmq::cluster
* rabbitmq_cluster[[{"name":"rabbit@us1a-rmq1-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq2-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq3-kamehameha.domain.tld","type":"disc"}]] action set_cluster_name (up to date)
* rabbitmq_cluster[[{"name":"rabbit@us1a-rmq1-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq2-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq3-kamehameha.andomain.tld","type":"disc"}]] action change_cluster_node_type
================================================================================
Error executing action `change_cluster_node_type` on resource 'rabbitmq_cluster[[{"name":"rabbit@us1a-rmq1-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq2-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq3-kamehameha.domain.tld","type":"disc"}]]'
================================================================================
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/rabbitmq/providers/cluster.rb:259:in `block in class_from_file'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/rabbitmq/recipes/cluster.rb
41: rabbitmq_cluster static_cluster_nodes do
42: cluster_name node['rabbitmq']['clustering']['cluster_name']
43: action [:set_cluster_name, :change_cluster_node_type]
44: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/rabbitmq/recipes/cluster.rb:41:in `from_file'
rabbitmq_cluster("[{"name":"rabbit@us1a-rmq1-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq2-kamehameha.domain.tld","type":"disc"},{"name":"rabbit@us1a-rmq3-kamehameha.domain.tld","type":"disc"}]") do
action [:set_cluster_name, :change_cluster_node_type]
default_guard_interpreter :default
declared_type :rabbitmq_cluster
cookbook_name "rabbitmq"
recipe_name "cluster"
cluster_name "kamehamehaus1a"
cluster_nodes "[{\"name\":\"rabbit@us1a-rmq1-kamehameha.domain.tld\",\"type\":\"disc\"},{\"name\":\"rabbit@us1a-rmq2-kamehameha.domain.tld\",\"type\":\"disc\"},{\"name\":\"rabbit@us1a-rmq3-kamehameha.domain.tld\",\"type\":\"disc\"}]"
end
System Info:
------------
chef_version=13.9.4
platform=redhat
platform_version=7.4
ruby=ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
program_name=chef-client worker: ppid=1916;start=18:23:21;
executable=/opt/chef/bin/chef-client