linux安裝rabbitMQ
安裝rabbitMQ需要提前安裝elarge。
參考多個博客安裝,各種問題,各種失敗。各種依賴問題。
因此把安裝步驟記錄下來。
1.安裝elarge:
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
安裝各種依賴:
yum -y install unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-gl
yum -y install install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl openssl-devel xmlto zip unzip
yum -y install gtk2-devel binutils-devel
下載這三個依賴:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/wxGTK3-3.0.2-14.el6.x86_64.rpm
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/wxGTK3-3.0.2-14.el6.x86_64.rpm
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/wxBase3-3.0.2-14.el6.x86_64.rpm
安裝下載的三個依賴:
rpm -ivh wxBase3-3.0.2-14.el6.x86_64.rpm
rpm -ivh libmspack-0.5-0.1.alpha.el6.x86_64.rpm
rpm -ivh libmspack-0.5-0.1.alpha.el6.x86_64.rpm
下載otp_src_19.3.tar.gz:
wget http://erlang.org/download/otp_src_19.3.tar.gz
解壓otp_src_19.3.tar.gz:
tar -xvzf otp_src_19.3.tar.gz
cd otp_src_19.3
配置cd otp_src_19.3:
./configure --enable-smp-support --enable-threads --enable-sctp --enable-kernel-poll --enable-hipe --with-ssl
上述參數說明:
--prefix 指定安裝目錄
--enable-smp-support啟用對稱多處理支持(Symmetric Multi-Processing對稱多處理結構的簡稱)
--enable-threads啟用異步線程支持
--enable-sctp啟用流控制協議支持(Stream Control Transmission Protocol,流控制傳輸協議)
--enable-kernel-poll啟用Linux內核poll
--enable-hipe啟用高性能Erlang(High Performance Erlang)參考資料:http://www.cnblogs.com/me-sa/archive/2012/10/09/erlang_hipe.html
--with-ssl使用SSL包
執行命安裝
make && make install
下面幾步為檢測erlang 是否安裝正常
find / -name erlang
/root/otp_src_19.3/lib/jinterface/java_src/com/ericsson/otp/erlang
/usr/share/java/erlang
/usr/local/lib/erlang
/usr/lib64/erlang
find / -name erl
/root/otp_src_19.3/bin/erl
/root/otp_src_19.3/bootstrap/bin/erl
/root/otp_src_19.3/erts/etc/win32/msys_tools/erl
/root/otp_src_19.3/erts/etc/win32/cygwin_tools/erl
/usr/local/bin/erl
/usr/local/lib/erlang/erts-8.3/bin/erl
/usr/local/lib/erlang/bin/erl
如果有如下信息提示出現,則標示 erlang 安裝正常
[[email protected] ~]# /usr/local/bin/erl
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
2.安裝rabbitMQ
下載rabbitmq-server-generic-unix-3.6.9.tar.xz :
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.9/rabbitmq-server-generic-unix-3.6.9.tar.xz
安裝xz解壓軟件:
yum -y install xz
解壓:
xz -d rabbitmq-server-generic-unix-3.6.9.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.6.9.tar
配置環境變量(這個我沒有配置)
ERL_HOME=/usr/local/lib/erlang
RABBITMQ_HOME=/usr/local/rabbitmq
PATH=$PATH:$ERL_HOME/bin:/usr/local/rabbitmq/sbin
export ERL_HOME PATH RABBITMQ_HOME
啟動:
rabbitmq-server start
此時登陸http://IP:15672/ 還不能看到管理界面。
進行如下操作。
添加用戶
[[email protected] sbin]# rabbitmqctl add_user admin admin
Creating user "admin" ...
設置用戶權限為administrator
[[email protected] sbin]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
[[email protected] sbin]#
查看插件
[[email protected] sbin]# rabbitmq-plugins list
Configured: E = explicitly enabled; e = implicitly enabled
| Status: * = running on [email protected]
|/
[ ] amqp_client 3.6.9
[ ] cowboy 1.0.4
[ ] cowlib 1.0.2
[ ] rabbitmq_amqp1_0 3.6.9
[ ] rabbitmq_auth_backend_ldap 3.6.9
啟用插件 ,可以使用rabbitmq管理界面
[[email protected] sbin]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
amqp_client
cowlib
cowboy
rabbitmq_web_dispatch
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to [email protected].. started 6 plugins.
查看運行狀態
[[email protected] sbin]# rabbitmqctl status
Status of node [email protected] ...
[{pid,1612},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.6.9"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.9"},
{amqp_client,"RabbitMQ AMQP Client","3.6.9"},
{kernel,"ERTS CXC 138 10","5.2"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:2:2] [async-threads:64] [hipe] [kernel-poll:true]\n"},
{memory,
[{total,60247192},
{connection_readers,0},
{uptime,466},
{kernel,{net_ticktime,60}}]
查看用戶列表
[[email protected] sbin]# rabbitmqctl list_users
Listing users ...
admin [administrator]
guest [administrator]
重啟服務:
service iptables restart
到此,漂亮的界面就能看到了!!!
後臺啟動rabbitmq命令
/usr/local/rabbitmq/sbin/rabbitmq-server -detached
如果登陸http://IP:15672/ 還不能看到管理界面。可能事防火墻問題。
需要對防火墻進行處理:
找到iptables配置路徑:
[[email protected] sbin]# find / -name iptables
/etc/sysconfig/iptables
修改配置文件:
[[email protected] sbin]# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 28017 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 15672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25672 -j ACCEPT
重啟服務:
service iptables restart
參考博客:http://blog.csdn.net/spyiu/article/details/32134443
界面管理介紹可參考:http://blog.csdn.net/u013696226/article/details/21530659
linux安裝rabbitMQ