访次: AmazingCounters.com 次

64位CentOS6.2安装erlang及rabbitmqServer

CentOS 6.2 64bit 安装erlang及RabbitMQ Server

1、操作系统环境(CentOS 6.2 64bit)

 1 [root@HAproxy ~]# cat /etc/issue
 2 
 3 CentOS release 6.2 (Final)
 4 Kernel \r on an \m
 5 [root@HAproxy ~]# cat /proc/cpuinfo |grep "clflush size"
 6 clflush size    : 64
 7 clflush size    : 64
 8 clflush size    : 64
 9 clflush size    : 64
10 clflush size    : 64
11 clflush size    : 64
12 clflush size    : 64
13 clflush size    : 64

2、安装erlang依赖的基本环境

[root@HAproxy ~]# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel

3、,并安装erlang

1、首先要先安装GCC GCC-C++ Openssl等以来模块:

yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel

2、再安装ncurses模块

yum -y install ncurses-devel

yum install ncurses-devel

3、下载Erang源代码文件otp_src_R15B03-1.tar.gz文件,并对其付权限和解压文件:

chmod +x otp_src_R15B03-1.tar.gz

tar -xzvf otp_src_R15B03-1.tar.gz

mv otp_src_R15B03-1 erlang_R15B #重命名解压厚的文件

4、下面是安装erlang的重头戏,依次执行以下操作:

cd erlang_R15B/

./configure --prefix=/usr/local/erlang --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac  //不用java编译,故去掉java避免错误

继续配置erlang软件安装环境

[root@localhost otp_src_17.1]# ./configure --prefix=/usr/local/erlang

...

checking for perl... no_perl

configure: error: Perl is required to generate v2 to v1 mib converter script

configure: error: /bin/sh '/root/software/otp_src_17.1/lib/snmp/./configure' failed for snmp/.

configure: error: /bin/sh '/root/software/otp_src_17.1/lib/configure' failed for lib

 

#如上,提示错误,解决方法:安装Perl

[root@localhost otp_src_17.1]# yum install perl

 

 

 

make && make install //编译后安装

5、配置erlang环境:

vi /etc/profile

export PATH=$PATH:/usr/local/erlang/bin

好了,现在erlang的已经配置好了,现在我们来看一下陪在结果:

# whereis erlang

erlang: /usr/local/erlang

 

 

 

 

4、测试erlang环境

 1 [root@HAproxy ~]# erl
 2 Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]
 3 
 4 Eshell V5.10.4  (abort with ^G)
 5 1> A=12.
 6 12
 7 2> A.
 8 12
 9 3>
10 BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
11        (v)ersion (k)ill (D)b-tables (d)istribution
12 [root@HAproxy ~]#

