chef:重新使用以前注册的节点(ami)并引导它-不工作

hc2pp10m  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(0)|浏览(226)

我们的团队正在尝试扩展我们目前的ElasticSearch集群。在进行此操作时,我们获取当前弹性节点的ami,并使用该ami创建潜在的第4个弹性节点。过去,chef用于配置新的弹性节点。然而,那些食谱的设计者离开了我们的团队,我们不知所措。尝试引导新主机时,出现以下错误:

Recipe Compile Error in /var/chef/cache/cookbooks/av_elastic/recipes/elastic_cluster.rb
  ================================================================================

  Net::HTTPServerException
  ------------------------
  400 "Bad Request"

  Cookbook Trace:
  ---------------
    /var/chef/cache/cookbooks/av_elastic/recipes/elastic_cluster.rb:134:in `from_file'

  Relevant File Content:
  ----------------------
  /var/chef/cache/cookbooks/av_elastic/recipes/elastic_cluster.rb:

127:    message "Block devices available to Elasticsearch: #{devices}"
  128:    level :warn
  129:  end
  130:
  131:  ## Gather Available Nodes within same es-cluster-name, Chef Environment, and elastic_cluster role. Exclude marvel nodes
  132:  elasticsearch_cluster_nodes = Array.new
  133:  elasticsearch_cluster_node_names = Array.new
  134>> search(:node, "chef_environment:#{node.chef_environment} AND roles:*elastic_cluster AND es-cluster-name:#{node['es-cluster-name']} NOT roles:*elastic_marvel").each do |node|
  135:    elasticsearch_cluster_nodes << node
  136:    elasticsearch_cluster_node_names << node['hostname']
  137:  end
  138:

使用debug选项,我可以在chef客户端输出中看到:

[2020-11-24T15:58:00+00:00] DEBUG: ---- HTTP Response Body ----
[2020-11-24T15:58:00+00:00] DEBUG: {"error":["invalid search query: 'chef_environment:production AND roles:*elastic_cluster AND es-cluster-name: NOT roles:*elastic_marvel'"]}
[2020-11-24T15:58:00+00:00] DEBUG: ---- End HTTP Response Body -----
[2020-11-24T15:58:00+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
[2020-11-24T15:58:00+00:00] DEBUG: Expected JSON response, but got content-type ''

因为我们使用的是以前的主机,所以我已经更新了/etc/hosts和/etc/hostname文件,同时删除了/etc/chef/client.pem文件。我认为问题在于身份验证,但我无法证明。我还认为这个主机上可能留下了一些东西,仍然指向/认为是另一个主机(创建ami的主机)。
当前运行的弹性节点与新主机使用相同的配方,它们都按照设计工作/运行。有什么办法解决吗?先谢谢你

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题