centos下安装RabbitMQ
原创大约 1 分钟
centos下安装RabbitMQ
这篇记录发生在
2022-05-06
, 下面内容不做整理仅作记录,待后续在有RabbitMQ需求的时候做参考。
当有新的记录后此记录可能会删除
记录
yum install -y socat
-- 安装 Erlang
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
cd /opt
tar -zxvf otp_src_19.0.tar.gz
cd otp_src_19.0/
./configure --prefix=/usr/local/erlang --enable-smp-support --enable-threads --enable-sctp --enable-kernel-poll --enable-hipe --with-ssl
make && make install
ln -s /usr/local/erlang/bin/erl /usr/bin/erl
erl
-- 安装 rabbitMq
rpm -ivh --nodeps rabbitmq-server-3.6.10-1.el7.noarch.rpm
-- 使用
systemctl status rabbitmq-server
systemctl start rabbitmq-server
systemctl restart rabbitmq-server
chkconfig rabbitmq-server on
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl list_users
rabbitmqctl add_user admin xxxxxxx
rabbitmqctl set_user_tags admin administrator
rabbitmqctl list_users
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
http://186.137.xxx.xxx:15672/
admin xxxxxxx
-- 插件 rabbitmq_delayed_message_exchange-20171215-3.6.x.ez
cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.10/plugins
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
---------------
vim /usr/lib/rabbitmq/bin/rabbitmq-defaults
----------集群命令
cd /var/log/rabbitmq
cd /var/lib/rabbitmq
处理 .erlang.cookie 一致
chown -R rabbitmq:rabbitmq rabbitmq
chown -R rabbitmq:rabbitmq .erlang.cookie
rabbitmqctl cluster_status
rabbitmqctl reset
rabbitmqctl forget_cluster_node rabbit@os205
rabbitmqctl forget_cluster_node rabbit@os200
rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@os201
rabbitmqctl start_app
rabbitmqctl stop_app
rabbitmqctl join_cluster --ram rabbit@os201
rabbitmqctl start_app
------------
ss -tnlp |grep 15672
ss -tnlp |grep 5672
ss -tnlp |grep 25672
ss -tnlp |grep 4369
--------------
rabbitmqctl stop_app
rabbitmqctl change_cluster_node_type ram
rabbitmqtl start_app
-----------------------------rabbitmqctl list_policies
rabbitmqctl set_policy ha-all "^" '{"ha-mode":"all","ha-sync-mode":"automatic"}'
rabbitmqctl set_policy -p inner_task_system ha-all "^" '{"ha-mode":"all","ha-sync-mode":"automatic"}'
rabbitmqctl set_policy -p outer_task_system ha-all "^" '{"ha-mode":"all","ha-sync-mode":"automatic"}'