加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 在rabbitmq.conf文件中使用环境变量

发布时间:2020-12-14 02:18:18 所属栏目:Windows 来源:网络整理
导读:我在 windows环境中使用RabbitMQ.我正在使用带有ssl配置的RabbitMQ. 我的要求是在rabbitmq.conf文件中使用环境变量来读取SSL证书.我用它如下, {cacertfile,“${MY_HOME} /config/SSLCertificates/testca/cacert.pem” 以上环境变量的使用不起作用.你们中的任
我在 windows环境中使用RabbitMQ.我正在使用带有ssl配置的RabbitMQ.
我的要求是在rabbitmq.conf文件中使用环境变量来读取SSL证书.我用它如下,

{cacertfile,“${MY_HOME} /config/SSLCertificates/testca/cacert.pem”

以上环境变量的使用不起作用.你们中的任何一位请帮助我正确使用环境变量.

解决方法

尝试将您的变量添加到文件rabbitmq-env.bat中,该文件来自 docs中的位置:

If rabbitmq-env.conf doesn’t exist,it can be created manually in the location,specified by the RABBITMQ_CONF_ENV_FILE variable. On Windows systems,it is named rabbitmq-env.bat.

此外,您可能需要使用%%而不是${},因为您在Windows中.

From the windows section

If you need to customise names,ports,locations,it is easiest to configure environment variables in the Windows dialogue: Start > Settings > Control Panel > System > Advanced > Environment Variables.

因此,在定义环境后,请尝试以下操作:

...
{cacertfile,"%YOURVAR%pathtocacert.pem"}
...

Windows: %APPDATA%RabbitMQ

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读