5、下载并安装rabbitmq-server

  1 在CentOS上安装rabbitmq-server
  2 
  3 ***在 CentOS 6.4上安装python***
  4 
  5 注意啊,自己手动安装python2.7.5,不要动系统上面其他的版本
  6 
  7 1,先安装GCC,用如下命令yum install gcc gcc-c++
  8 
  9 yum install zlib
 10 
 11 yum install zlib-devel
 12 
 13 2,下载python-2.7.5.tar.gz文件,修改文件权限chmode +x python-7.5.tar.gz
 14 
 15 3,解压tar文件,tar -xzvf python-2.7.5.tar.gz
 16 
 17 4,cd python-2.7.5
 18 
 19 vim Python-2.7.5/Modules/Setup.dist
 20 
 21 ./configure --prefix=/usr/local/python27 --with-zlib=/usr/include
 22 
 23 make && make install
 24 
 25 5、建立软连接,使系统默认的python指向python27
 26 
 27 mv /usr/bin/python /usr/bin/python2.6.6.old
 28 
 29 ln -s /usr/local/bin/python27 /usr/bin/python
 30 
 31 已经安装完成python的安装或升级的全部操作了,我们再来看一下现在的python的版本:
 32 
 33 # python -V
 34 
 35 Python 2.7.5
 36 
 37 虽然现在python已经安装完成,但是使用yum命令会有问题 yum不能正常工作:
 38 
 39 这是因为yum默认使用的python版本是2.6.6,到哪是现在的python版本是2.7.5,故会出现上述问题,只需要该一下yum的默认python配置版本就行了:
 40 
 41 #vi /usr/bin/yum
 42 
 43 将文件头部的#!/usr/bin/python改为
 44 
 45 #!/usr/bin/python2.6
 46 
 47 ***在 CentOS 6.4上安装Erlang***
 48 
 49 在本节中,我们将来学习如何在CentOS 6.4上安装erlang,具体的Erlang版本是R16B02。
 50 
 51 在安装之前,需要先要安装一些其他的软件,否则在安装中间会出现一些由于没有其依赖的软件模块而失败。
 52 
 53 1、首先要先安装GCC GCC-C++ Openssl等以来模块:
 54 
 55 yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
 56 
 57 2、再安装ncurses模块
 58 
 59 yum -y install ncurses-devel
 60 
 61 yum install ncurses-devel
 62 
 63 3、下载Erang源代码文件文件,并对其付权限和解压文件:
 64 
 65 wget http://www.erlang.org/download/otp_src_R16B02.tar.gz
 66 
 67 chmod +x otp_src_R16B02.tar.gz
 68 
 69 tar -xzvf otp_src_R16B02.tar.gz
 70 
 71 mv otp_src_R16B02 erlang_R16B #重命名解压厚的文件
 72 
 73 4、下面是安装erlang的重头戏,依次执行以下操作:
 74 
 75 cd erlang_R16B/
 76 
 77 ./configure --prefix=/usr/local/erlang --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac //不用java编译,故去掉java避免错误
 78 
 79 make && make install //编译后安装
 80 
 81 5、配置erlang环境:
 82 
 83 vi /etc/profile
 84 
 85 ERL_HOME=/usr/local/erlang
 86 
 87 export PATH=$$PATH:$$ERL_HOME/bin
 88 
 89 好了,现在erlang的已经配置好了,现在我们来测试一下是否安装成功,在控制台输入命令erl,如果在erlang shell里出现下图所示就说明安装成功了:
 90 
 91 此处省略截图了...
 92 
 93 *** 在CentOS上安装rabbitmq-server-3.1.5 ***
 94 
 95 在本节中我们来看一下如何在CentOS上安装RabbitMQ。我们使用的rabbitmq的版本是rabbitmq-server-3.1.5.tar.gz,CentOS的版本是CentOS 6.4 96 
 97 在安装rabbitmq之前需要先安装python和erlang,这两部分的安装过程请参看在 CentOS 6.4上安装python和在 CentOS 6.4上安装Erlang,这里不再赘述。
 98 
 99 安装rabbitmq的具体步骤如下:
100 
101 1、下载rabbitmq-server-3.1.5.tar.gz文件,并解压之:
102 
103 #cd /usr/local
104 
105 #wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-3.1.5.tar.gz
106 
107 #chmod +x rabbitmq-server-3.1.5.tar.gz
108 
109 #tar -xzvf rabbitmq-server-3.1.5.tar.gz
110 
111 2、在编译rabbitmq源码之前先要安装其需要以来包:
112 
113 #yum -y install xmlto
114 
115 否则会编译不通过:
116 
117 /bin/sh: line 1: xmlto: command not found
118 
119 3、开始编译源代码:
120 
121 #cd rabbitmq-server-3.1.5
122 
123 #make
124 
125 #make install TARGET_DIR=/opt/mq/rabbitmq SBIN_DIR=/opt/mq/rabbitmq/sbin MAN_DIR=/opt/mq/rabbitmq/man //将rabbitmq编译到/opt/mq/rabbitmq目录
126 
127 4、安装web插件管理界面
128 
129 #cd /opt/mq/rabbitmq/sbin
130 
131 #mkdir /etc/rabbitmq/
 1 #rabbitmq-plugins enable rabbitmq_management
 2 
 3 5、好了,到这里rabbitmq已经配置好了,可以启动了:
 4 
 5 #./rabbitmq-server start &
 6 
 7 我运行的时候报错了,ERROR: epmd error for host "springzoo": timeout (timed out)
 8 
 9 更改下/etc/hosts:
