先安装Elrang
安装:官网地址,http://www.erlang.org
[root@bogon ~]# cd /opt/
[root@bogon opt]# ls
rh
[root@bogon opt]# wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
解压:
[root@bogon opt]# tar -zxvf otp_src_R15B01.tar.gz
[root@bogon opt]# cd otp_src_R15B01
安装依赖:
[root@bogon otp_src_R15B01]# yum install build-essential m4
[root@bogon otp_src_R15B01]# yum install openssl
[root@bogon otp_src_R15B01]# yum install openssl-devel
[root@bogon otp_src_R15B01]# yum install unixODBC
[root@bogon otp_src_R15B01]# yum install unixODBC-devel
[root@bogon otp_src_R15B01]# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
配置configure
[root@bogon otp_src_R15B01]# ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll
[root@bogon otp_src_R15B01]# make
[root@bogon otp_src_R15B01]# make install
完成之后,设置环境变量
#vim /etc/profile
ERL_HOME=/usr/local/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
完成后保存
#source /etc/profile
让环境变量立即生效
然后输入erl,出现erlang shell,如下:
[root@bogon rabbitmq]# erl
Erlang/OTP 18 [erts-7.1] [source-2882b0c] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.1 (abort with ^G)
1> A=12.
12
2> halt().
安装rabbitMq
链接:https://pan.baidu.com/s/1Row7f85N_ArF-4p9kBX2Mg
提取码:blib
去网盘下载rabbitmq安装包,并上传
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# rz -E
rz waiting to receive.
[root@localhost src]# ls
rabbitmq-server-3.6.1-1.noarch.rpm
执行rpm命令安装rabbitMQ
[root@localhost src]# rpm -ivh rabbitmq-server-3.6.1-1.noarch.rpm
warning: rabbitmq-server-3.6.1-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 056e8e56: NOKEY
Preparing... ########################################### [100%]
1:rabbitmq-server ########################################### [100%]
下载配置文件
或者
[root@bogon plugins]# cd /usr/share/doc/rabbitmq-server-3.6.1/
[root@bogon rabbitmq-server-3.6.1]# ls
LICENSE LICENSE-APL2-Stomp-Websocket LICENSE-EPL-OTP LICENSE-MIT-jQuery164 LICENSE-MIT-Sammy060 LICENSE-MPL-RabbitMQ
LICENSE-APACHE2-ExplorerCanvas LICENSE-BSD-base64js LICENSE-MIT-EJS10 LICENSE-MIT-Mochi LICENSE-MIT-SockJS rabbitmq.config.example
LICENSE-APL2-Rebar LICENSE-BSD-glMatrix LICENSE-MIT-Flot LICENSE-MIT-Mochiweb LICENSE-MPL2 README
[root@bogon rabbitmq-server-3.6.1]# cp rabbitmq.config.example rabbitmq.config
修改配置文件64行
[root@bogon rabbitmq-server-3.6.1]# vim rabbitmq.config
快速输入64gg
将%%去掉
去掉{loopback_users,[]}前面的空格
将,号删掉
按键盘i,改为如下
%% guest user from anywhere on the network.
{loopback_users, []}
%% Configuring SSL.
按键盘esc,在xshell的小白条输入
:wq
保存
安装rabbitMQ web后台管理
1.查看插件
[root@localhost src]# cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.1/plugins/
[root@localhost plugins]# ls
amqp_client-3.6.1.ez rabbitmq_consistent_hash_exchange-3.6.1.ez rabbitmq_recent_history_exchange-1.2.1.ez rabbitmq_web_stomp_examples-3.6.1.ez
cowboy-1.0.3.ez rabbitmq_event_exchange-3.6.1.ez rabbitmq_sharding-0.1.0.ez ranch-1.2.1.ez
cowlib-1.0.1.ez rabbitmq_federation-3.6.1.ez rabbitmq_shovel-3.6.1.ez README
mochiweb-2.13.0.ez rabbitmq_federation_management-3.6.1.ez rabbitmq_shovel_management-3.6.1.ez sockjs-0.3.4.ez
rabbit_common-3.6.1.ez rabbitmq_management-3.6.1.ez rabbitmq_stomp-3.6.1.ez webmachine-1.10.3.ez
rabbitmq_amqp1_0-3.6.1.ez rabbitmq_management_agent-3.6.1.ez rabbitmq_tracing-3.6.1.ez
rabbitmq_auth_backend_ldap-3.6.1.ez rabbitmq_management_visualiser-3.6.1.ez rabbitmq_web_dispatch-3.6.1.ez
rabbitmq_auth_mechanism_ssl-3.6.1.ez rabbitmq_mqtt-3.6.1.ez
2.安装插件的命令
[root@bogon rabbitmq-server-3.6.1]# cd /etc/rabbitmq
[root@bogon rabbitmq]# ls
[root@bogon rabbitmq]# cp /usr/share/doc/rabbitmq-server-3.6.1/rabbitmq.config rabbitmq.config
[root@bogon rabbitmq]# ls
rabbitmq.config
[root@bogon rabbitmq]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit@bogon... failed.
* Could not contact node rabbit@bogon.
Changes will take effect at broker restart.
* Options: --online - fail if broker cannot be contacted.
--offline - do not try to contact broker.
启动rabbit mq
[root@bogon rabbitmq]# service rabbitmq-server start
Starting rabbitmq-server: SUCCESS
rabbitmq-server.er.
关闭防火墙
[root@bogon rabbitmq]# service iptables stop
在物理机输入http://192.168.6.130:15672
前面是你虚拟机的ip
用户名和密码:guest
修改配置文件允许guest在任何电脑登录
处于安全的考虑,guest这个默认的用户只能通过http://localhost:15672 来登录,其他的IP无法直接使用guest账号登录。
15672
:rabbitmq控制台连接端口号
5672
:通过程序连接rabbitmq的端口
/usr/share/doc 放的是共享数据,如文档, rabbitmq的配置文件放在/usr/share/doc。
/etc放的是配置文件。
需要将/usr/share/doc的rabbitmq配置文件修改,保存到/etc文件夹中。
修改guest密码
[root@localhost sbin]# pwd
/usr/sbin
[root@localhost sbin]# ls ra*
rabbitmqctl rabbitmq-plugins rabbitmq-server raid-check
[root@localhost sbin]# rabbitmqctl change_password guest 123456
Changing password for user "guest" ...
Ready是准备好的消息 unacked错误的消息(当消费者执行队列内容时有误-一般该数据为0)total当前的队列总数
Can access virtual hosts可管理的虚拟主机