在尝试启动rabbitmq时,出现以下错误,并且我观察到主机1和2存在/var/lib/rabbitmq/mnesia目录,但主机3中不存在:
fatal: [host-3]: FAILED! => {"changed": true, "cmd": ["rabbitmqctl", "cluster_status"], "delta": "0:00:00.986969", "end": "2019-08-14 15:04:09.714266", "msg": "non-zero return code", "rc": 2, "start": "2019-08-14 15:04:08.727297", "stderr": "Error: {aborted,{bad_config,dir,\n \"/var/lib/rabbitmq/mnesia/rabbit@host-3\"}}", "stderr_lines": ["Error: {aborted,{bad_config,dir,", " \"/var/lib/rabbitmq/mnesia/rabbit@host-3\"}}"], "stdout": "Cluster status of node 'rabbit@host-3' ...", "stdout_lines": ["Cluster status of node 'rabbit@host-3' ..."]}
- name: Check RabbitMQ cluster
command: rabbitmqctl cluster_status
register: result
RabbitMQ 生成的配置似乎存在语法错误,导致 mnesia 目录值存在大量空格:
bad_config,dir,\n \"/var/lib/rabbitmq/mnesia/rabbit@host-3\"
我会仔细检查配置输入,并检查
/var/lib/rabbitmq/.../config/generated/rabbitmq.config
中生成的配置文件。