10 
11 127.0.0.1 localhost springzoo
12 
13 ::1 localhost springzoo
14 
15 # ps aux | grep rabbitmq //查看端口,默认就是5672
16 
17 netstat -tnlp | grep 5672
18 
19 tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 30435/beam.smp
20 
21 tcp 0 0 0.0.0.0:55672 0.0.0.0:* LISTEN 30435/beam.smp
22 
23 tcp 0 0 :::5672 :::* LISTEN 30435/beam.smp
24 
25 如果看到下面的信息就表明已经启动成功了:
26 
27 省略截图....
28 
29 最好我们就可以在浏览器上输入http://127.0.0.1:15672/登录管理界面了
30 
31 使用登录的名户名和密码默认都算guest,登录后的页面如下:

 

6、启动rabbitmq-server

 1 [root@HAproxy ~]# /etc/init.d/rabbitmq-server start
 2 Starting rabbitmq-server:
 3 FAILED - check /var/log/rabbitmq/startup_{log, _err}
 4 rabbitmq-server.
 5 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_err
 6 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_log
 7 ERROR: epmd error for host HAproxy: address (cannot connect to host/port)
 8 [root@HAproxy ~]# hostname
 9 HAproxy
10 [root@HAproxy ~]# vi /etc/sysconfig/network
11 NETWORKING=yes
12 HOSTNAME=HAproxy13 [root@HAproxy ~]# cat /etc/hosts
14 127.0.0.1       localhost
15 127.0.0.1       HAproxy
16 ::1             localhost

7、以上操作排除了因为主机名不同导致RabbitMQ-Server启动报错的问题,请修改主机名(参见上述步骤),再次启动RabbitMQ-Server

1 [root@HAproxy ~]# /etc/init.d/rabbitmq-server restart
2 Restarting rabbitmq-server: RabbitMQ is not running
3 FAILED - check /var/log/rabbitmq/startup_{log, _err}
4 rabbitmq-server.

8、结果同样报错,查看错误的日志:

 1 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_log
 2               RabbitMQ 3.3.0. Copyright (C) 2007-2013 GoPivotal, Inc.
 3   ##  ##      Licensed under the MPL.  See http://www.rabbitmq.com/
 4   ##  ##
 5   ##########  Logs: /var/log/rabbitmq/rabbit@HAproxy.log
 6   ######  ##        /var/log/rabbitmq/rabbit@HAproxy-sasl.log
 7   ##########
 8               Starting broker...
 9 
