先安裝Elrang
安裝:官網(wǎng)地址颗品,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
完成之后跺撼,設(shè)置環(huán)境變量
#vim /etc/profile
ERL_HOME=/usr/local/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
完成后保存
#source /etc/profile
讓環(huán)境變量立即生效
然后輸入erl,出現(xiàn)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
去網(wǎng)盤下載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
執(zhí)行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,[]}前面的空格
將,號(hào)刪掉
按鍵盤i,改為如下
%% guest user from anywhere on the network.
{loopback_users, []}
%% Configuring SSL.
按鍵盤esc,在xshell的小白條輸入
:wq
保存
安裝rabbitMQ web后臺(tái)管理
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.
啟動(dòng)rabbit mq
[root@bogon rabbitmq]# service rabbitmq-server start
Starting rabbitmq-server: SUCCESS
rabbitmq-server.er.
關(guān)閉防火墻
[root@bogon rabbitmq]# service iptables stop
在物理機(jī)輸入http://192.168.6.130:15672
前面是你虛擬機(jī)的ip
用戶名和密碼:guest
修改配置文件允許guest在任何電腦登錄
處于安全的考慮,guest這個(gè)默認(rèn)的用戶只能通過(guò)http://localhost:15672 來(lái)登錄搞动,其他的IP無(wú)法直接使用guest賬號(hào)登錄躏精。
15672
:rabbitmq控制臺(tái)連接端口號(hào)
5672
:通過(guò)程序連接rabbitmq的端口
/usr/share/doc 放的是共享數(shù)據(jù),如文檔, 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是準(zhǔn)備好的消息 unacked錯(cuò)誤的消息(當(dāng)消費(fèi)者執(zhí)行隊(duì)列內(nèi)容時(shí)有誤-一般該數(shù)據(jù)為0)total當(dāng)前的隊(duì)列總數(shù)
Can access virtual hosts可管理的虛擬主機(jī)