简体   繁体   English

无法为sensu客户端创建rabbitmq.json

[英]Unable to create the rabbitmq.json for sensu client

I am using https://github.com/portertech/chef-monitor cookbook to setup the sensu client as the node is bootstrapped to the chef server. 我正在使用https://github.com/portertech/chef-monitor cookbook来设置sensu客户端,因为该节点被引导到Chef服务器。 The default recipe should install sensu components, ssl, json configurations and also the sensu client service. 默认配方应安装sensu组件,ssl,json配置以及sensu客户端服务。

However the rabbitmq.json is not getting created, the chef client run fails as it tries to start the chef client service at the end. 但是未创建rabbitmq.json,chef客户端运行失败,因为它尝试在最后启动chef客户端服务。

There is a databag created for SSL. 有一个为SSL创建的数据包。 node["monitor"]["master_address"] has been set 已设置node [“ monitor”] [“ master_address”]

values for rabbitMQ has been provided in the nodes as override 在节点中提供了RabbitMQ的值作为覆盖

{
    "sensu": {
    "rabbitmq": 
        {
            "host": "myhost.com",
            "port":5671,
            "vhost":"/sensu",
            "user":"sensu",
            "password":"secret",
            "ssl": {
                "cert_chain_file":"/etc/sensu/ssl/cert.pem",
                "private_key_file":"/etc/sensu/ssl/key.pem"
                }
            }
        }
    }
}

but the rabbitmq.json is not getting created, hence the start service is not working and the log says unable to connect to rabbit mq 但是未创建rabbitmq.json,因此启动服务无法正常运行,并且日志显示无法连接到rabbit mq

"level":"fatal","message":"transport connection error","error":"failed to connect to rabbitmq" “级别”:“致命”,“消息”:“传输连接错误”,“错误”:“无法连接到rabbitmq”

Read the sensu cookbook readme file again. 再次阅读sensu cookbook自述文件。 It does not require a rabbitMQ.json on client side. 它不需要客户端上的RabbitMQ.json。 The config.json /etc/sensu/config.json should have the entry for rabbitmq for the client to connect to. config.json /etc/sensu/config.json应该具有Rabbitmq的条目,以供客户端连接。 It would also have the entries for redis and api. 它还将具有redis和api的条目。

Make sure you are passing the node.monitor.master_address : The sensu server ip Or if you are not, it should look for the node monitor::master recipe and pick its ip. 确保您传递的是node.monitor.master_address :sensu服务器ip。否则,它应该寻找节点monitor::master配方并选择其ip。

The problem was with SSL grrrr... seems the ssl in the databag was bad, regenerated the ssl and propagated for all, worked fine after that. 问题在于SSL grrrr ...似乎数据包中的ssl不好,重新生成了ssl并进行了传播,此后一切正常。

cd examples/ssl
./ssl_certs.sh generate
knife data bag create sensu
Use the plain-text data bag item:

knife data bag from file sensu ssl.json
Or, encrypted it with your data bag secret. See Encrypt a Data Bag for more information.

knife data bag --secret-file /path/to/your/secret from file sensu ssl.json
./ssl_certs.sh clean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM