当前位置:   article > 正文

linux查看MQ日志路径,Rabbitmq之修改日志和数据存放路径

linux下rabbitmq的安装日志在哪

1.linux版rabbitmq修改日志和数据存放路径

示例:

rpm包安装日志和数据存放都在 /var下

fdd00829606f897aa1b480699b513c7c.png

(1)先创建数据文件和日志文件存放位置的目录并给权限

#mkdir -pv /usr/local/rabbitmq/mnesia

#mkdir -pv /usr/local/rabbitmq/log

#chmod -R 777 /usr/local/rabbitmq

#chown -R rabbitmq:rabbitmq /usr/local/rabbitmq/mnesia

#chown -R rabbitmq:rabbitmq /usr/local/rabbitmq/log

(2)创建或新增环境参数配置文件

#vim /etc/rabbitmq/rabbitmq-env.conf

增加如下两行内容

RABBITMQ_MNESIA_BASE=/usr/local/rabbitmq/mnesia

RABBITMQ_LOG_BASE=/usr/local/rabbitmq/log

保存,重启rabbitmq服务,修改数据文件和日志文件存放位置,相当于重置rabbitmq;

#rabbitmqctl stop

#rabbitmq-server -detached

(3)重新启用插件及添加用户

#rabbitmq-plugins enable rabbitmq_management

#rabbitmq-plugins enable rabbitmq_consistent_hash_exchange

#rabbitmqctl add_user rabbitmq rabbitmq

#rabbitmqctl set_user_tags rabbitmq administrator

#rabbitmqctl set_permissions -p / rabbitmq ".*" ".*" ".*"

2.windows版rabbitmq修改日志和数据存放路径

注意:  erlang和rabbitmq不要安装在C盘

示例:

(1)修改sbin/rabbitmq-env.bat使得用户目录为rabbitmq安装目录下的user目录

在以下行

if not defined ERLANG_HOME (

for /f "delims=" %%F in ('where.exe erl.exe') do @set ERL_PATH=%%F

if exist "!ERL_PATH!" (

for /f "delims=" %%F in ("!ERL_PATH!") do set ERL_DIRNAME=%%~dpF

for /f "delims=" %%F in ("!ERL_DIRNAME!\..") do @set ERLANG_HOME=%%~dpsF%%~nF%%~xF

)

set ERL_PATH=

set ERL_DIRNAME=

)

后面添加如下:

set RABBITMQ_BASE=!RABBITMQ_HOME!/user

(2)在sbin目录下运行

#rabbitmq-service.bat install

(3)重新启用插件及添加用户

#rabbitmq-plugins.bat enable rabbitmq_management

#rabbitmq-plugins.bat enable rabbitmq_consistent_hash_exchange

#rabbitmqctl.bat add_user rabbitmq rabbitmq

#rabbitmqctl.bat set_user_tags rabbitmq administrator

#rabbitmqctl.bat set_permissions -p / rabbitmq ".*" ".*" ".*"

(4)命令启动

禁止系统注册的rabbitmq服务,只使用命令启动

#rabbitmq-ctl.bat stop

#rabbitmq-service.bat -detached

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/457081
推荐阅读
相关标签
  

闽ICP备14008679号