10 BOOT FAILED
11 ===========
12 
13 Error description:
14    {case_clause,
15        {error,
16            {{shutdown,
17                 {failed_to_start_child,tcp_listener,
18                     {cannot_listen,{0,0,0,0,0,0,0,0},5672,eaddrinuse}}},
19             {child,undefined,'rabbit_tcp_listener_sup_:::5672',
20                 {tcp_listener_sup,start_link,
21                     [{0,0,0,0,0,0,0,0},
22                      5672,
23                      [inet6,binary,
24                       {packet,raw},
25                       {reuseaddr,true},
26                       {backlog,128},
27                       {nodelay,true},
28                       {linger,{true,0}},
29                       {exit_on_close,false}],
30                      {rabbit_networking,tcp_listener_started,[amqp]},
31                      {rabbit_networking,tcp_listener_stopped,[amqp]},
32                      {rabbit_networking,start_client,[]},
33                      "TCP Listener"]},
34                 transient,infinity,supervisor,
35                 [tcp_listener_sup]}}}}
36 
37 Log files (may contain more information):
38    /var/log/rabbitmq/rabbit@HAproxy.log
39    /var/log/rabbitmq/rabbit@HAproxy-sasl.log
40 
41 Stack trace:
42    [{rabbit_networking,start_listener0,4,[]},
43     {rabbit_networking,'-start_listener/4-lc$^0/1-0-',4,[]},
44     {rabbit_networking,start_listener,4,[]},
45     {rabbit_networking,'-boot_tcp/0-lc$^0/1-0-',1,[]},
46     {rabbit_networking,boot_tcp,0,[]},
47     {rabbit_networking,boot,0,[]},
48     {rabbit,'-run_boot_step/1-lc$^1/1-1-',1,[]},
49     {rabbit,run_boot_step,1,[]}]
50 
51 
52 
53 BOOT FAILED
54 ===========
55 
56 Error description:
57    {could_not_start,rabbit,
58     {bad_return,
59      {{rabbit,start,[normal,[]]},
60       {'EXIT',
61        {rabbit,failure_during_boot,
62         {case_clause,
63          {error,
64           {{shutdown,
65             {failed_to_start_child,tcp_listener,
66              {cannot_listen,{0,0,0,0,0,0,0,0},5672,eaddrinuse}}},
67            {child,undefined,'rabbit_tcp_listener_sup_:::5672',
68             {tcp_listener_sup,start_link,
69              [{0,0,0,0,0,0,0,0},
70               5672,
71               [inet6,binary,
72                {packet,raw},
73                {reuseaddr,true},
74                {backlog,128},
75                {nodelay,true},
76                {linger,{true,0}},
77                {exit_on_close,false}],
78               {rabbit_networking,tcp_listener_started,[amqp]},
79               {rabbit_networking,tcp_listener_stopped,[amqp]},
80               {rabbit_networking,start_client,[]},
81               "TCP Listener"]},
82             transient,infinity,supervisor,
83             [tcp_listener_sup]}}}}}}}}}
84 
85 Log files (may contain more information):
86    /var/log/rabbitmq/rabbit@HAproxy.log
87    /var/log/rabbitmq/rabbit@HAproxy-sasl.log
88 
89 {"init terminating in do_boot",{rabbit,failure_during_boot,{could_not_start,rabb                                                                                        use,{error,{{shutdown,{failed_to_start_child,tcp_listener,{cannot_listen,{0,0,0,                                                                                        stener_sup,start_link,[{0,0,0,0,0,0,0,0},5672,[inet6,binary,{packet,raw},{reusea                                                                                        networking,tcp_listener_started,[amqp]},{rabbit_networking,tcp_listener_stopped,                                                                                        or,[tcp_listener_sup]}}}}}}}}}}}
90 tail: /var/log/rabbitmq/startup_log: file truncated        [FAILED]
91 
92 
93 [root@HAproxy ~]# cat /var/log/rabbitmq/startup_err
94 
95 Crash dump was written to: erl_crash.dump
96 init terminating in do_boot ()

9、出现如上的错误,可能是因为5672端口已经被占用的原因。
查看5672端口的情况,如果有进程占用此端口,请将它关闭后,重新启动RabbitMQ-Server;

 1 [root@HAproxy ~]# netstat -atn |grep 5672
 2 tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN
 3 [root@HAproxy ~]# lsof -i:5672
 4 COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
 5 qpidd   1901 qpidd   10u  IPv4  13941      0t0  TCP *:amqp (LISTEN)
 6 [root@HAproxy ~]# chkconfig qpidd off
 7 [root@HAproxy ~]# netstat -atn |grep 5672
 8 tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN
 9 [root@HAproxy ~]# chkconfig qpidd --list
10 qpidd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
11 [root@HAproxy ~]# /etc/init.d/qpidd stop
12 Stopping Qpid AMQP daemon:                                 [  OK  ]
13 [root@HAproxy ~]# netstat -atn |grep 5672
14 tcp        0      0 127.0.0.1:25672             127.0.0.1:60925             TIME_WAIT
15 [root@HAproxy ~]# lsof -i:5672
16 [root@HAproxy ~]# /etc/init.d/rabbitmq-server start
17 Starting rabbitmq-server: SUCCESS
18 rabbitmq-server.

10、查看RabbitMQ服务启动的状态,并开启RabbitMQ的相应管理插件:

  1 [root@HAproxy ~]# rabbitmqctl status
  2 Status of node rabbit@HAproxy ...
  3 [{pid,716},
  4  {running_applications,[{rabbit,"RabbitMQ","3.3.0"},
  5                         {os_mon,"CPO  CXC 138 46","2.2.14"},
  6                         {mnesia,"MNESIA  CXC 138 12","4.11"},
  7                         {xmerl,"XML parser","1.3.5"},
  8                         {sasl,"SASL  CXC 138 11","2.3.4"},
  9                         {stdlib,"ERTS  CXC 138 10","1.19.4"},
 10                         {kernel,"ERTS  CXC 138 10","2.16.4"}]},
 11  {os,{unix,linux}},
 12  {erlang_version,"Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:30] [kernel-poll:true]\n"},
 13  {memory,[{total,36436456},
 14           {connection_procs,2704},
 15           {queue_procs,5408},
 16           {plugins,0},
 17           {other_proc,13704576},
 18           {mnesia,60240},
 19           {mgmt_db,0},
 20           {msg_index,24368},
 21           {other_ets,789624},
 22           {binary,13672},
 23           {code,16399491},
 24           {atom,594537},
 25           {other_system,4841836}]},
 26  {alarms,[]},
 27  {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
 28  {vm_memory_high_watermark,0.4},
 29  {vm_memory_limit,6690450636},
 30  {disk_free_limit,50000000},
 31  {disk_free,47402364928},
 32  {file_descriptors,[{total_limit,924},
 33                     {total_used,3},
 34                     {sockets_limit,829},
 35                     {sockets_used,1}]},
 36  {processes,[{limit,1048576},{used,131}]},
 37  {run_queue,0},
 38  {uptime,83}]
 39 ...done.
 40 
 41 [root@HAproxy ~]# netstat -atn |grep 5672
 42 tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN
 43 tcp        0      0 :::5672                     :::*                        LISTEN
 44 [root@HAproxy ~]# lsof -i:5672
 45 COMMAND  PID     USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
 46 beam.smp 716 rabbitmq   15u  IPv6 1948888      0t0  TCP *:amqp (LISTEN)
 47 [root@HAproxy ~]# rabbitmq-plugins list
 48 [ ] amqp_client                       3.3.0
 49 [ ] cowboy                            0.5.0-rmq3.3.0-git4b93c2d
 50 [ ] eldap                             3.3.0-gite309de4
 51 [ ] mochiweb                          2.7.0-rmq3.3.0-git680dba8
 52 [ ] rabbitmq_amqp1_0                  3.3.0
 53 [ ] rabbitmq_auth_backend_ldap        3.3.0
 54 [ ] rabbitmq_auth_mechanism_ssl       3.3.0
 55 [ ] rabbitmq_consistent_hash_exchange 3.3.0
 56 [ ] rabbitmq_federation               3.3.0
 57 [ ] rabbitmq_federation_management    3.3.0
 58 [ ] rabbitmq_management               3.3.0
 59 [ ] rabbitmq_management_agent         3.3.0
 60 [ ] rabbitmq_management_visualiser    3.3.0
 61 [ ] rabbitmq_mqtt                     3.3.0
 62 [ ] rabbitmq_shovel                   3.3.0
 63 [ ] rabbitmq_shovel_management        3.3.0
 64 [ ] rabbitmq_stomp                    3.3.0
 65 [ ] rabbitmq_tracing                  3.3.0
 66 [ ] rabbitmq_web_dispatch             3.3.0
 67 [ ] rabbitmq_web_stomp                3.3.0
 68 [ ] rabbitmq_web_stomp_examples       3.3.0
 69 [ ] sockjs                            0.3.4-rmq3.3.0-git3132eb9
 70 [ ] webmachine                        1.10.3-rmq3.3.0-gite9359c7
 71 [root@HAproxy ~]# rabbitmq-plugins enable rabbitmq_management
 72 The following plugins have been enabled:
 73   mochiweb
 74   webmachine
 75   rabbitmq_web_dispatch
 76   amqp_client
 77   rabbitmq_management_agent
 78   rabbitmq_management
 79 Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
 80 [root@HAproxy ~]# rabbitmq-plugins enable mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_m                                                             anagement_agent rabbitmq_management
 81 Plugin configuration unchanged.
 82 [root@HAproxy ~]# rabbitmq-plugins list
 83 [E] amqp_client                       3.3.0
 84 [ ] cowboy                            0.5.0-rmq3.3.0-git4b93c2d
 85 [ ] eldap                             3.3.0-gite309de4
 86 [E] mochiweb                          2.7.0-rmq3.3.0-git680dba8
 87 [ ] rabbitmq_amqp1_0                  3.3.0
 88 [ ] rabbitmq_auth_backend_ldap        3.3.0
 89 [ ] rabbitmq_auth_mechanism_ssl       3.3.0
 90 [ ] rabbitmq_consistent_hash_exchange 3.3.0
 91 [ ] rabbitmq_federation               3.3.0
 92 [ ] rabbitmq_federation_management    3.3.0
 93 [E] rabbitmq_management               3.3.0
 94 [E] rabbitmq_management_agent         3.3.0
 95 [ ] rabbitmq_management_visualiser    3.3.0
 96 [ ] rabbitmq_mqtt                     3.3.0
 97 [ ] rabbitmq_shovel                   3.3.0
 98 [ ] rabbitmq_shovel_management        3.3.0
 99 [ ] rabbitmq_stomp                    3.3.0
100 [ ] rabbitmq_tracing                  3.3.0
101 [E] rabbitmq_web_dispatch             3.3.0
102 [ ] rabbitmq_web_stomp                3.3.0
103 [ ] rabbitmq_web_stomp_examples       3.3.0
104 [ ] sockjs                            0.3.4-rmq3.3.0-git3132eb9
105 [E] webmachine                        1.10.3-rmq3.3.0-gite9359c7
106 [root@HAproxy ~]# rabbitmq-plugins list
107 [E] amqp_client                       3.3.0
108 [ ] cowboy                            0.5.0-rmq3.3.0-git4b93c2d
109 [ ] eldap                             3.3.0-gite309de4
110 [E] mochiweb                          2.7.0-rmq3.3.0-git680dba8
111 [ ] rabbitmq_amqp1_0                  3.3.0
112 [ ] rabbitmq_auth_backend_ldap        3.3.0
113 [ ] rabbitmq_auth_mechanism_ssl       3.3.0
114 [ ] rabbitmq_consistent_hash_exchange 3.3.0
115 [ ] rabbitmq_federation               3.3.0
116 [ ] rabbitmq_federation_management    3.3.0
117 [E] rabbitmq_management               3.3.0
118 [E] rabbitmq_management_agent         3.3.0
119 [ ] rabbitmq_management_visualiser    3.3.0
120 [ ] rabbitmq_mqtt                     3.3.0
121 [ ] rabbitmq_shovel                   3.3.0
122 [ ] rabbitmq_shovel_management        3.3.0
123 [ ] rabbitmq_stomp                    3.3.0
124 [ ] rabbitmq_tracing                  3.3.0
125 [E] rabbitmq_web_dispatch             3.3.0
126 [ ] rabbitmq_web_stomp                3.3.0
127 [ ] rabbitmq_web_stomp_examples       3.3.0
128 [ ] sockjs                            0.3.4-rmq3.3.0-git3132eb9
129 [E] webmachine                        1.10.3-rmq3.3.0-gite9359c7
130 [root@HAproxy ~]# netstat -atn |grep 5672
131 tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN
132 tcp        0      0 :::5672                     :::*                        LISTEN
133 [root@HAproxy ~]# netstat -atn |grep 15672
134 [root@HAproxy ~]# netstat -atn |grep 55672
135 [root@HAproxy ~]# /etc/init.d/rabbitmq-server restart
136 Restarting rabbitmq-server: SUCCESS
137 rabbitmq-server.
138 [root@HAproxy ~]# netstat -atn |grep 55672
139 [root@HAproxy ~]# netstat -atn |grep 5672
140 tcp        0      0 0.0.0.0:15672               0.0.0.0:*                   LISTEN
141 tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN
142 tcp        0      0 127.0.0.1:54463             127.0.0.1:25672             TIME_WAIT
143 tcp        0      0 127.0.0.1:60321             127.0.0.1:25672             TIME_WAIT
144 tcp        0      0 127.0.0.1:25672             127.0.0.1:56750             TIME_WAIT
145 tcp        0      0 :::5672                     :::*                        LISTEN
146 
147 就可以用guest,guest登陆http://192.168.1.101:15672端口了。

注意:如果此时你从端口15672或55672登陆不了,请关闭CentOS6.2的防火墙,再次登陆,

如果仍然出现无法登陆的想象,查看日志后,显示:

=ERROR REPORT==== 20-Apr-2014::00:55:15 ===
webmachine error: path="api/whoami"
"Unauthorized"

那么请运行如下的命令,增加用户admin,密码admin即可。

 1 [root@HAproxy ~]# rabbitmqctl add_user admin admin
 2 Creating user "admin" ...
 3 ...done.
 4 [root@HAproxy ~]# rabbitmqctl list_users
 5 Listing users ...
 6 admin   []
 7 guest   [administrator]
 8 ...done.
 9 [root@HAproxy ~]# rabbitmqctl set_user_tags admin administrator
10 Setting tags for user "admin" to [administrator] ...
11 ...done.
12 [root@HAproxy ~]# rabbitmqctl list_users
13 Listing users ...
14 admin   [administrator]
15 guest   [administrator]
16 ...done.

到此,配置完成

posted @ 2016-03-11 18:11  IT老登  阅读(3435)  评论(0编辑  收藏  举报
访次: AmazingCounters.com 次