标签:state serve admin Opens comment www cal api const
服务器:
online-platform-rabbitmq-01
online-platform-rabbitmq-02
online-platform-rabbitmq-03
绑定HOSTS:
10.30.31.xx online-platform-rabbitmq-03
10.30.31.xx online-platform-rabbitmq-02
10.30.31.xx online-platform-rabbitmq-01
安装依赖:
#yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget
安装erlang 语言环境:
#wget http://www.erlang.org/download/otp_src_18.3.tar.gz
#tar -xzvf otp_src_18.3.tar.gz
#cd otp_src_18.3/
#./configure --prefix=/usr/local/erlang
#make && make install
配置erlang环境变量:
vi /etc/profile //在底部添加以下内容
ERL_HOME=/usr/local/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
source /etc/profile
下载安装RabbitMQ:
#cd /usr/local
#wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix-3.6.1.tar.xz
#xz -d rabbitmq-server-generic-unix-3.6.1.tar.xz
#tar -xvf rabbitmq-server-generic-unix-3.6.1.tar
#mv rabbitmq_server-3.6.1/ rabbitmq
#vi /etc/profile
#export PATH=$PATH:/usr/local/rabbitmq/sbin
#source /etc/profile
启动服务:
#rabbitmq-server -detached
#rabbitmq-plugins enable rabbitmq_management
集群配置(01):
#scp /root/.erlang.cookie online-platform-rabbitmq-02:/root/
#scp /root/.erlang.cookie online-platform-rabbitmq-03:/root/
文件权限设置为400
02 和03服务器分别操作操作:
#rabbitmqctl stop_app
#rabbitmqctl reset
#rabbitmqctl join_cluster rabbit@online-platform-rabbitmq-01 --ram
#rabbitmqctl start_app
#rabbitmq-plugins enable rabbitmq_management
web配置:
#01配置:
#rabbitmqctl add_user admin xxxxx
#rabbitmqctl set_user_tags admin administrator
#登陆web
http://服务器:15672/#/ ##admin / xxxxx
iptabels开放端口:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 15672 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 4369 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5672 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 25672 -j ACCEPT
web设置:
在管理policy的时候WebUI是非常不错:
Definition加入两项:
ha-mode:all
ha-sync-mode:automatic
到这里配置已经完成,接下来进行测试。
两个节点之间就会开始同步消息了。
端口:5672
其他相关命令
启动服务:rabbitmq-server -detached【 /usr/local/rabbitmq/sbin/rabbitmq-server -detached 】
查看状态:rabbitmqctl status【 /usr/local/rabbitmq/sbin/rabbitmqctl status 】
关闭服务:rabbitmqctl stop【 /usr/local/rabbitmq/sbin/rabbitmqctl stop 】
列出角色:rabbitmqctl list_users
标签:state serve admin Opens comment www cal api const
原文地址:https://www.cnblogs.com/Qing-840/p/9595686.html