Generic Unix or Linux (BSD, Mac OS X)
解压缩的路径 就是 $RABBITMQ_HOME
可以先卸载掉mac版的 brew uninstall rabbitmq
$RABBITMQ_HOME/etc/rabbitmq/rabbitmq-env.conf
需要新建一个
#example rabbitmq-env.conf file entries
#Rename the node
NODENAME=bunny@localhost
#Config file location and new filename bunnies.config
CONFIG_FILE=/Users/knightliao/usr/rabbit/rabbitmq_server-3.5.1/etc/rabbitmq/rabbitmq
这里要注意的是,/Users/knightliao/usr/rabbit/rabbitmq_server-3.5.1/etc/rabbitmq/rabbitmq不要写成 /Users/knightliao/usr/rabbit/rabbitmq_server- 3.5.1/etc/rabbitmq/rabbitmq.config 否则会找不到的!!
然后 /Users/knightliao/usr/rabbit/rabbitmq_server-3.5.1/etc/rabbitmq/rabbitmq.config 此文件将包含程序配置
sbin/rabbitmq-server
或 rabbitmq-server -detached
运行结果:
RabbitMQ 3.5.1. Copyright (C) 2007-2014 GoPivotal, Inc.
## ## Licensed under the MPL. See http://www.rabbitmq.com/
## ##
########## Logs: sbin/../var/log/rabbitmq/bunny@localhost.log
###### ## sbin/../var/log/rabbitmq/bunny@localhost-sasl.log
##########
Starting broker... completed with 0 plugins.
说明日志文件在:
/Users/knightliao/usr/rabbit/rabbitmq_server-3.5.1/var/log/rabbitmq
rabbit的配置均是以 RABBITMQ_ 开头的,它的寻找规则是:
https://www.rabbitmq.com/configure.html#customise-general-unix-environment
可以看到
rabbit的port是 5672
4369 (epmd), 25672 (Erlang distribution)
5672, 5671 (AMQP 0-9-1 without and with TLS)
15672 (if management plugin is enabled)
61613, 61614 (if STOMP is enabled)
1883, 8883 (if MQTT is enabled)
https://www.rabbitmq.com/access-control.html
sbin/rabbitmqctl clear_permissions guest
sbin/rabbitmqctl list_permissions
sbin/rabbitmqctl delete_user guest
sbin/rabbitmqctl add_user root MhxzKhl
sbin/rabbitmqctl set_user_tags root administrator
设置pikaq这个帐号对于rabbitmq的权限:
sbin/rabbitmqctl set_permissions -p / pikaq ".*" ".*" ".*"
sbin/rabbitmqctl set_permissions -p / root ".*" ".*" ".*"
如果没有设置 set_permissions 那可能会导致程序里连接不上rabbitmq,或者在admin页面无法看到所有的queue和exchanges
可参考:
rabbitmq_server-3.5.1 sbin/rabbitmqctl list_vhosts
rabbitmq-plugins enable rabbitmq_management
http://ww1.sinaimg.cn/bmiddle/60c9620fjw1erfc4s2rrbj20fc02at90.jpg
参考: http://blog.csdn.net/yasi_xi/article/details/8655348
修改 rabbitmq.config 文件中为
{rabbitmq_management,
[
{listener, [{port, 8019}]}
]},
这样端口号就改成了 8019了
Invoke rabbitmqctl stop to stop the server.
Invoke rabbitmqctl status to check whether it is running.
We recommend allowing for at least 65536 file descriptors for user rabbitmq in production environments. 4096 should be sufficient for most development workloads.
ulimit: http://www.cnblogs.com/ibook360/archive/2012/05/11/2495405.html
可以使用这个链接进行更改: http://docs.basho.com/riak/latest/ops/tuning/open-files-limit/#Mac-OS-X
ulimit -n 65536
ulimit -u 2048