MQ部署文档
1.安装依赖和erlang
Shell >yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto
Shell >tar -zxvf otp_src_17.0.tar.gz
Shell >cd otp_src_17.0
Shell >./configure --prefix=/usr/local/erlang
Shell >make && make install
1.1查看安装结果
Shell >cd /usr/local/erlang/bin
Shell >./erl
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.3 (abort with ^G)
1>
当出现以上信息时表示安装完成。然后输入’halt().’退出即可。
1.2配置Erlang环境变量
Shell >vim /etc/profile
在最底部加入
export PATH=$PATH:/usr/local/erlang/bin
wq保存退出
Shell >source /etc/profile
2.安装rabbitmq-server
Shell >yum -y install socat
Shell >cd /opt/packages
Shell >rpm -ivh rabbitmq-server-3.6.6-1.el7.noarch.rpm --nodeps
Shell > cd /sbin/
Shell >./rabbitmq-server -detached //启动服务
查看服务 ./rabbitmqctl status
提示
Status of node [email protected] ...
[{pid,58907},
{running_applications,[{rabbit,"RabbitMQ","3.6.6"},
{mnesia,"MNESIA CXC 138 12","4.12"},
{os_mon,"CPO CXC 138 46","2.2.15"},
{rabbit_common,[],"3.6.6"},
{ranch,"Socket acceptor pool for TCP protocols.",
"1.2.1"},
{xmerl,"XML parser","1.3.7"},
{sasl,"SASL CXC 138 11","2.4"},
{stdlib,"ERTS CXC 138 10","2.0"},
{kernel,"ERTS CXC 138 10","3.0"}]},
{os,{unix,linux}},
{erlang_version,"Erlang/OTP 17 [erts-6.0] [source] [64-bit] [async-threads:64] [hipe] [kernel-poll:true]\n"},
{memory,[{total,44108992},
{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,0},
{queue_procs,2728},
{queue_slave_procs,0},
{plugins,0},
{other_proc,18607168},
{mnesia,58040},
{mgmt_db,0},
{msg_index,50032},
{other_ets,987888},
{binary,21624},
{code,19778381},
{atom,752537},
{other_system,3850594}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,1191442841},
{disk_free_limit,50000000},
{disk_free,47948705792},
{file_descriptors,[{total_limit,924},
{total_used,2},
{sockets_limit,829},
{sockets_used,0}]},
{processes,[{limit,1048576},{used,137}]},
{run_queue,0},
{uptime,171},
{kernel,{net_ticktime,60}}]
则启动成功
2.2关闭服务:
Shell > ./rabbitmqctl stop
提示:
Stopping and halting node [email protected] ...
2.3配置网页插件
Shell > cd /sbin
Shell >./rabbitmq-plugins enable rabbitmq_management
2.4添加用户和权限
cd /sbin/
添加用户: shell >rabbitmqctl add_user admin admin123
添加权限: shell >rabbitmqctl set_permissions -p "/"admin".*"".*"".*"
修改用户角色: shell >rabbitmqctl set_user_tags admin administrator
2.5 关闭防火墙systemctl stop firewalld.service
2.6登录